---
title: "Add text overlays to videos"
description: "Burn text, captions, or watermarks directly into video files."
url: "https://www.pixeltable.com/notebooks/video-add-text-overlay"
updated: "2026-04-10"
---

# Add text overlays to videos

Burn text, captions, or watermarks directly into video files.

- **Type:** Notebook
- **Group:** Video

## How it works

Use video.overlay_text() to burn text into videos with full control over styling and position, and video.crop() to extract a rectangular region.

## What it covers

- Add simple text overlays
- Create styled captions with backgrounds
- Position text with alignment options
- Crop a rectangular region from a video

## What it uses

- **Install:** `pip install pixeltable`
- **Pixeltable calls:** `pxt.create_table()`, `insert()`, `add_computed_column()`

## A look at the code

```python
# Add a simple watermark in the corner
videos.add_computed_column(
    watermarked=videos.video.overlay_text(
        'My Brand',
        font_size=24,
        color='white',
        opacity=0.7,
        horizontal_align='right',
        horizontal_margin=20,
        vertical_align='top',
        vertical_margin=20,
    )
)
```

## Open it

- **Open in Colab:** https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/video/video-add-text-overlay.ipynb
- **Docs page:** https://docs.pixeltable.com/howto/cookbooks/video/video-add-text-overlay
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/video/video-add-text-overlay.ipynb
