subtitles

Burns Chinese subtitles into finished videos using PIL PNG overlays or ASS with ffmpeg.

Updated Aug 9, 2026
Ready to run
npx skills add https://github.com/ChenJiangxi/auramate-video --skill subtitles-chenjiangxi
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: subtitles
Source: https://github.com/ChenJiangxi/auramate-video/tree/main/skills/subtitles
Command: npx skills add https://github.com/ChenJiangxi/auramate-video --skill subtitles-chenjiangxi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Pillow, ffmpeg, ffprobe.

What problem does it solve? Adding Chinese subtitles to finished videos often fails in practice: ffmpeg builds without libass reject ASS filters, hand-written timestamps drift out of sync with the voiceover, and naive line-breaking produces unreadable mixed Chinese-English lines. This Skill provides a tested PNG-overlay and ASS pipeline with correct timeline math and typography rules. ## Core Features & Use Cases - PNG Overlay Route: Renders each subtitle line as a full-frame transparent PNG with PIL and burns them via ffmpeg overlay chains, working even when ffmpeg lacks libass. - Timeline Calculation: Derives every cue's start time from actual ffprobe-measured voiceover durations plus a configurable GAP, never from hand-written times, preventing cumulative drift. - Typography Rules: Enforces vertical-video subtitle standards (baseline Y 1400, font size 60, pixel-width-based line breaking, punctuation-preserving splits) and supports --skip for clips with built-in text and --no-merge for hook-line rhythm. - Use Case: After assembling a 1080x1920 vertical video with per-clip voiceovers, run gen-subs.py and burn-subs.sh to produce a subtitled final cut whose captions stay frame-accurate with the audio. ## Quick Start Generate and burn Chinese subtitles onto my assembled vertical video using the PNG overlay route with the default position and font settings.

Frequently Asked Questions about subtitles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I burn subtitles into a video with ffmpeg?▼

Render each subtitle line as a transparent PNG with PIL, then chain them in ffmpeg using overlay filters with enable='between(t,start,end)' expressions while copying the audio stream. This works even when ffmpeg lacks libass support.

What should I do when ffmpeg reports No such filter: 'subtitles'?▼

This error means your ffmpeg build was compiled without libass, which is common in Homebrew builds. Switch to the PNG overlay route, which renders subtitles as images and overlays them without needing the ass or subtitles filters.

Why are my ASS subtitles tiny or positioned off-screen?▼

libass defaults to PlayResY=288 when PlayResX and PlayResY are missing from the Script Info section, shrinking all font sizes and margins by roughly 6.7x. Always set PlayResX: 1080 and PlayResY: 1920 for vertical video.

Why do my subtitles drift out of sync toward the end of the video?▼

Drift happens when cue times are estimated instead of measured, or when the GAP constant differs between the video build script and the subtitle generator. Compute every cue from ffprobe-measured audio durations and keep GAP identical on both sides.

How do I handle line breaking for mixed Chinese and English subtitles?▼

Break lines by rendered pixel width rather than character count, since Latin characters are much narrower than Chinese glyphs. Use PIL to measure text width and wrap at about 86 percent of frame width, preserving in-line punctuation with lookbehind regex splits.

When should I skip burning subtitles on certain clips?▼

Skip clips whose visuals already contain large built-in text such as data cards or hook title cards, since overlaying captions creates a double text layer. Skipped clips still occupy their timeline slots so later subtitles stay synchronized.