precise-bilingual-subtitle

precise-bilingual-subtitle is a skill for Claude Code, Codex from davidtoby/agent-skills. It costs 83 tokens per session (2,343 once invoked), scanned A, original, MIT.

A video-subtitling workflow that creates hardcoded English-and-Chinese subtitles with word-level timing from Whisper speech transcription.

In plain words
What is it for?
Use it to download or process a YouTube video, transcribe its audio, and export an MP4 with synchronized bilingual subtitles and chosen font, size, color, outline, and position.
Why use it?
It addresses timing drift in automatic YouTube captions and lets you control subtitle appearance for more accurate, readable videos.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to download or process a YouTube video, transcribe its audio, and export an MP4 with synchronized bilingual subtitles and chosen font, size, color, outline, and position.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/davidtoby/agent-skills/precise-bilingual-subtitle
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add davidtoby/agent-skills --skill precise-bilingual-subtitle
Clone the repo
git clone --depth 1 https://github.com/davidtoby/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for precise-bilingual-subtitle

README.md
[![agentmods](https://agentmods.dev/badge/skills/davidtoby/agent-skills/precise-bilingual-subtitle/github.svg)](https://agentmods.dev/skills/davidtoby/agent-skills/precise-bilingual-subtitle)
Your own site
<a href="https://agentmods.dev/skills/davidtoby/agent-skills/precise-bilingual-subtitle"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/precise-bilingual-subtitle/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for precise-bilingual-subtitle

Your own site · 80×15
<a href="https://agentmods.dev/skills/davidtoby/agent-skills/precise-bilingual-subtitle"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/precise-bilingual-subtitle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,343 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00083 $0.02343
Opus 5 $0.00042 $0.01171
Sonnet 5 $0.00017 $0.00469
Haiku 4.5 $0.00008 $0.00234

Measured 8d ago against content hash caf29038ebb6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

precise-bilingual-subtitle scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/.archive/umbrella-curation-2026-04-29/media/precise-bilingual-subtitle/SKILL.md · 226 lines

How it starts

The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Precise Bilingual Subtitle Production

Produce hardcoded bilingual (English + Chinese) video subtitles with Whisper word-level timing, not YouTube's unreliable auto-captions. Supports full visual customization: font, size, color, stroke, and bottom margin.

When to use this skill

  • YouTube auto-captions have visible timing drift (the most common failure)
  • User wants yellow, large, or otherwise custom-colored subtitles
  • Subtitle timing must be frame-accurate and match lip movements
  • Chinese YouTube subtitles hit HTTP 429 and cannot be downloaded
  • User wants English-on-top / Chinese-on-bottom bilingual layout

Core insight: why YouTube auto-captions fail

YouTube auto-generated captions are aligned to the entire video stream at once, not word-by-word. Result: systematic offset, drift over time, and poor sync with speech. Local Whisper transcribes with per-word timestamps from the extracted audio, producing timing that is reliable enough for professional delivery.

Proven workflow

Phase 1: Extract audio and transcribe with Whisper

# 1. Extract mono 16kHz audio from the source video
ffmpeg -y -i source.mp4 -vn -ac 1 -ar 16000 audio.wav

# 2. Run Whisper with word-level timing (turbo model, ~30s for 5-min clip)
whisper audio.wav --model turbo --language en --task transcribe \
  --output_format srt --output_dir .

Whisper's SRT output has per-word-level timestamps — each entry is 1-3 words with precise start/end times. This is the foundation of accurate subtitle sync.

Phase 2: Group raw fragments into readable subtitle chunks

Raw Whisper output has hundreds of tiny fragments. Group them into readable subtitle blocks:

import re

def group_whisper_srt(srt_path, min_words=12):
    """Group raw Whisper fragments into readable subtitle chunks."""
    # Parse SRT...
    grouped = []
    buf, start, end = [], None, None
    
    for item in raw_items:
        if start is None:
            start = item['start']
        end = item['end']
        buf.append(item['text'])
        
        wc = len(' '.join(buf).split())
        # Group by word count OR sentence-ending punctuation
        if wc >= min_words or item['text'].strip().endswith(('.', '?', '!', ':', '."')):
            merged = ' '.join(buf)
            merged = re.sub(r'\s+([,.;?!])', r'\1', merged)
            grouped.append({'start': start, 'end': end, 'en': merged})
            buf, start, end = [], None, None
    
    # Don't forget remaining
    if buf:
        grouped.append({'start': start, 'end': end, 'en': ' '.join(buf)})
    
    return grouped

Read the full file on GitHub · 226 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 226 lines · 83 tokens per session scan A caf29038ebb6

Subscribe to this mod's changes

precise-bilingual-subtitle is a skill published in the GitHub repository davidtoby/agent-skills (10 stars, last pushed 1mo ago), licensed MIT. It adds 83 tokens to every session and 2,343 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.