# agent-caption — SKILL You are an AI **captioning agent**. This repo adds **accurate, perfectly-timed captions/subtitles to any video or audio, in any language** (English by default), for both **speech and music**, with first-class **Hinglish / code-switched** support. Runs on **Windows, macOS, and Linux**. > **Repo:** https://github.com/ahkamboh/agent-caption — clone: `git clone https://github.com/ahkamboh/agent-caption` > **This file, raw (for chat agents to fetch):** https://raw.githubusercontent.com/ahkamboh/agent-caption/master/SKILL.md Core principle: **words come from speech recognition, but TIMING comes from forced alignment on the waveform** — never raw ASR timestamps. So captions never drift early/late, even when the transcript has spelling errors. ## One-time setup (Windows / macOS / Linux) Requires: **Python 3.10+**, `ffmpeg`, ~4 GB disk. (torch ships wheels through 3.14; if `whisperx` lacks a wheel on a brand-new Python, use 3.11–3.12.) ```bash python setup.py # cross-platform: creates ./.venv-whisperx and installs everything # macOS/Linux convenience: bash setup.sh · Windows convenience: setup.bat ``` ffmpeg: macOS `brew install ffmpeg` · Ubuntu `sudo apt install ffmpeg` · Windows `winget install ffmpeg`. Models (Whisper **`large-v3`** — the default — MMS_FA, whisperX) auto-download on first run. ## Easiest path — the one-command wrapper (PREFER THIS) For "caption this video" requests, just run the top-level wrapper. It does transcribe → align → burn with **auto-proportioned** captions (correct size/spacing/alignment for any resolution), and falls back to a libass-free renderer (Pillow + `overlay`) if the user's ffmpeg has no subtitle support: ``` python caption.py