Files
video-create/.claude/skills/video-from-script/references/manifest-schema.md

109 lines
3.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# manifest.json 规范
> `pipeline.js init` 创建Pipeline 执行Agent 审查。
>
> **禁止 AI 手写 manifest.json**,必须通过 `pipeline.js init` 初始化。脚本从 account.json 自动继承结构字段AI 只提供创意内容items 的 text/imagePrompt/videoPrompt/keyword
---
## 创建方式
```bash
# AI 生成创意内容后,通过脚本初始化
node pipeline.js init --account military --mode single \
--items '[{"text":"中文文案","imagePrompt":"English prompt","videoPrompt":"motion prompt","keyword":"关键词","keywordColor":"#FF6B35"}]'
# 或从文件读取
node pipeline.js init --account military --mode single --items-file ./items.json
# 校验已有 manifest
node pipeline.js validate --manifest <path>
```
---
## 顶层字段
| 字段 | 说明 | 来源 | 谁填充 |
|------|------|------|--------|
| `account` | 账号 ID | account.json | **init 自动** |
| `imageModel` | `gemini` / `mj` | account.json | **init 自动** |
| `videoModel` | `veo3-fast` / `grok-video-3` 等 | account.json | **init 自动** |
| `format` | 画幅:`9:16` / `16:9` | account.json | **init 自动** |
| `mode` | `single` 单图 / `framePair` 首尾帧 | CLI 参数 | **init 自动** |
| `references` | 参考图数组,从 account.json styles.*.references 搬入 | account.json | **init 自动** |
| `items` | 素材数组AI 提供创意内容) | CLI --items | **AI → init** |
**init 自动继承的字段不需要 AI 关心,不会出错。**
---
## references 字段
从 account.json 搬入pipeline 直接使用,不再回读 account.json。
- **Gemini** → 读 `file`(本地路径,图生图用)
- **MJ** → 读 `url`(公网 URL`--sref` 用)
---
## items[] 字段
### Agent 写入(创建时)
| 字段 | 说明 |
|------|------|
| `status` | 固定写 `"pending"` |
| `text` | 中文字幕文案 |
| `imagePrompt` | 英文画面描述(给 Gemini/MJ |
| `videoPrompt` | 英文运动描述(给 Grok/VEO描述镜头运动而非内容 |
| `keyword` | 字幕高亮关键词 |
| `keywordColor` | 高亮颜色 |
### Pipeline 回写(执行后)
| 字段 | 说明 | 写入阶段 |
|------|------|---------|
| `status` | `pending``generating``done` / `failed` | images |
| `file` | 生成的图片路径(相对 manifest | images |
| `candidates` | MJ 拆分的 4 张候选图路径Gemini 无此字段) | images |
| `url` | 图片 OSS 公网 URL | upload |
| `video` | 生成的视频路径 | videos |
| `videoDuration` | 视频时长Grok=6, VEO=8 | videos |
| `videoUrl` | 视频 OSS 公网 URL | videos |
| `audio` | TTS 音频路径 | tts |
| `duration` | 音频时长(秒) | tts |
### Agent 审查时可操作
- MJ 换选:`item.file = item.candidates[2]`
- 删除不合格 item直接从 items 数组移除,重新跑 `--phase images`
- 调整 prompt 重跑:改 `imagePrompt`status 改回 `pending`
---
## 首尾帧模式
`mode: "framePair"` 时,`imagePrompt` 作为起始帧,每个 item 额外字段:
| 字段 | 说明 | 谁填充 |
|------|------|--------|
| `imagePrompt` | 起始帧画面描述(与 single 模式复用同一字段) | AI |
| `lastFramePrompt` | 结束帧画面描述 | AI |
| `lastFrame` | 结束帧图片路径 | **pipeline images 回写** |
| `lastFrameUrl` | 结束帧 OSS URL | **pipeline upload 回写** |
**首尾帧规则**同一场景、视角一致、状态对比。VEO 检测到 `lastFrameUrl` 自动启用双图模式。
---
## 目录结构
```
output/{account}_{YYYYMMDD}_{NNN}/
├── manifest.json # 主清单
├── images/ # scene_{NN}_{keyword}.jpeg首尾帧加 _lastMJ 候选加 _cand{1-4}
├── videos/ # scene_{NN}_{keyword}.mp4
└── audio/ # seg_001.mp3
```