Communitygithub.com

akshayDev17/ai-explainer-video

生成并迭代视频片段的动画视觉。explainer-video-from-coursework 管线的第五阶段;当节拍需要停顿时会重新调用音频阶段。

ai-explainer-video 是什么?

此技能是 `explainer-video-from-coursework` 管线(共 8 个阶段)中的第五阶段,负责为课程内容生成讲解视频的视觉动画。它作为音频阶段的编排器运行:循环处理每个节拍(beat),当节拍需要额外停顿(`hold: true`)时,重新调用 `build-audio` 阶段以扩展时间线。技能支持三种视觉宿主:SVG(通用场景)、代码(代码演练)和图表(声明式节点/边/显示配置)。每个节拍由起止时间、最短停留时间和是否允许超时标志定义,节拍拥有独立定时控制。该技能还集成了节拍检查(`pacing-check`)、音频重建(`build-audio`)和渲染(`render`)工具,生成快照供人工检查视觉缺陷。仅当 `pacing-check` 返回零且所有快照经人工核验后,阶段才视为完成。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/akshayDev17/ai-explainer-video/tree/HEAD/skills/craft-video-scene

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

craft-video-scene — 创作视觉内容

属于 explainer-video-from-coursework 管线的一部分 — 第 5 阶段(共 8 个)。这是 音频阶段的编排器:它循环执行,并在某个节拍无法适配时重新调用 build-audio。 音频阶段本身是一次性的,不会循环返回。

管线的工具和场景宿主位于同级的 explainer-video-from-coursework 技能中:通过 node ../explainer-video-from-coursework/tools/<tool>.mjs 运行,相对于该技能的文件夹解析。从项目根目录运行,以便 out/ 临时文件与你的笔记并列。

先决条件: out/<name>/<NN>/timeline.json(来自音频阶段)和视频的脚本;用于 --shots 模式的无头 Chromium(参见 SETUP.md)。

如果在 --shots 渲染时出现 Playwright cache not found 错误,表示缺少 Chromium — 请向用户传达 SETUP.md 中的步骤并重新运行。

每个片段就是一个节拍:旁白加上说明该旁白的视觉内容。将视觉内容创作为视觉节拍 — 每个步骤都有最小停留时间和与旁白的对齐方式 — 而不是原始秒数。

每个片段的宿主(out/<name>/<NN>/manifest.json,key → {host, scene}):

  • svg(src/scene-svg.html)— 开放通道;暴露 renderAt(t, svg, timeline) 和 SCENE_BEATS。
  • code(src/scene-code.html)— 代码讲解。
  • diagram(src/scene-diagram.html)— 声明式 nodes/edges/reveal/banners 配置,基于 scene-core.js 构建。

节拍控制时序 — 为每个片段声明 SCENE_BEATS: { id, at, min, hold }。at 是旁白开始的秒数,min 是最短停留时间,hold: true 表示该节拍允许在旁白结束后继续。

循环,以工具调用的形式表示

编写/编辑一个场景
  → node ../explainer-video-from-coursework/tools/pacing-check.mjs --scene out/<name>/<NN>/scenes/<name>.js \
        --timeline out/<name>/<NN>/timeline.json --segment <key>
        (不足 = "节拍 X 需要 +3 秒" → 向脚本片段添加 `pad`,
         在该节拍上设置 `hold: true`)
  → 如果添加了 pad:
        node ../explainer-video-from-coursework/tools/build-audio.mjs --script out/<name>/scripts/<NN>-*.json \
              --out out/<name>/<NN> --voice Aoede
        (免费 — TTS 文本缓存 — 并且会重新铺展时间线更宽)
  → node ../explainer-video-from-coursework/tools/render.mjs --shots 6,20,34 --work out/<name>/<NN> \
        --scene "src/scene-diagram.html?scene=<name>"
  → 查看静态截图      ← 没有任何工具自动化这一步
  → 修正 → 重复

检查器捕捉时序和结构问题,但从不捕捉视觉故障 — 缺失的芯片、孤立的连接器、错误的颜色。只有查看渲染的帧才能发现这些问题。

完成条件: pacing-check 退出码为 0 且 每个静态截图都已人工检查。

维护

如果你修改此文件,或用户要求更改此阶段,请告知用户必须同步更新主 explainer-video-from-coursework 技能的 **

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

akshayDev17/ai-explainer-video

Assemble one video from its segments — render each window silent, concatenate, mux the narration once, and verify. Stage 8 of explainer-video-from-coursework.

akshayDev17/ai-explainer-video

Synthesize narration and build the measured timeline for one video. Stage 4 of explainer-video-from-coursework — the one-shot TTS primitive.

akshayDev17/ai-explainer-video

Retitle and curate the videos in an explainer-video plan — write enrichment.json and merge it. Stage 2 of explainer-video-from-coursework; run it alone to retitle an existing plan.

akshayDev17/ai-explainer-video

Decompose a coursework notes directory into an explainer-video plan and prove no content-bearing section is dropped. Stage 1 of explainer-video-from-coursework; run it alone to (re)plan a directory.

akshayDev17/ai-explainer-video

Generate YouTube chapters and English captions for one finished video. Stage 6 of explainer-video-from-coursework.

akshayDev17/ai-explainer-video

Render one scene config over one time window to an MP4 (or a handful of QA stills). Stage 7 of explainer-video-from-coursework — the render primitive.

akshayDev17/ai-explainer-video

Write and validate the spoken narration for one explainer-video. Stage 3 of explainer-video-from-coursework; run it alone to (re)write a video's script.

akshayDev17/ai-explainer-video

Plan an explainer-video series from a directory of coursework notes — decompose into videos (proving nothing is dropped), retitle and curate, write the narration, synthesize the audio, author the visuals, then render and assemble the finished cut. Use when the user wants to turn structured coursework notes into explainer videos.

相关技能