feat(video-pipeline): 将 narration 字段统一重命名为 script
字段重命名涉及所有文档、示例代码、提示词模板以及 slug 生成逻辑,确保管线各阶段(分镜、图生提示词、TTS、成片)一致使用 script 字段承载口播文案。 同时增强 `capcut_assemble.js` 的配音与字幕模块: - 配音支持本地路径模式(不上传 OSS),新增 `--split-captions` 参数启用分句字幕 - 分句字幕按标点切分长文本为短句,基于字数权重动态分配显示时长 - 新增 `update-captions-standalone.js` 独立工具,可在草稿已生成后单独更新字幕
This commit is contained in:
@@ -120,7 +120,7 @@ Step 1: 分镜脚本生成(子 Agent 执行)
|
||||
- 主 Agent 将用户文案 + 模板交给子 Agent
|
||||
- 子 Agent 按模板要求输出分镜表 JSON:
|
||||
```json
|
||||
[{"id":1,"shotDesc":"英文画面描述,40-80词","narration":"中文口播旁白,≤22字","duration":5,"directorRef":"tarantino"}]
|
||||
[{"id":1,"shotDesc":"英文画面描述,40-80词","script":"中文口播文案,≤22字","duration":5,"directorRef":"tarantino"}]
|
||||
```
|
||||
- 主 Agent 审查分镜表(时长合理、隐性动势完整、directorRef 已填)
|
||||
- 展示给用户确认,确认后进入 Step 2-A
|
||||
@@ -128,15 +128,15 @@ Step 1: 分镜脚本生成(子 Agent 执行)
|
||||
Step 2-A: 生成图片提示词(子 Agent 执行)
|
||||
- 读取 account.json 中的 imageStylePrompt 字段,定位图片提示词模板(如 prompts/图片提示词.md)
|
||||
- 子 Agent 为每个 shot 生成 imagePrompt:
|
||||
- 入参:shotDesc + narration(情绪参考)+ directorRef(光影策略)+ 目标模型
|
||||
- 入参:shotDesc + script(情绪参考)+ directorRef(光影策略)+ 目标模型
|
||||
- 出参:imagePrompt(可直接送给图片模型的英文提示词)
|
||||
- 主 Agent 审查 imagePrompt 质量(shotDesc 内容完整保留、光影词库对应 directorRef)
|
||||
|
||||
Step 2-B: 生成静态分镜图 + Manifest 初始化
|
||||
- 组装 items 并初始化 manifest(**不含 videoPrompt**):
|
||||
```bash
|
||||
node pipeline.js init --account <id> --mode <single|framePair> \
|
||||
--items '[{"shotDesc":"...","narration":"...","duration":5,"imagePrompt":"...","directorRef":"tarantino"}]'
|
||||
node scripts/pipeline.js init --account <id> --mode <single|framePair> \
|
||||
--items '[{"shotDesc":"...","script":"...","duration":5,"imagePrompt":"...","directorRef":"tarantino"}]'
|
||||
```
|
||||
- 脚本自动从 account.json 继承:imageModel、videoModel、format、references
|
||||
- 所有 item.confirmed = false
|
||||
@@ -147,7 +147,7 @@ Step 2-B: 生成静态分镜图 + Manifest 初始化
|
||||
Step 2-C: 人工确认(可选卡点)
|
||||
- 展示所有分镜图给用户
|
||||
- 用户可:确认全部 / 替换 MJ 候选图(改 item.file = item.candidates[N]) / 删除不合格 item / 跳过确认直接继续
|
||||
- 用户确认后:`node pipeline.js confirm --manifest <path> --all`
|
||||
- 用户确认后:`node scripts/pipeline.js confirm --manifest <path> --all`
|
||||
- 跳过确认时:批量设置 `confirmed = true`,直接进入 Step 3
|
||||
|
||||
Step 3-A: 生成视频提示词(子 Agent 执行)
|
||||
@@ -165,7 +165,7 @@ Step 3-B: 生成视频片段
|
||||
|
||||
Step 4: TTS + 成片
|
||||
- 跑 tts + assemble 阶段:`pipeline.js run --manifest <path> --phase tts,assemble`
|
||||
- TTS 使用 narration 字段(口播旁白)
|
||||
- TTS 使用 script 字段(口播旁白)
|
||||
- 检查字幕准确、BGM 不盖配音
|
||||
```
|
||||
|
||||
@@ -175,33 +175,33 @@ Step 4: TTS + 成片
|
||||
|
||||
```bash
|
||||
# 创建账号(Step 0:首次使用时)
|
||||
node pipeline.js create-account --id <id> --name <名称> \
|
||||
node scripts/pipeline.js create-account --id <id> --name <名称> \
|
||||
--desc <描述> --video-model veo3-fast --references ./ref1.png,./ref2.png
|
||||
|
||||
# 校验账号完整性
|
||||
node pipeline.js validate-account --account <id>
|
||||
node scripts/pipeline.js validate-account --account <id>
|
||||
|
||||
# 初始化 manifest(Step 2-B 使用,AI 只提供创意内容,不含 videoPrompt)
|
||||
node pipeline.js init --account <id> --mode <single|framePair> \
|
||||
--items '[{"shotDesc":"...","narration":"...","duration":5,"imagePrompt":"...","directorRef":"tarantino"}]'
|
||||
node scripts/pipeline.js init --account <id> --mode <single|framePair> \
|
||||
--items '[{"shotDesc":"...","script":"...","duration":5,"imagePrompt":"...","directorRef":"tarantino"}]'
|
||||
# 也可从文件读取 items(适合大量数据)
|
||||
node pipeline.js init --account <id> --mode single --items-file ./items.json
|
||||
node scripts/pipeline.js init --account <id> --mode single --items-file ./items.json
|
||||
|
||||
# 校验 manifest 完整性
|
||||
node pipeline.js validate --manifest <path>
|
||||
node scripts/pipeline.js validate --manifest <path>
|
||||
|
||||
# 人工确认分镜图(Step 2-C,可选:跳过时 Agent 批量设置 confirmed=true)
|
||||
node pipeline.js confirm --manifest <path> --all
|
||||
node scripts/pipeline.js confirm --manifest <path> --all
|
||||
|
||||
# 跑指定阶段
|
||||
node pipeline.js run --manifest <path> --phase images
|
||||
node pipeline.js run --manifest <path> --phase upload,videos
|
||||
node scripts/pipeline.js run --manifest <path> --phase images
|
||||
node scripts/pipeline.js run --manifest <path> --phase upload,videos
|
||||
|
||||
# 断点续跑(跳过已完成阶段和 item)
|
||||
node pipeline.js run --manifest <path> --resume
|
||||
node scripts/pipeline.js run --manifest <path> --resume
|
||||
|
||||
# 查看进度
|
||||
node pipeline.js status --manifest <path>
|
||||
node scripts/pipeline.js status --manifest <path>
|
||||
```
|
||||
|
||||
**阶段**: `images` → `upload` → `videos` → `tts` → `assemble`
|
||||
@@ -335,7 +335,7 @@ node kling-video-generator.js --image <url> --prompt <prompt> -o ./videos
|
||||
output/{name}_{YYYYMMDD}_{NNN}/
|
||||
├── manifest.json # 主清单(贯穿全流程)
|
||||
├── prompts.txt # 原始提示词存档
|
||||
├── images/ # scene_{NN}_{slug}.jpeg(slug 从 narration/shotDesc 派生,首尾帧加 _last 后缀)
|
||||
├── images/ # scene_{NN}_{slug}.jpeg(slug 从 script/shotDesc 派生,首尾帧加 _last 后缀)
|
||||
├── videos/ # scene_{NN}_{slug}.mp4(与图片对应)
|
||||
└── urls.json # OSS 公网 URL 映射
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user