---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://framesfield.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
title: "ElevenLabs Scribe v2 STT to Synced SRT & 9:16 ASS Captions Skill"
description: "Executable SKILL.md playbook teaching Claude Code, Cursor, and Codex how to extract timeline-aligned 16 kHz mono WAV audio, pin ElevenLabs Scribe v2 on fal.ai ($0.008/min · $0.0104/min w/ custom brand keyterms and speaker diarization), and deterministically emit 38-char YouTube SRTs plus 3-word active-highlight 9:16 Reels ASS captions."
canonical: "https://framesfield.com/skills/elevenlabs-scribe-stt-to-srt-and-ass-captions-skill"
---

# ElevenLabs Scribe v2 STT to Synced SRT & 9:16 ASS Captions Skill

> Executable SKILL.md playbook teaching Claude Code, Cursor, and Codex how to extract timeline-aligned 16 kHz mono WAV audio, pin ElevenLabs Scribe v2 on fal.ai ($0.008/min · $0.0104/min w/ custom brand keyterms and speaker diarization), and deterministically emit 38-char YouTube SRTs plus 3-word active-highlight 9:16 Reels ASS captions.

- **Canonical URL:** https://framesfield.com/skills/elevenlabs-scribe-stt-to-srt-and-ass-captions-skill
- **Raw Payload URL:** https://framesfield.com/raw/skills/elevenlabs-scribe-stt-to-srt-and-ass-captions-skill
- **Asset Type:** SKILL.md
- **Compatible Hosts:** Claude Code, Cursor, Codex
- **Target Creative Tool:** fal.ai API / ElevenLabs Scribe v2 / Python / FFmpeg
- **License:** MIT
- **Last Verified:** 2026-12-01

## Setup & Install

```bash
mkdir -p .claude/skills/elevenlabs-scribe-captions && curl -fsSL https://framesfield.com/raw/skills/elevenlabs-scribe-stt-to-srt-and-ass-captions-skill -o .claude/skills/elevenlabs-scribe-captions/SKILL.md

```

## Copyable Asset (SKILL.md)

````markdown
---
name: elevenlabs-scribe-captions
description: Automate speech-to-text captioning with ElevenLabs Scribe v2 on fal.ai (fal-ai/elevenlabs/speech-to-text/scribe-v2 at $0.008/min, or $0.0104/min with custom keyterms), including timeline-zero 16 kHz mono WAV extraction, speaker_id diarization, deterministic <=38-char YouTube SRT wrapping, and 3-word active-highlight 9:16 Reels ASS burn-in. Use when generating synced video subtitles, podcast transcripts, or chapter clips.
---

# ElevenLabs Scribe v2 STT -> Synced SRT & 9:16 ASS Captions Skill

## 1. Mandatory Endpoint & Billing Rules
- **ALWAYS pin `fal-ai/elevenlabs/speech-to-text/scribe-v2`:** Base rate is **`$0.008` / input audio minute** (`$0.48/hour`), or **`$0.0104/min`** (`+30%`) when passing domain `keyterms`. Never hit the root legacy `/speech-to-text` path (`$0.03/min`, 3.75x more expensive).
- Measure exact audio duration via `ffprobe` and print estimated USD spend before calling the API.

## 2. Step 1 — Timeline-Zero 16 kHz Mono WAV Extraction
Eliminate MP4 edit-list sync drift before ASR:
```bash
ffmpeg -y -i master_cfr.mp4 -vn -ac 1 -ar 16000 -af "aresample=async=1:first_pts=0" audio_16k.wav
```

## 3. Step 2 — Call Scribe v2 With Diarization & Brand Keyterms
Upload `audio_16k.wav` (or pass a signed URL) and request word-level JSON:
```bash
curl -sS -X POST "https://fal.run/fal-ai/elevenlabs/speech-to-text/scribe-v2" \
  -H "Authorization: Key $FAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio_url": "'"$AUDIO_URL"'",
    "diarize": true,
    "tag_audio_events": false,
    "keyterms": ["FramesField", "SeedVR2", "FASHN", "ComfyUI", "Remotion"]
  }' > scribe.json
```
- Set `tag_audio_events: false` for clean social burn-in captions; set `true` for accessible YouTube SDH tracks.

