speech-captions
Skill1 starsChanged 3 months agoMITView on GitHub
Transcribe speech to timed captions with faster-whisper, detect spoken language, and build SRT/VTT from text or segments. Use when you need automatic captions from audio/video, language detection before transcription, or subtitle files from transcript JSON.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- site/AGENTS.mdAGENTS.md
- site/CLAUDE.mdCLAUDE.md
- audioSkill
- captions-complianceSkill
- downloadSkill
- forced-narrative-exactSkill
- imageSkill
- inspectSkill
- install-media-toolsSkill
- program-masterSkill
- shotsSkill
- subtitlesSkill
- timecodeSkill
- video-transformationSkill
- vision-analysisSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 43
If your tools showed a filesystem path when loading this SKILL.md, strip SKILL.md and use that folder.
- Very specific: line 44
If you already ran another mediaskills script (for example .../audio/scripts/extract.py), this skill is a sibling of that folder: same …
- Very specific: line 67
Prefer absolute paths for --input / --output when cwd is uncertain.
- Distinctive: line 72
Before running any script, treat these two failures differently:
- Very specific: line 75
Only escalate sandbox permissions if the error is explicitly a permission denial (e.g.
- Very specific: line 93
Check data.language and data.probability before committing to a larger whisper model.
≈ “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.
Files
Speech Captions
Automatic speech-to-text and caption file generation. Use this skill when you need spoken content turned into subtitles — not when muxing or burning captions (see subtitles).
When to use
- This skill — transcribe dialogue, detect language, convert transcript text/segments to SRT or WebVTT.
subtitles— convert/shift/extract/burn existing subtitle files after you have captions.audio— extract or normalize audio before transcription when the source is noisy or the wrong sample rate.inspect— confirm duration, audio codec, and that an audio stream exists before running whisper.
Gotchas
- First run downloads a model —
faster-whispercaches models under~/.cache/huggingface.tinyis fast but less accurate; usesmallormediumfor production dialogue. - CPU-only by default — scripts use
device="cpu"andcompute_type="int8". GPU setups can edit the script or run whisper elsewhere; these CLIs target portable agent use. - Plain text → cues is approximate —
to-srt.py/to-vtt.pysplit on sentence boundaries and spread cues evenly. For accurate timing, usetranscribe.pyor pass--segments-jsonfrom a real ASR pass. - Music and silence — whisper may hallucinate text on instrumentals or long silence. Inspect output; trim leading/trailing silence with
audiofirst if needed. - Language auto-detection —
detect-language.pysamples the first 60 seconds. Short clips or multilingual content may misreport; pass an explicit language to whisper in a custom workflow if you know the locale. - Video inputs — transcription extracts mono 16 kHz WAV via ffmpeg. Very long files take proportionally longer; there is no chunking in the default transcribe script.
Running scripts
This skill's scripts live in scripts/ alongside this file. Before running any script, resolve its absolute path from this skill's own directory — do not assume the shell cwd is the skill folder, the repo root, or the workspace. Stay in the workspace (so media paths resolve) and pass the absolute script path to uv run:
uv run <skill_directory>/scripts/transcribe.py --input "<path-to-media>" --model tiny<skill_directory> is a placeholder. Never pass those angle brackets to the shell — the command will fail. Replace it with a real absolute directory before invoking uv run.
How to get that directory (do this yourself; do not ask the user first; do not skip the skill):
- If your tools showed a filesystem path when loading this
SKILL.md, stripSKILL.mdand use that folder. - If you already ran another mediaskills script (for example
.../audio/scripts/extract.py), this skill is a sibling of that folder: same parent, directory namespeech-captions. - Otherwise search standard install locations and confirm the script exists:
NAME=speech-captions
for d in \
"$HOME/.agents/skills/$NAME" \
"$HOME/.cursor/skills/$NAME" \
"$HOME/.codex/skills/$NAME" \
"$HOME/.claude/skills/$NAME" \
"$PWD/.agents/skills/$NAME" \
"$PWD/.cursor/skills/$NAME" \
"$PWD/skills/$NAME"
do
if [ -f "$d/SKILL.md" ] && [ -e "$d/scripts/transcribe.py" ]; then
SKILL_DIR=$(cd "$d" && pwd)
break
fi
done
[ -n "$SKILL_DIR" ] || { echo "mediaskills: $NAME not found" >&2; exit 1; }
uv run "$SKILL_DIR/scripts/transcribe.py" --input "<path-to-media>" --model tinyPrefer absolute paths for --input / --output when cwd is uncertain.
Missing binaries vs permissions
Before running any script, treat these two failures differently:
- If a required binary (
uv,ffmpeg) reportsNo such file or directoryorcommand not found: this is a missing or unreachable binary, not a permissions issue. Escalating sandbox permissions will not fix it. Runcommand -v uvandcommand -v ffmpegto see whether they resolve at all. If not, install or re-link them (install-media-toolsdoctor/install) rather than retrying with wider permissions. - Only escalate sandbox permissions if the error is explicitly a permission denial (e.g.
Operation not permitted,Permission denied).
Recipes
Transcribe a clip to SRT + JSON
uv run <skill_directory>/scripts/transcribe.py --input interview.mp4 --model tinyReturns data.srt_path, data.json_path, full text, and per-segment timings in data.segments.
Detect language before choosing a model
uv run <skill_directory>/scripts/detect-language.py --input interview.mp4Check data.language and data.probability before committing to a larger whisper model.
Build SRT from transcript text (no ASR)
uv run <skill_directory>/scripts/to-srt.py --text "Hello world. This is a test." --duration 6 --output captions.srtBuild VTT from transcribe JSON
uv run <skill_directory>/scripts/to-vtt.py --segments-json interview_transcript.json --output captions.vttThe JSON file can be the json_path from transcribe.py (it includes a top-level segments array).
End-to-end caption pipeline
inspect— confirm audio stream and duration.speech-captions transcribe— produce SRT + JSON.subtitles shift— fix sync offset if captions lead/lag video.subtitles burn— hardcode for players without subtitle support.
Troubleshooting
| Error / symptom | Likely cause | Action |
ffmpeg not found | Binary missing | Run install-media-tools doctor/install |
| Empty or nonsense transcript | Music-only, very quiet audio, wrong language | Normalize/extract audio; try larger model |
faster_whisper import error | uv deps not installed | Run via uv run <skill_directory>/scripts/... not plain python3 |
Cues too short/long from --text | Heuristic timing | Pass --duration or use real segments JSON |
| Slow first transcription | Model download | Subsequent runs reuse cached weights |
Available scripts
| Script | Purpose |
scripts/transcribe.py | ASR to SRT + JSON segments |
scripts/detect-language.py | Spoken language detection |
scripts/to-srt.py | Text or segments → SRT |
scripts/to-vtt.py | Text or segments → WebVTT |
Acceptance checks (agent must pass before delivery)
- Contract: exit 0,
ok: true, SRT/JSON paths exist and are non-empty. - Skill gate: hand off to
captions-compliancevalidate.pybefore broadcast export. - Spot-check: read first/last cues; language matches request; duration coverage roughly matches source audio (not a 2-second stub on a long file).
- ASR is imperfect — never claim verbatim accuracy without human/agent review of critical lines.
- On failure: re-transcribe with a clearer extract or escalate; do not deliver empty SRT.
Do not use for
- Burning subtitles into video (use
subtitles/burn.py) - Broadcast SCC/SMPTE-TT export (use
captions-compliance) - Video or audio transforms (use
video-transformation/audio)
Related skills
subtitles— format conversion, timing shift, extract embedded tracks, burn-inaudio— extract/normalize audio before ASRinspect— probe source media before transcriptioninstall-media-tools— install ffmpeg
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
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.

