agentleFS
MmbugraaslanMmbugraaslan/motion-plus/skills/word-captions/SKILL.md

word-captions

Skill0 starsChanged 5 days agoMITView on GitHub

Add word-timed, TikTok-style captions to Remotion videos, from transcribing speech with faster-whisper (any language) to Caption JSON, the highlighted caption track and .srt import. Use for captions or subtitles on any video.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All captions use the Caption type from @remotion/captions:

    line 8
  2. Very specific:

    Put each clip's video and its captions in the same <Sequence>.

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Word Captions

All captions use the Caption type from @remotion/captions:

type Caption = { text: string; startMs: number; endMs: number; timestampMs: number | null; confidence: number | null };

text keeps a leading space before each word (" hello").

Transcribe

For talking-head clips, scripts/talking_head.py already transcribes and outputs caption groups. For a standalone voiceover:

from faster_whisper import WhisperModel
m = WhisperModel("small", device="cpu", compute_type="int8")
segments, _ = m.transcribe("voice.wav", language="en", word_timestamps=True)
  • Always pass language.
  • Whisper splits some words into pieces; a piece without a leading space belongs to the previous word, so glue it on.
  • Strip punctuation for TikTok-style captions.
  • Fix brand names, numbers and English tech words by hand. Whisper often gets them wrong.

Display

Use studio/src/WordCaptions.tsx:

<WordCaptions captions={captions} locale="en" highlightColor="#3DF5C8" emphasize={["free"]} />
  • Shows 1-2 words at a time (combineWithinMs: 200 ≈ one word, 400 ≈ 1-2, 1200 ≈ short phrase).
  • The word being spoken turns highlightColor; emphasize words pop.
  • locale drives uppercasing (Turkish i → İ); common English words keep English casing in Turkish videos.
  • Render one <WordCaptions> per sentence so a page never spans two sentences.
  • bottom: 300-420 on 1080x1920 keeps captions above platform UI.

Keep video and captions together

Put each clip's video and its captions in the same <Sequence>; apply trimBefore/playbackRate to the shared parent, not only to the video.

Import .srt

import { parseSrt } from "@remotion/captions";
const { captions } = parseSrt({ input: srtText });

Parse once in Node and save JSON, so rendering never fetches.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.