# Captions and transcripts

> Add subtitle files to a saved video, and optionally turn on speech recognition so your own server writes a transcript from the sound. Nothing leaves your server.

Source: https://crawl-docs.pdhq.win/guide/captions-and-transcripts/
Last updated: 2026-12-02

A saved video can have two kinds of words with it.

| Kind | What it is | Where it comes from |
| --- | --- | --- |
| **Subtitle files** | WebVTT files kept next to the video. | The site (YouTube's own captions, saved with the post), or a file you add yourself. |
| **A transcript** | The words found by speech recognition, kept as its own small file. | Your server, only when you ask, and only if you turned the feature on. |

The player's **Subtitles** menu and the **Transcript** panel use whichever exists. A transcript is kept apart from the subtitle files, and you can delete it any time.

## Use subtitle files

1. Open a video post and press **Settings** (the gear) in the player, then **Subtitles**.
2. Choose a file from the list, or **Off**. The `C` key cycles through them.
3. To add your own, choose **Add a subtitle file…** and pick a `.vtt` file. To remove one, choose **Remove this subtitle file**.

For YouTube videos, the extension saves the uploader's captions, the automatic captions, and one automatic translation into the language you set in the extension's **YouTube** settings. **Save all subtitles** saves every track YouTube offers, which can be over a hundred files.

## Make a transcript from the sound

This needs the speech recognition feature on your server. When it is off, the menu entry **Make captions from the sound…** is not shown at all.

1. In the player, open **Settings → Subtitles → Make captions from the sound…**.
2. The server listens to the video in pieces of 10 minutes and writes the words. The job shows in [The queue](https://crawl-docs.pdhq.win/guide/the-queue.md).
3. When it is done, the captions (CC) and the transcript panel use it.

**It runs on your server.** Nothing is sent anywhere. It runs one video at a time, after the smaller copies waiting in the queue, and uses the processor threads you gave it while it works.

**Delete it:** the X beside it in the Subtitles menu removes the file. Nothing else made from a video is saved with the post.

A transcript is also included in the post's Markdown file and in a share link's Markdown, so an AI tool can read what is said in the video.

## Turn on speech recognition

> [!NOTE]
> This is optional and adds a large download. Skip it if you do not need transcripts.

**With Docker or Dokploy:** set `API_TARGET=runtime-speech` in the service's environment (and `SPEECH_THREADS=2` on a server with 2 processors), then redeploy. That builds a second API image on Debian with CPU-only PyTorch, OpenAI's `openai-whisper` and its `base` model.

| Thing | Value |
| --- | --- |
| Size | About 3 GB for the image. The first build downloads that much. |
| Model | `base` (145 MB) by default. `SPEECH_MODEL_NAME=small` (484 MB) is about three times slower and better for accents, noise and other languages. |
| Speed, measured | On 2 threads, `base` listened to a 162-second clip in 20 seconds and to a 40-minute sound in 254 seconds, using about 1.1 GB of memory. A slower or shared processor takes longer. |
| Longest sound | `SPEECH_MAX_MINUTES`, 240 by default. |
| Language | `SPEECH_LANGUAGE`: `auto` or a code such as `en`. |

To switch it off, remove `API_TARGET` and redeploy.

**Hosts the build must reach** (a firewall that limits outgoing traffic must allow them): `deb.debian.org`, `pypi.org`, `files.pythonhosted.org`, `download.pytorch.org`, `download-r2.pytorch.org` and `openaipublic.azureedge.net` (the model). When it runs, nothing is downloaded.

**Your own program:** the server calls any program that takes whisper.cpp's `whisper-cli` options. Put it and a model file inside the API container and set `SPEECH_COMMAND` and `SPEECH_MODEL`. Both are needed; if either is missing or the file is not there, the feature stays off and the API's log says which one.

See [Environment variables](https://crawl-docs.pdhq.win/advanced/environment-variables.md) for every speech setting.
