视频分镜动画 是做什么的?
可移植性: Python 标准库脚本 + 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 # 退出码 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": "启动", "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": "一行旁白。",
"layers": [{"type": "text", "text": "标题", "style": "title", "x": 0.5, "y": 0.45, "in": 0.2, "anim": "words"}]}]}
| 字段 | 值 |
|---|---|
图层 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 (图片和素材显示为带标签的方块) 或 final (真实媒体;plate 的 src 可以是 MP4) |
文本样式:title, subtitle, body, caption, kicker。颜色支持十六进制值或主题键 (fg, accent, muted)。fixed: true 可使图层不跟随摄像机运动。
Linter(退出码 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 通过 file:// 协议在 Chromium 中打开 HTML,以便其中的脚本可以读取本地文件。渲染浏览器会阻止所有外部请求(Google Fonts 除外),并报告被阻止的内容;仅当媒体 URL 可靠时,才传递 --allow-remote 参数。
设计规则
- 一个镜头一个想法;一种标题字体和一种正文字体。
- 动效应用于说明,而非装饰:每一次运动都应指向重要内容。
- 数字递增、条形增长、线条绘制;观众观看的是变化过程,而不是幻灯片。
- 保持
plate的提示词中不包含文本:标题和数字应保留在代码中。
请参阅 motion_craft.md 了解有关时间、缓动、可访问性和渲染源的信息。