Part of the Video Maker pack. Procedure for word-timed captions in Remotion - transcribing with Whisper or parsing SRT/VTT, proofreading, building caption pages with @remotion/captions, styling inside the safe area, burned-in versus sidecar SRT, and checking sync. Load only when the Video Maker agent or the user asks for it by name.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Video Maker Captions?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mhdaljuboori-video-maker-captions)
---
name: video-maker-captions
description: Part of the Video Maker pack. Procedure for word-timed captions in Remotion - transcribing with Whisper or parsing SRT/VTT, proofreading, building caption pages with @remotion/captions, styling inside the safe area, burned-in versus sidecar SRT, and checking sync. Load only when the Video Maker agent or the user asks for it by name.
---
# Captioning a video
Most social video is watched muted. Captions are part of the design: readable, in sync, and clear of the content and the app's UI. Safe areas, caption sizes and the reading-speed limit are in the spec in `video-maker-render` (section 1).
## 0. A video that is not a Remotion project
To caption a plain `.mp4`, the agent needs a small Remotion project around it (the video as a `<Video>` layer, captions on top). That means creating a project and installing packages: say so and get the user's OK first (see `video-maker-animate`, section 1).
## 1. Get words with timings
1. **An existing caption file** (`.srt`, `.vtt`): parse it with `parseSrt()` or `parseVtt()` from `@remotion/captions`.
2. **Audio exists (voiceover or speech): transcribe it.** Local and free with `@remotion/install-whisper-cpp`:
- Convert to 16-bit 16 kHz mono WAV: `ffmpeg -i in.mp4 -ar 16000 -ac 1 -c:a pcm_s16le audio.wav`.
- `installWhisperCpp({ to, version })` and `downloadWhisperModel({ model, folder })`. The model download is large: ask first.
- `transcribe({ inputPath, whisperPath, whisperCppVersion, model, tokenLevelTimestamps: true, splitOnWord: true })` (token-level timestamps need whisper.cpp 1.5.5 or newer; pass the same version you installed), then `toCaptions({ whisperCppOutput })`.
- A hosted transcription API only if the user has an account and agrees; the key stays in an env var and is never printed.
3. **Only when there is no audio-timed source** (a text-only video built from the script): spread each line's words over that line's frames by character count.
Save the result as `public/captions.json` in Remotion's `Caption` shape (`text`, `startMs`, `endMs`, `timestampMs`, `confidence`) so renders repeat. Each caption's `text` starts with a space (that is how words join); render the caption container with `white-space: pre` so the spaces survive.
## 2. Proofread
Transcription errs on names, product terms and numbers. Fix them against the script or ask the user. A word you cannot confirm is marked `[NEEDED: check "<word>"]` for the user, never guessed. Keep the speaker's words and meaning.
## 3. Build caption pages
- `createTikTokStyleCaptions({ captions, combineTokensWithinMilliseconds })` groups words into pages. About 800–1200 ms gives 2–4 words per page for social; larger values give full lines for 16:9. Where the installed version supports it, `breakOnSilenceAfterMilliseconds` starts a new page after a pause, so a page never spans a silence.
- Render each page in a `<Sequence>` from `Math.round(page.startMs / 1000 * fps)` for its length; inside, highlight the active token by comparing its `fromMs`/`toMs` with the current time.
- Rules: 2–4 words per page for social (one line); at most 2 lines of about 32–42 characters for 16:9. Never split a name or a number across pages. Each page on screen at least about 0.7 s, and no faster than about 17–20 characters per second.
## 4. Style
- Size from the spec; bold, a clean sans (the brand font if legible).
- White or the brand's light color with a dark outline, shadow or semi-opaque box; 4.5:1 or more against the worst frame under it.
- Active word: color or weight change, or a small scale (1.05–1.1) with `transform`. No bounce on every word.
- Position inside the safe area, usually the lower-middle third; never over a face or the product. Same position and style through the video; when a scene's content needs that space, move the captions for that scene.
- Do not stack captions on a headline that says the same words: move one, or drop the caption for that line.
## 5. Burned in or sidecar
- **Burned in:** the default for social, where players often ignore caption files.
- **Sidecar** `.srt`: best for YouTube, LinkedIn and websites (viewers can turn it off; search engines read it). Write it with `serializeSrt()` from the same caption JSON, and add meaningful non-speech sounds (`[music swells]`, `[phone buzzes]`).
- Offer both when the platform takes a file.
## 6. Check
- Stills at three or four caption moments: size, contrast, safe area (9:16 with the safe-area overlay on).
- Sync on short drafts (`--frames=<a>-<b> --scale=0.5`) at the start, middle and end; drift shows at the end. Words appear on or slightly before the spoken word, never after.
- Proof every page once more for names and numbers. Then render and verify with `video-maker-render`.