---
name: whisper-ass-captions
description: Extract clean 16kHz mono speech from video renders, transcribe word-level timestamps with OpenAI Whisper API or local whisper.cpp, correct proper nouns and technical terms, wrap strictly to 3-4 words per cue, and emit TikTok/Reels/Shorts safe-zone ASS subtitle files.
---

# Whisper Word-Timed Transcription & Safe-Zone ASS Caption Protocol

Whenever generating captions for short-form or long-form AI videos, follow these exact five stages:

## 1. Extract Lightweight 16 kHz Mono Speech Stem
Never upload multi-hundred-megabyte MP4 files to transcription APIs—extract clean 16 kHz mono WAV first:
```bash
ffmpeg -y -i master.mp4 -vn -ac 1 -ar 16000 -c:a pcm_s16le /tmp/speech_16k.wav
```

## 2. Transcribe with Word-Level Timestamps + Domain Glossary Prompt
Pass brand names and technical acronyms inside the Whisper `prompt` hint so proper nouns spell accurately on the first pass:
```bash
curl -sS https://api.openai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F file="@/tmp/speech_16k.wav" \
  -F model="whisper-1" \
  -F response_format="verbose_json" \
  -F "timestamp_granularities[]=word" \
  -F prompt="FramesField, Gemini Omni Flash, Kling, FLUX 3, ComfyUI, Wan 2.2, LTX-2, LUFS, Recraft, FFmpeg" \
  > transcript_words.json
```
*(If the user prefers offline local execution, run `whisper-cli -m ggml-medium.en.bin -f /tmp/speech_16k.wav -ojf` via `whisper.cpp`.)*

## 3. Rhythmic Cue Grouping (Never Dump 10-Word Paragraphs)
Convert `words[]` into subtitle cues following strict mobile readability rules:
- **Vertical 9:16:** Maximum **3 to 4 words** (or `<= 22` characters) per cue; break immediately on sentence punctuation (`.`, `?`, `!`) or pauses `> 0.35s`.
- **Landscape 16:9:** Maximum **7 to 9 words** per cue (1–2 balanced lines).
- Always clamp cue end times cleanly so consecutive cues never overlap (`end[i] <= start[i+1]`).

## 4. Emit Safe-Zone `.ass` Header (`PlayResX=1080`, `PlayResY=1920`)
```ini
[Script Info]
ScriptType: v4.00+
PlayResX: 1080
PlayResY: 1920
WrapStyle: 2

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: VerticalSafe,Arial,62,&H00FFFFFF,&H002044E0,&H00111111,&H80000000,-1,0,0,0,100,100,0,0,1,3,1,2,80,170,520,1
```

## 5. Mandatory Spelling Audit Before Burning
Print the complete list of generated caption cues to stdout so the user can proofread every product name, URL, and dollar figure BEFORE burning captions permanently into pixels (see `ffmpeg-vertical-delivery`).
