Captions — 6 animated subtitle styles (Remotion)
Code: starter/src/captions/Captions.tsx (components + wordsFromPhrase, paginatePhrases, paginate) and CaptionsDemo.tsx in claude-motion-skills.
Pick ONE caption style per video and keep it for the whole reel.
Pick a style
| Style | Looks like | Best on | Use for |
|---|---|---|---|
BoldPop | UPPERCASE heavy sans, 6 px dark stroke + drop shadow, keyword in accent, each word pops (spring d11 s260, scale 0.7→1) | talking head, busy video | energetic tips, sales, hooks |
Karaoke | whole page small; spoken word 104 px in accent, past words white, future words 55 % | any | fast speech, retention |
Editorial | small sans words inline + keyword as a giant serif-italic quote on its own line | dark / photo | storytelling, statements |
SerifMix | calm grotesk; keyword switches to serif italic; words fade from 25 % | dark / cinematic | premium, emotional |
BoxLine | white rounded plate, active word and keyword on accent plate | light grounds | product, education (most readable) |
Minimal | lowercase medium, one line, soft fade | aesthetic footage | vlogs, calm content |
Timing (the part that makes or breaks captions)
- Word timestamps from ASR: Whisper with
word_timestamps=True(or@remotion/openai-whisper/@remotion/install-whisper-cpp). Check them — ±0.15 s max drift. - Low-resource languages (where ASR words are unreliable, e.g. Uzbek): measure phrase start/end with
ffmpeg -af silencedetect=noise=-34dB:d=0.15, thenwordsFromPhrase("text with *keyword*", start, end)spreads words by character length. Mark the keyword with*word*. - Pages: prefer
paginatePhrases(phrases, 24, 4)— pages never mix two sentences and each fits one plate line (≤ 24 chars incl. spaces, ≤ 4 words).paginate(words, n)(fixed word count) only for quick tests. A page stays ≥ 0.6 s; never split a number from its unit.- A lone dash/punctuation token (
—,…) is glued to the previous word bywordsFromPhrase, so it never gets its own highlight.
- A lone dash/punctuation token (
- Captions must say exactly what the voice says (if TTS skipped a word, drop it from captions too).
Layout rules
- Safe zone: text inside y 285–1248, x 80–910 (1080×1920). Default caption band y 1020–1240; move up when the lower third holds a product.
- One keyword per page in the accent colour (never red text for keywords — low contrast); contrast ≥ 4.5:1 with stroke/plate/shadow as needed.
- When NOT to caption: if the big on-screen headline already says the voice line (kinetic-type styles like Aura or News Flash), skip captions for that scene — never show the same sentence three times (headline + caption + voice).
- Fonts must contain your language's glyphs (Uzbek ʻ ʼ: Inter, Inter Tight, Playfair Display ✓).
Quality checklist
- Contact sheet of the whole video: no caption over faces/products, no page flicker, keyword colour consistent.
- Scrub the 3 fastest sentences: caption ↔ voice drift ≤ 0.15 s.
- Watch once muted on a phone: can a viewer follow the whole story from captions alone?