video-explainer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVideo Explainer
视频讲解器
Input: a topic, article, codebase, or rough notes. Output: a single at 1920x1080 () and 30 fps (or / when requested), plus the , , and files that produced it (pass to only when a smaller 720p copy in is requested).
renders/<slug>-vN.mp416:99:161:1script.mdmedia/graphics/--sharerender.pyrenders/share/You write the script, narration, and scene code; the scripts fetch media, synthesize voice, align words, compile HyperFrames, render MP4, run 10-check QA, and serve the review page. Commands, syntax, engine APIs, and keys live in reference.md.
script.mdstyle.jsonOn first use, run (or when using spoken narration). If tools are missing, list them and ask before installing. Put optional in rather than chat.
setup.shsetup.sh --voiceGEMINI_API_KEY=...~/.config/video-explainer/.env输入:主题、文章、代码库或粗略笔记。输出:一个 文件,分辨率为 1920x1080()、帧率为 30 fps(用户另有要求时为 / ),以及生成该视频的 、 和 文件(仅当用户请求在 中生成较小的 720p 副本时,才向 传入 )。
renders/<slug>-vN.mp416:99:161:1script.mdmedia/graphics/renders/share/render.py--share你负责编写脚本、旁白和场景代码;这些脚本负责获取媒体、合成语音、对齐词语、编译 HyperFrames、渲染 MP4、执行 10 项检查 QA,并提供评审页面。命令、 语法、引擎 API 和 键都记录在 reference.md 中。
script.mdstyle.json首次使用时,运行 (使用口播旁白时运行 )。如果缺少任何工具,先列出工具并征得同意后再安装。可选的 应放在 中,而不是放在聊天里。
setup.shsetup.sh --voiceGEMINI_API_KEY=...~/.config/video-explainer/.env1. Pick a visual mode
1. 选择视觉模式
Support three visual modes ( in , default ):
Mode:script.mdmotion- Motion (default) (): Full-frame 2D kinetic graphics, live SVG routes and charts, CSS 3D cards or devices, and documentary press clippings on
Mode: motion. Fastest and cheapest.ExplainerStage - Illustrated (): Hand-drawn picture-book animation with gouache, pastel, paper grain, 10 fps line boil, and word-synced characters on
Mode: illustratedandStoryBrush. Uses about 6x the tokens of Motion.IllustratedStage - 3D (): Single-take Three.js camera flythroughs with studio lighting, bloom, camera-facing labels, and optional Blender meshes on
Mode: 3d. Uses about 7x the tokens of Motion.Studio3D
If the user already named a mode or asked to run with defaults, proceed immediately (, captions on). Otherwise, show the numbered list above with its token costs, ask whether they want burned-in captions (on by default), and wait for their reply before building.
Mode: motion支持三种视觉模式( 中的 ,默认值为 ):
script.mdMode:motion- Motion(默认)():全屏 2D 动态图形、实时 SVG 路径与图表、CSS 3D 卡片或设备,以及
Mode: motion上的纪实报刊剪报。速度最快,成本最低。ExplainerStage - Illustrated():手绘绘本式动画,采用水粉画、粉彩、纸张纹理、10 fps 的 line boil,以及
Mode: illustrated和StoryBrush上与词语同步的角色。token 用量约为 Motion 的 6 倍。IllustratedStage - 3D():使用 Three.js 摄像机一镜到底地穿越场景,配以工作室灯光、bloom、始终面向摄像机的标签,以及
Mode: 3d上可选的 Blender 网格模型。token 用量约为 Motion 的 7 倍。Studio3D
如果用户已指定模式或要求使用默认设置直接运行,请立即继续(,字幕开启)。否则,显示上述带编号的列表及其 token 成本,询问用户是否需要烧录字幕(默认开启),并等待用户回复后再开始制作。
Mode: motion2. Research, source media, and write script.md
script.md2. 调研、获取媒体并编写 script.md
script.mdCreate one project folder named with a short slug (, , ) where the user asks, else from , else the current folder.
graphics/media/captures/projects_dirstyle.jsonVerify every claim, number, quote, and step against the user's files or primary sources. Pull real photos, product visuals, clips, or page captures when they ground the story (, , ), and inspect each downloaded image so broken or irrelevant assets stay out of the render. Write :
media.py imagemedia.py clipcapture.pyscript.md- Keep runtime to 60 to 75 seconds (2-minute cap). Target spoken words across
135 to 185scenes when voiced, or5 to 8beats when8 to 12(Voice: none/45 to 60swords for100 to 150). Stay at or underAudience: eli5(120swords). When the user asks for another length, write about 2.5 spoken words per second of it and set~260. Cut tangents rather than rushing speech.Max duration: <seconds> - Default to (smart non-engineer). Use plain English, concrete mental models, and everyday cause-and-effect without raw file paths, internal variable or function names, error codes, CLI flags, or unexplained acronyms in speech or visuals. Switch to
Audience: general(physical metaphors, zero jargon) oreli5(architecture names, protocols, tradeoffs) only when requested.technical - Land the hook in 3 seconds and follow one example end-to-end. Open with a concrete question, tension, or number that reads with the sound off, trace one specific request, dollar, star, or user through every step, and close by answering the opening question.
- Write clean spoken copy. Skip throat-clearing openers, binary contrasts, colon reveals, and hype adjectives. Use short sentences and active verbs.
- Set audio and theme headers: ,
Mode: motion | illustrated | 3d,Audience: general(orVoice: kokoro:af_heart, an audio file, orgemini:Kore),none(Music: synth:cosmic,synth:warm, path, orsynth:minimal),nonewith word-anchoredSound effects: oncues (## Sound),- @s05:iron: rumble 0.8(orCaptions: autowhen the user turned them off), andoff.Style: default | paper | blueprint
Go straight from into narration, graphics, QA, and the browser review page unless the user asked to approve the script first or requested a paid Gemini API call without a configured key.
script.md在用户指定的位置创建一个以简短 slug 命名的项目文件夹(包含 、、);如果未指定,则使用 中的 ;再否则使用当前文件夹。
graphics/media/captures/style.jsonprojects_dir对照用户文件或一手来源核实每一项主张、数字、引述和步骤。当真实照片、产品图、视频片段或页面截图有助于支撑叙事时,获取这些素材(、、),并逐张检查下载的图片,避免损坏或与主题无关的素材进入渲染。编写 :
media.py imagemedia.py clipcapture.pyscript.md- 将时长控制在 60 至 75 秒(上限 2 分钟)。 有配音时,目标是在 至
5个场景中讲8至135个口语词;使用185时,设置Voice: none至8个节拍;使用12时,保持在Audience: eli5至45/60s至100个词。总时长保持在150(约120s个词)以内。当用户要求其他长度时,按每个所要求秒数约 2.5 个口语词撰写,并设置260。应删减旁支内容,而不是加快语速。Max duration: <seconds> - 默认使用 (面向具备理解力、但非工程背景的受众)。 使用通俗易懂的语言、具体的心智模型和日常因果关系;在语音或画面中不要出现原始文件路径、内部变量或函数名、错误码、CLI 标志或未加解释的缩写。仅在用户要求时切换为
Audience: general(使用物理类比,完全不用行话)或eli5(使用架构名称、协议和权衡)。technical - 在前 3 秒内用钩子抓住注意力,并从头到尾讲透一个具体示例。 用一个具体的问题、冲突点或数字开场,即使静音观看也能理解;贯穿追踪一个具体请求、金额、星标或用户的每一步;最后回到并回答开篇的问题。
- 编写简洁、自然的口语稿。 跳过清嗓式开场、二元对比、冒号式揭示和炒作性形容词。使用短句和主动语态。
- 设置音频和主题标头: 、
Mode: motion | illustrated | 3d、Audience: general(或Voice: kokoro:af_heart、音频文件或gemini:Kore)、none(Music: synth:cosmic、synth:warm、路径或synth:minimal)、none,并添加以词语为锚点的Sound effects: on提示(## Sound)、- @s05:iron: rumble 0.8(用户关闭字幕时使用Captions: auto),以及off。Style: default | paper | blueprint
除非用户要求先审批脚本,或要求使用未配置 key 的付费 Gemini API 调用,否则完成 后直接进入旁白、图形、QA 和浏览器评审页面流程。
script.md3. Narrate and align
3. 配音并对齐
Run to synthesize cached per-scene audio, trim dead air, align words with Parakeet, sync and times back into , and write . Read before coding graphics so animations and sound cues hit exact spoken words via .
narrate.pystartendscript.mdwork/transcript.mdwork/transcript.mdstage.cue("s03", "keyword", 1.2)运行 以合成按场景缓存的音频,修剪静音空白,使用 Parakeet 对齐词语,将 和 时间同步回 ,并写入 。在编写图形代码前阅读 ,这样可通过 让动画和音效提示精确对应实际说出的词语。
narrate.pystartendscript.mdwork/transcript.mdwork/transcript.mdstage.cue("s03", "keyword", 1.2)4. Build graphics efficiently
4. 高效构建图形
Point consecutive rows in at so mounts one continuous composition and auto-injects , , , plus () or and ().
## Scenesgraphics/world.htmlbuild.pystage.cssstage.jsexplainer-data.jsillustrated.jsMode: illustratedthree.min.jsstudio3d.jsMode: 3dBuild in one agent; the engines are designed for it. The engine APIs and a starter composition per mode are in reference.md.
- Build on the engines. Use ,
ExplainerStage/StoryBrush,IllustratedStage, andStudio3Dinstead of writing your own noise, shaders, or mesh packers.blender_export.py - Make it a moving film, never slides. One hero visual fills 60 to 85% of the frame and visibly transforms every 2 to 3 seconds: the camera dives, pans, or draws a live path, and objects morph rather than swap. Cards or text on a flat background with no moving hero visual read as a slide deck. Save the built-in single-beat visuals (,
card:,flow:, and the rest) for one-off moments.number: - Keep labels readable. Callouts are 1 to 4 words (labels,
28px+hero numbers) with WCAG AA contrast, above the caption band (88px to 160pxony < 860,16:9ony < 1400).9:16 - Spend tokens where they show (Illustrated and 3D). Pick one setting and move the camera through it instead of building a new world per scene. In Illustrated, bake each prop and character once and reuse it across scenes. In 3D, use procedural meshes and turn to Blender only when sculpted or fractured geometry clearly adds value.
- Keep every frame deterministic on seek. Bind updates to /
stage.onTickand end withstage.onDraw. Load 3D assets synchronously. Skip.finalize()and CSSMath.random()rules on GSAP-animated elements, and puttransformon full-bleeddata-layout-allow-overflowor offscreen art.<canvas>
让 中连续的行都指向 ,这样 就能挂载一个连续构图,并自动注入 、、,以及 ()或 和 ()。
## Scenesgraphics/world.htmlbuild.pystage.cssstage.jsexplainer-data.jsillustrated.jsMode: illustratedthree.min.jsstudio3d.jsMode: 3d在一个 Agent 中完成构建;这些引擎正是为此设计的。引擎 API 和每种模式的起始构图见 reference.md。
- 基于引擎构建。 使用 、
ExplainerStage/StoryBrush、IllustratedStage和Studio3D,而不是自行编写 noise、shader 或 mesh packers。blender_export.py - 让它成为一部会动的影片,而不是幻灯片。 一个主视觉应占据画面的 60% 至 85%,并且每 2 至 3 秒都要有明显变化:摄像机推进、平移或绘制实时路径,对象要发生变形,而不是直接替换。如果平面背景上只有卡片或文字、没有动态主视觉,就会像幻灯片。内置的单节拍视觉(、
card:、flow:等)只适合偶尔使用。number: - 保持标签清晰可读。 标注文字控制在 1 至 4 个词(标注为 ,主视觉数字为
28px+至88px),达到 WCAG AA 对比度,并放在字幕带上方(160px下为16:9,y < 860下为9:16)。y < 1400 - 把 token 花在能被看见的地方(Illustrated 和 3D)。 选择一个场景设定,并让摄像机在其中移动,而不是每个场景都构建一个新世界。在 Illustrated 中,每个道具和角色只烘焙一次,然后在各场景中复用。在 3D 中,优先使用程序化网格;只有当雕刻或碎裂几何体能明显增加价值时,才使用 Blender。
- 确保每次跳转时每一帧都确定一致。 将更新绑定到 /
stage.onTick,并以stage.onDraw结束。同步加载 3D 资产。不要在 GSAP 动画元素上使用.finalize()或 CSSMath.random()规则;对于全屏transform或超出画布的艺术元素,添加<canvas>。data-layout-allow-overflow
5. Preview, draft, QA, review, and final
5. 预览、草稿、QA、评审和最终交付
- Token-light pre-flight: Run (~3s) and inspect the single tiled
render.py "$P" --previewfirst to catch framing, contrast, or whiteout bugs. Open individualwork/preview/contact.jpgfiles only when diagnosing a specific beat.work/preview/frame-*.png - Draft and QA: Run and
render.py "$P" --draft. Fix any failed check (qa.py "$P"required) and inspect10/10andwork/qa/contact.jpg(pluswork/qa/opening.jpgonly around suspect transitions).work/qa/cuts/*.jpg - Fresh-eyes check before the user sees it: measures motion, not whether the video looks like slides. Give
qa.pyandwork/qa/contact.jpgto a fresh subagent with only the mode and the hook line (judge them yourself if your agent has no subagents), and ask: Does any frame read as a slide, meaning text or cards on a flat background with no moving hero visual? Do the first 15 seconds open on a striking visual that changes every 2 to 3 seconds? Does any art look like generic clip art? Fix every yes, re-render the draft, and check again.work/qa/opening.jpg - Browser review loop: Start in a background shell, share its URL, and run
review.py "$P"in the foreground. Apply feedback, re-runreview.py --poll "$P/work"only if spoken words changed, rendernarrate.py, refresh with--draft, runreview.py "$P" --no-open, and poll again until approved.review.py --ack "$P/work" BATCH_ID - Final delivery: Run and
render.py "$P", verify eval.md, ask the user to check voice pacing and mix balance, and report the finalqa.py "$P"path, duration, and loudness. Offer to save custom theme/caption tweaks to.mp4.~/.config/video-explainer/style.json
- 低 token 成本的预检: 运行 (约 3 秒),先检查单张拼贴总览图
render.py "$P" --preview,以发现构图、对比度或画面泛白等问题。仅在诊断某个特定节拍时,才打开单独的work/preview/contact.jpg文件。work/preview/frame-*.png - 草稿和 QA: 运行 和
render.py "$P" --draft。修复所有未通过的检查(要求qa.py "$P"),并检查10/10和work/qa/contact.jpg(仅在可疑转场附近查看work/qa/opening.jpg)。work/qa/cuts/*.jpg - 在用户看到之前进行“新鲜视角”检查: 衡量的是动态效果,而不是视频看起来是否像幻灯片。让一个全新的 subagent 查看
qa.py和work/qa/contact.jpg,且只提供模式和钩子台词(如果你的 agent 没有 subagent,则自行判断),然后询问:任何一帧是否会被读作幻灯片,即平面背景上只有文字或卡片而没有动态主视觉?前 15 秒是否以令人印象深刻的视觉开场,并每 2 至 3 秒发生变化?任何美术是否像通用剪贴画?修复每一个答案为“是”的问题,重新渲染草稿,再次检查。work/qa/opening.jpg - 浏览器评审循环: 在后台 shell 中启动 ,分享其 URL,并在前台运行
review.py "$P"。应用反馈;仅当口播文字发生变化时重新运行review.py --poll "$P/work";渲染narrate.py;使用--draft刷新;运行review.py "$P" --no-open;然后继续轮询,直至获得批准。review.py --ack "$P/work" BATCH_ID - 最终交付: 运行 和
render.py "$P",核验 eval.md,请用户检查语音节奏和混音平衡,并报告最终qa.py "$P"路径、时长和响度。询问是否将自定义主题和字幕微调保存到.mp4。~/.config/video-explainer/style.json