Communitygithub.com

video-animatic

用於透過程式碼建立動畫、動態圖形、動態文字、資料動畫圖表或動畫腳本,並將其渲染為幀精確的 MP4 影片。將場景 JSON 編譯成可搜尋的 HTML 時間軸,並檢查可讀性、閃爍與對比度,使用 Playwright 渲染,並輸出乾淨的關鍵幀供 AI 鏡頭升級。

video-animatic 是什麼?

video-animatic 是一個專為開發者設計的 AI 代理技能,用於以程式化的方式建立幀精確的動畫、動態圖形與動畫腳本,並將其渲染為 MP4 影片。其核心是將一個 `scene.json` 檔案(描述鏡頭與圖層)透過 `timeline_compiler.py` 編譯成單一 HTML 時間軸頁面,該頁面使用 `window.__seek(t)` 函式在給定時間點繪製完全相同的幀圖,確保渲染結果可重複且一致。此技能支援 Playwright 與 ffmpeg,可以在本機離線執行。它還內建了 linter(`motion_linter.py`)來檢查文字可讀性、閃爍風險(WCAG 2.3.1 規範)、對比度、時間長度與節奏等問題。此外,該技能支援 `upgrade` 模式,可從分鏡圖渲染出關鍵幀,並產出 `shots.json` 清單,供其他 AI 代理(如 `video-director`)進行後續的 AI 鏡頭升級。整體而言,它提供了一個資料驅動、可腳本化且幀精確的動畫工作流程,適用於 Claude Code、Cursor、Codex 等開發工具。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/pomnijax899-web/skills/tree/HEAD/.claude/skills/video-animatic

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Video Animatic

可攜性: Python stdlib 腳本 + Playwright (pip install playwright && python -m playwright install chromium,或 Node Playwright) + ffmpeg。免費,使用 --offline 可離線執行。

電影就是資料。scene.json 以標準化座標描述鏡頭與圖層;timeline_compiler.py 將其轉換為單一 HTML 頁面,該頁面的 window.__seek(t) 會在時間 t 繪製精確的幀圖。沒有任何東西依賴系統時鐘,因此第 214 幀每次渲染都是相同的像素,且修改一個鏡頭只會重新渲染該鏡頭。

工作流程

S=${CLAUDE_PLUGIN_ROOT}/skills/video-animatic/scripts
python3 $S/motion_linter.py --scene film/scene.json                 # exit 4 = 先修正
python3 $S/timeline_compiler.py --scene film/scene.json --out film/animatic.html
# 在瀏覽器中開啟 film/animatic.html:播放、拖曳時間軸、檢視
python3 $S/frame_renderer.py --html film/animatic.html --fps 12 --mp4 film/animatic.mp4   # 檢視剪輯
python3 $S/frame_renderer.py --html film/animatic.html --shots s3   # 編輯後只重新渲染一個鏡頭
python3 $S/timeline_compiler.py --scene film/scene.json --aspect 9:16 --out film/vertical.html   # 同一部電影,直式版本

記得也要對目標比例進行 lint 檢查(motion_linter.py --aspect 9:16):適合 16:9 的文字在重新構圖時經常會超出安全區域。

scene.v1 一覽

{"schema": "scene.v1",
 "meta": {"title": "Launch", "aspect": "16:9", "fps": 30, "target_duration": 12, "mode": "greybox"},
 "theme": {"bg": "#0b0d12", "fg": "#f5f7fa", "accent": "#5b8cff", "font_heading": "Inter"},
 "shots": [{"id": "s1", "duration": 4, "transition": "cut",
            "camera": {"move": "push-in", "amount": 0.06},
            "vo": "One line of narration.",
            "layers": [{"type": "text", "text": "Headline", "style": "title", "x": 0.5, "y": 0.45, "in": 0.2, "anim": "words"}]}]}
欄位數值
layer typetext, shape, image, chart (bar/line, data 或 csv), counter, lower_third, plate (全幀畫面插槽)
animfade, rise, slide, scale, type, words, draw, grow, kenburns, none
camera.movestatic, push-in, pull-out, pan-left/right, tilt-up/down, drift
transitioncut, fade (交叉淡出), dip (透過背景)
modegreybox (圖片與 plate 顯示為帶標籤的方塊) 或 final (實際媒體;plate 的 src 可以是 MP4)

文字樣式:title, subtitle, body, caption, kicker。顏色可接受十六進位值或主題鍵值(fg, accent, muted)。fixed: true 可使圖層不受攝影機移動影響。

Linter(exit 4 會阻止流程)

ML1 總長度與目標長度不符 · ML2 文字在可讀完前就消失 · ML3 旁白比其鏡頭還長 · ML4 每秒超過 3 次閃爍 (WCAG 2.3.1) · ML5 文字對比度低於 4.5:1 · ML6 圖層時間超出所屬鏡頭 · ML7 升級鏡頭缺少提示詞。警告:ML8 安全區域, ML9 節奏, ML10 超過兩種字型。

關鍵幀與升級清單

對於標記為 upgrade: true 的鏡頭,將分鏡圖靜態圖作為 plate 的 src,使用 --mode final 編譯,然後執行:

python3 $S/frame_renderer.py --html film/final.html --out film/keyframes --keyframes
python3 $S/shot_manifest.py --scene film/scene.json --keyframes film/keyframes --out film/shots.json

shots.json (shots.v1) 為每個鏡頭包含:提示詞、精確時長、比例、一句攝影機意圖描述、首幀與末幀關鍵幀,以及哪些部分保留為程式碼疊加層。它不指定提供者也不呼叫任何東西;video-director 會引用並發送它。灰盒佔位圖永遠不會作為關鍵幀發送,因為它不包含任何構圖資訊。

只渲染您自己編譯的頁面:frame_renderer.py 會在 Chromium 中從 file:// 開啟 HTML,以便其腳本能讀取本機檔案。渲染瀏覽器會封鎖除 Google Fonts 以外的所有遠端請求,並回報被封鎖的內容;僅對您信任的媒體 URL 傳遞 --allow-remote。

設計規則

  • 一個鏡頭一個想法;一種標題字型、一種正文字型。
  • 動畫應解釋說明的內容,而非裝飾:每個動作都應指向重要的事物。
  • 數字向上數、長條圖增長、線條繪製;觀眾觀看的是變化,而非幻燈片。
  • 保持 plate 的提示詞不含文字:標題與圖形應保留在程式碼中。

請參閱 motion_craft.md 了解時機、緩動、無障礙與渲染來源。

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

相關技能