## 4. Step 3 — Deterministic SRT (<=38 Chars) + 9:16 ASS (MarginV=500)
Filter `words` to `w["type"] == "word"`:
- **YouTube SRT:** Flush a cue whenever `speaker_id` changes, pause gap `> 0.65s`, line length `> 38 chars`, or cue duration `> 3.2s`.
- **9:16 Reels ASS (`PlayResX: 1080`, `PlayResY: 1920`):** Group `<=3` words per chunk (breaking on `speaker_id` flip or `>0.55s` pause), set `Alignment=2, MarginV=500` inside the safe middle third, and emit per-word active highlight color (`{\c&H002044E0&}` in BGR hex).

## 5. Step 4 — Mux Soft Subs or Burn ASS Captions
- **Universal soft-sub MP4 (works on all FFmpeg builds):**
  ```bash
  ffmpeg -y -i master_cfr.mp4 -i out.srt -c:v copy -c:a copy -c:s mov_text captioned_soft.mp4
  ```
- **Hard-burn 9:16 ASS (requires FFmpeg compiled with `libass`; on macOS use `ffmpeg-full`):**
  ```bash
  ffmpeg -y -i vertical_916.mp4 -vf "ass=out.ass" -c:v libx264 -crf 18 -pix_fmt yuv420p -c:a copy -movflags +faststart vertical_burned.mp4
  ```
- **Verification Gate:** Check sync on the final 10 seconds of the video (not just the first 5 seconds) to confirm zero VFR drift.
````

## Example Input

```text
Transcribe episode14_cfr.mp4 (42 min) using Scribe v2 with keyterms ["FramesField", "Kokoro", "SeedVR2"], generate a 38-char YouTube SRT, and emit 9:16 karaoke ASS for our 35-second highlight clip.
```

## Expected Output

```text
Estimated Scribe v2 spend: $0.44 (42 min x $0.0104/min w/ keyterms).
Extracted timeline-zero audio_16k.wav -> ran fal-ai/elevenlabs/speech-to-text/scribe-v2.
Wrote 618 speaker-aware SRT cues (<=38 chars/line) -> episode14.srt.
Wrote 9:16 active-word ASS (MarginV=500) -> clip01_reels.ass + soft-muxed MP4 verified.
```

## Requirements

- `FAL_KEY` environment variable from fal.ai
- Python 3 + FFmpeg (`ffmpeg-full` on macOS if hard-burning ASS via `libass`)

## Known Limits

- Default macOS Homebrew ffmpeg omits libass—use soft-mux (-c:s mov_text) or install homebrew-ffmpeg/ffmpeg/ffmpeg-full before running -vf ass=
- Always conform VFR phone/screen captures to CFR BEFORE extracting audio_16k.wav so captions stay synced past minute 10

## Implementation Notes

## Turn raw audio into synced, brand-accurate captions without SaaS lock-in

Automated subtitle scripts break in three predictable places: container audio offsets cause end-of-video drift, missing domain vocabulary misspells brand names, and un-wrapped ASR blocks spill across mobile UI overlays. This `SKILL.md` teaches your agent to combine timeline-zero FFmpeg WAV extraction with **[ElevenLabs Scribe v2](/specs/elevenlabs-scribe-stt)** (`$0.008/min`), `keyterms` spelling lock, and deterministic SRT/ASS formatting.

## Related workflow & troubleshooting

- [Workflow 45: Automated Scribe v2 Subtitles & Chapter Clips Pipeline](/workflows/automated-speech-to-text-subtitles-and-chapter-clips-pipeline)
- [Fix AI Subtitles Out of Sync & Wrong Names](/fixes/ai-speech-to-text-subtitles-out-of-sync-and-wrong-names-fix)
- [Fix: Missing libass & drawtext on macOS](/fixes/ffmpeg-libass-drawtext-missing-macos)
