promo-video-pipeline
把 Remotion 宣传片按分镜拆成独立工作项并行派发子代理,主线程先冻结共享组件,合并后以真实渲染证据作为完成门。TRIGGER: 宣传片、promo video、分镜并行派发、remotion render、视频渲染、video pipeline、scene 并行产出、AIOS promo、timeline.json 分镜
- License 许可
- MIT
- 所属仓库
- rexleimo/aios
- 最近更新
- 2026-11-07
- Stars
- ★ 62
- Forks
- 11
01 前言 Front Matter
- name
- promo-video-pipeline
- tags
- [ "general", "video", "remotion", "parallel", "workflow", "verification" ]
- scopes
- [ "global", "project" ]
- clients
- [ "codex", "claude", "gemini", "opencode", "hermes", "grok", "workbuddy", "pi", "zcode", "qoder" ]
- description
- 把 Remotion 宣传片按分镜拆成独立工作项并行派发子代理,主线程先冻结共享组件,合并后以真实渲染证据作为完成门。TRIGGER: 宣传片、promo video、分镜并行派发、remotion render、视频渲染、video pipeline、scene 并行产出、AIOS promo、timeline.json 分镜
- repoTargets
- [ "codex", "claude", "gemini", "opencode", "hermes", "grok", "agents", "workbuddy", "pi", "zcode", "qoder" ]
- defaultInstall
- { "global": false, "project": true }
- installCatalogName
- promo-video-pipeline
02 资源文件 2
- 参考文档evals/evals.json3.1 KB
- 参考文档references/dispatch-contract.md3.9 KB
03 SKILL.md 正文
Promo Video Pipeline
在 video/ 这个 Remotion 子应用里产宣传片:分镜拆成独立工作项 → 并行派发子代理 → 主线程合并 → 以真实渲染产物作为完成门。命令面以 video/scripts/render.mjs 与 video/package.json 为准,本文件不发明参数。
1. 前置输入(先声明,再开工)
- 分镜脚本 + 证据合同:
video/README.md的分镜表(帧区间、画面、字幕)与「画面主张与代码证据」表 (每条主张 →file:line)。派发前以它为准;改画面不改证据表等于交付假主张。 - 场景清单:
video/src/timeline.json的scenes[].id / label / frames / captions;当前 8 个场景 (hook crash resume route work team proof cta)、1355 帧、30fps(45.2 秒)、1080x1920 竖版、compositionId为AiosPromo。 - 时长与台词唯一真源:
video/src/timeline.ts与video/scripts/render.mjs读同一份 json,帧区间只在timeline.ts累加;字幕只写在 json 里,由PromoVideo.tsx注入场景。其他文件不得硬编码帧数或自带 cues。 - 片长由旁白决定:json 里的字幕同时是配音稿(
npm run srt导出 SRT 给剪映「文本朗读」),所以每一拍的frames / fps必须 ≥ 该拍字幕朗读所需秒数(估算器video/scripts/narration.mjs,4.5 字/秒 + 每句 0.12s 换气)。npm test的「每拍窗口放得下该拍的旁白」会在砍帧数或加文案时先红 —— 那是硬门禁,不是建议。 - 冻结点:webpack 入口
video/src/index.ts(render.mjs的 ENTRY,只做registerRoot)、场景注册表SCENE_BY_ID(在video/src/PromoVideo.tsx)、场景入参契约SceneProps(video/src/timeline.ts)、 共享 primitivevideo/src/components/**(stagepanelterminaltextdiagramide)与video/src/theme.ts(竖版layout/size令牌)由主线程先写定,之后转为只读。 - 入口或共享 primitive 尚未落盘时:主线程自己先写,不派发;否则多个子代理会同时改同一批文件。
2. 独立性判定(派发之前必须成立)
- 每个工作项只有一个文件 owner。
- 共享
video/src/components/**的场景不独立:主线程先冻结共享 primitive,之后每个子代理只允许新建或编辑自己的video/src/scenes/<id>.tsx。 video/src/PromoVideo.tsx的SCENE_BY_ID注册表与video/src/index.ts由主线程独占改写,子代理不碰入口与注册表。timeline.json对子代理只读;要改帧数就回报主线程,由主线程改 json 并重跑npm test。- 以上任一不成立 → 保持串行,不进入派发。
3. 计划与派发(沿用 aios-work-dispatch 约定)
aios plan start --title "<宣传片目标>" --task "<整片目标>"
aios plan task hook --target video/src/scenes/hook.tsx --allow-write "video/src/scenes/hook.tsx"
aios plan task cta --target video/src/scenes/cta.tsx --allow-write "video/src/scenes/cta.tsx"
aios work --task "<宣传片目标>" --dry-run --json
- 先建结构化 plan,让引擎拿到真实 owner 与依赖;再从 dry-run 预览核对工作项、依赖、路径冲突、merge gate。
- 每个节点带 recipe header:
tools白名单(写场景 = edit;只做分镜/取证 = read-only)、model+ 显式task-type(场景绘制声明frontend,程序不从自由文本反推类型)、max_turns、output_schema。 output_schema是下游触发条件:schema 校验不过的产物不回传下游,只作为结构化反馈回到本节点。- 完整 header 与结果 schema 见
references/dispatch-contract.md。 - 预览不授权执行:见第 4 节。
4. 审批边界(强制)
- 无
--scene的整片渲染(1355 帧,实测 07:06)与 live 模型派发都消耗时间/费用并写大产物,开工前取得用户明确批准。 - live 派发、整片渲染、commit/push 是三道独立批准,前一次批准不外推到后一次。
- 单场景
--scene渲染与单帧--still属于已批准派发范围内的小颗粒可逆产物。 - 渲染产物不入库:
video/.gitignore已把out/挡在提交之外;提交面只有.tsx、timeline.json、文档。
5. 命令面(照抄代码)
cd video && npm run render -- --output out/aios-promo.mp4
cd video && npm run render -- --scene hook --output out/scene-hook.mp4
cd video && npm run render -- --still --frame "14,75,164,250,319,420,489,570,639,700,760,814,900,999,1090,1164,1290,1345" # 一次 bundle 出多张静帧
cd video && npm run typecheck
cd video && npm test
cd video && npm run srt # 导出 out/aios-promo.srt 配音稿(与字幕同一真源)
cd video && npm run studio
- 参数只有这些:
--output(默认out/aios-promo.mp4,相对video/解析)、--scene <id>(只渲染该场景帧区间from .. to-1;未知 id 以退出码 1 终止并列出可选 id)、--still、--frame "N,M,..."(配合--still,默认60,产出out/still-<NNNN>.png)、--composition、--concurrency N(默认max(2, min(cpus-2, 10)))、--browser <本机 chrome 路径>,等价环境变量REMOTION_BROWSER_EXECUTABLE。 - 没有
--still-output:静帧路径由帧号决定,别为它加参数。 - 非 TTY 每 +2.5% 打一行进度便于 agent 采集;TTY 为单行动态条。换场景时插一行
✔ 上一场完成 → 进入 <id> · <label>。
6. 子代理如何报进度(不用 tail 日志)
- 读
video/out/render-progress.json:phase、percent、renderedFrames、totalFrames、currentScene、currentSceneLabel、etaSeconds、elapsedSeconds、outputMb、stitchStage、compositionId、outputFile、concurrency、updatedAt。 - 写入按 >350ms 节流,
final: true立刻写;整片成功的最后一条phase为done,单帧为still-done。 - 并发渲染会互相覆盖这一个进度文件:同一时刻只让一个渲染持有
out/,其余子代理用各自的--output out/scene-<id>.mp4区分产物。
7. 证据门(机械判定)
- 子代理返回结构化结果:
scene_id、files_touched、typecheck_exit_code、still_path、scene_render_exit_code、segment_output。 - 主线程合并顺序固定:接线
video/src/PromoVideo.tsx的SCENE_BY_ID→cd video && npm run typecheck退出码 0 →cd video && npm test退出码 0 → 已批准的整片渲染。 - 完成判据四项同时为真:
video/out/aios-promo.mp4存在且 size > 0;进度 json 的phase等于done;renderedFrames等于totalFrames等于timeline.json帧数之和(当前 1355);typecheck 与 test 退出码为 0。 - 竖版排版(面板撞字、diff 出框、字幕折行留孤字、轨道压进度条)只有静帧能暴露,代码审查看不见:整片渲染前先出上面那组验收帧,逐张看过。
- 验收帧要按
场景起点+14覆盖每一拍的入场窗口,不能只抽落定时刻:落定帧全绿、成片里却有一整秒空屏是真实发生过的缺陷(900 帧那一版的team卡片等到 local 30 才淡入,整片第 547 帧中间整块空)。判据是「这一拍内任意一帧都不留无内容的大块空白」,不是「这一拍结束时长什么样」。 - 改帧数(重切节奏、拉长片长)会让每一拍边界右移,入场验收帧号必须按新起点重新算,旧帧号落在新时间轴上是另一拍的画面。
- 整片渲完后用仓库自带的 ffmpeg 从成片里回抽问题帧复核(
video/node_modules/@remotion/compositor-win32-x64-msvc/ffmpeg.exe -i out/aios-promo.mp4 -ss <帧号/30> -frames:v 1 out/recheck.png):静帧从源码渲染,编码后的真实画面才是观众看到的。 - 分辨率与时长用仓库自带的 ffprobe 核对(本机没有全局 ffmpeg):
video/node_modules/@remotion/compositor-win32-x64-msvc/ffprobe.exe -v error -show_entries format=duration:stream=width,height -of default=nw=1 out/aios-promo.mp4。 - 任一判据为假 → 交出失败证据(命令、退出码、错误摘要),不报告完成;声称完成前走
verification-before-completion。 video/tests/缺失时npm test(node --test "tests/*.test.mjs")以非零退出码失败:把它记成待补的门禁,不当作已验证。
8. 失败与恢复
- 单场景渲染失败:同 id 重试一次且必须附带变化的假设(错误摘要 + 改动点),否则不重试。
- 浏览器启动失败:按
render.mjs的提示显式传--browser指向本机 Chrome。 - 中断后用
aios work --task "<宣传片目标>" --session <session> --retry-blocked,先复核 owner、批准与命令面。
谁决定什么
- 模型:分镜能否拆成独立工作项、
task-type声明、证据是否已齐。 - 代码:帧区间、退出码、产物存在性、进度 json —— 程序只读这些客观事实,不猜意图。
- 用户:live 派发、整片渲染、commit/push 的批准。
04 同仓库更多 Skills
versioning-by-impact
Use when completing a task and deciding whether repository changes require a semantic version bump and changelog entry before commit/push.
verification-loop
Evidence-before-assertions workflow. Use before claiming work is done, before release, and after any behavior change in scripts/skills/MCP.
typesafe-ai
Build AI-powered software with TypeSafe: small units of AI intelligence you can use like programming primitives. Its System One models, including Jev, turn natural language and application state into typed judgments and probabilities that code can combine. Use when a feature needs programmable common sense, when brainstorming what AI could make possible in an app, or when an LLM prompt-and-parse step could become a structured decision. Applications include routing, ranking, extraction, verification, and interactive experiences; these are starting points, not the limits. Read live docs and cookbooks to find useful patterns and discover new combinations.
skill-opt-lite
Train and optimize skill documents using the SkillOpt methodology — the agent acts as both target and optimizer, running tasks, reflecting on failures, proposing edits, and validating improvements in a self-contained training loop. TRIGGER: optimize skill, train skill, improve skill, skill training, skill optimization, SkillOpt, skill evolution, skill iteration loop, skill feedback loop, skill tuning.
skill-constraints
Enforce browser automation safety constraints — tool usage order, anti-detection rules, screenshot discipline, and human-in-the-loop checks. Use when setting up or verifying browser/MCP tool operations, NOT for every skill execution.
seo-geo-page-optimization
Use when improving a single page for SEO and AI answer-engine visibility (GEO), especially when you need faster first-screen conversion and clearer traffic funnels.