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 type | text, shape, image, chart (bar/line, data 或 csv), counter, lower_third, plate (全幀畫面插槽) |
anim | fade, rise, slide, scale, type, words, draw, grow, kenburns, none |
camera.move | static, push-in, pull-out, pan-left/right, tilt-up/down, drift |
transition | cut, fade (交叉淡出), dip (透過背景) |
mode | greybox (圖片與 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 了解時機、緩動、無障礙與渲染來源。