Communitygithub.com

akshayDev17/ai-explainer-video

為影片的各個片段編寫與迭代動畫視覺。這是explainer-video-from-coursework管線的第五階段;當某個節拍需要停留時,它會重新調用音頻階段。

ai-explainer-video 是什麼?

這是「explainer-video-from-coursework」管線中的第五階段(共八階段),主要負責將課程內容轉換為動畫解釋影片的視覺部分。此技能作為音頻階段的協調器,以循環方式運作:每當pacing-check工具偵測到某個節拍的時間不足時,會自動重新調用build-audio階段來插入填充(pad)並重新調整時間軸。視覺部分以「節拍」(beat)為單位,每個節拍對應一段旁白及其對應的視覺,支援SVG、程式碼展示和圖表三種場景主機,透過聲明SCENE_BEATS來控制每個節拍的開始時間、最小停留時間與是否允許延長。最終的檢查流程包括執行pacing-check確保時間與結構正確,以及手動檢視渲染的靜態畫面來捕捉色彩、連接線等視覺錯誤。此技能須在具備無頭Chromium的環境中運行,並與同系列的其他技能協作。

相容平台~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(來自音頻階段)以及影片的腳本;還需要無頭 Chromium 來執行 --shots 渲染(請參閱 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>
        (時間不足 = "beat X needs +3s" → 在腳本草段中加入 `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 技能中的 「Stage 5 — /scene」 區段,並在回覆中指出該區段的名稱。

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.

相關技能