audio-sync-assembly
Build and revise FFmpeg-based video assemblies from scene renders and narration, including audio probing, scene retiming, pauses, trim/concat, setpts, atempo, phrase-to-visual cue alignment, and final timeline manifests. Use when narration length, visual beats, product moments, or scene boundaries must sync precisely.
1How It Works & Mechanism
The single source of truth for timing is strictly locked to the "latest approved narration audio + scene renders", explicitly prohibiting reverse-engineering timings from legacy final cuts—serving as the shared baseline for all retiming, subtitle, and music decisions across the entire workflow.
- Use the latest approved narration audio as timing source.
Emphasizes "minimal intervention": provides tiered strategies based on scene characteristics (full-segment setpts / segmented retiming / inserting silences with hold frames / minor atempo adjustments / retiming only the section preceding a product moment), rather than defaulting to global speed changes.
Choose the smallest timing intervention:
Probe before making any decisions: measure duration, frame rate, resolution, audio track presence, sample rate, and channels for every clip using ffprobe or the repository's media probe script.
- Duration. - Frame rate. - Resolution. - Audio stream presence.
Assembly sequence locks subtitles to the "music-free narration master": assemble the narration-only master first, then generate and burn subtitles, build the music bed, mix audio, and finally produce final exports and preview cuts.
3. Generate captions from narration-only master.
Segment split points must align with semantic events, explicitly prohibiting uniform slicing: scene transitions, product moments, problem reveals, chart milestones, title reveals, ending holds, and narration pauses.
Avoid splitting on arbitrary equal chunks.
Preview cuts are not full-video re-renders: generate clips only for sensitive areas affected by current changes (updated narration sections, product demo transitions, problem timings, subtitle styling blocks, final 10 seconds, and any modified scene boundaries).
Generate preview clips for:
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| cli | ffmpeg(setpts / trim / tpad / atempo / apad / atrim / concat / fps / scale / setsar),走 filter_complex 显式拼装 |
| cli | ffprobe(探测时长/帧率/分辨率/音轨/采样率与声道) |
| package | 仓库根确定性脚本 scripts/probe_media.py 与 scripts/timeline_manifest_to_ffmpeg.py(本 skill 以「this repo's media probe script」泛指,非自身目录自带) |
| package | 模板 templates/timeline-manifest.example.json(记录目标时序的 JSON 结构) |
| package | 输入素材:最新批准的旁白音频与场景渲染(用户/项目本地提供,非外部服务) |
4Recommended Governance & Evidence
- scripts/: Execute local script or command: (Executed by host agent) ffmpeg commands: setpts / trim / tpad / atempo / apad / atrim / concat
- 本地工作目录: File read/write & artifact export: Scenes and final MP4s in project renders/, assembly scripts or command plans in assembly/, subtitle files in captions/
5Second-Pass Verification
- [ok] 「外部依赖只有本地 CLI」是否成立(决定蓝档还是黄/橙档) — 本目录正则扫描无 http(s)://、无 fetch/requests、无 token/env/cookie;SKILL.md 只出现 ffprobe 与 this repo's media probe script,references 只出现 ffmpeg filter 片段。不存在素材外发或端点查询,故落蓝档。
- [ok] ffmpeg 命令模板是否真能跑(不是示意伪代码) — references/ffmpeg-retiming.md 给的是标准 filtergraph 语法(setpts=factor*(PTS-STARTPTS)、tpad=stop_mode=clone:stop_duration、atempo、concat=n=...),可原样接进 -filter_complex;缩放/fps/format 同段给出,属可执行模板。
- [discrepancy] SKILL.md 的时间线清单字段与 templates/timeline-manifest.example.json 是否一一对应 — SKILL.md 列了扁平 11 项(Scene ID / Source render path / Source duration / Target duration / Audio path / Audio trim start-end / Inserted silence / Hold frames / Segment retime ratios / Global scene start / Proof timestamps),模板 JSON 却是嵌套结构:project{name,width,height,fps,output} + segments[{id,video,source_duration,target_duration,audio,strategy,maps}] + captions{} + music{} + proofs[]。差异在于「插入静音/保持帧/分段重定比」被折叠进 strategy+maps(maps 里用 hold_source_time 表达保持帧),「全局场景起点」由脚本按目标时长累加算出而非显式字段,「证明时间戳」在 proofs[] 而非 segment 内。按 SKILL.md 的字段名手写 JSON 不会与模板同构,照抄者需以模板为准。
- [discrepancy] 「this repo's media probe script once available」是否说明探测脚本当前不存在 — 措辞(once available)把探测脚本当成「将来可能有」,但 pin 内仓库根已存在 scripts/probe_media.py(ffprobe -print_format json 的封装,输出时长/体积/码率/视频编码与分辨率/帧率/像素格式/音频编码/采样率/声道),且 render-qa-and-surgical-changes 明确点名它。属文档措辞落后于仓库状态,不影响行为,但会让读者低估可用工具。
- [ok] 与 captions-and-music-bed 的职责是否重叠冲突 — 本 skill 只把「生成字幕/建音乐床」写进组装顺序的第 3-6 步(顺序约束),字幕规则与 ducking 判据全部留给 captions-and-music-bed,无重复定义。
6Verdict & Scenarios
099bc62047c52f2e…