feat(video-pipeline): 将 narration 字段统一重命名为 script

字段重命名涉及所有文档、示例代码、提示词模板以及 slug 生成逻辑,确保管线各阶段(分镜、图生提示词、TTS、成片)一致使用 script 字段承载口播文案。

同时增强 `capcut_assemble.js` 的配音与字幕模块:
- 配音支持本地路径模式(不上传 OSS),新增 `--split-captions` 参数启用分句字幕
- 分句字幕按标点切分长文本为短句,基于字数权重动态分配显示时长
- 新增 `update-captions-standalone.js` 独立工具,可在草稿已生成后单独更新字幕
This commit is contained in:
2026-05-01 02:48:37 +08:00
parent c878abc39b
commit 96f00ce7fd
9 changed files with 346 additions and 86 deletions

View File

@@ -86,7 +86,7 @@ accounts/ # 项目根目录下
| 文件 | 用途 | Step |
|------|------|------|
| `分镜.md` | 口播文案 → 分镜表shotDesc/narration/duration/directorRef | Step 1 |
| `分镜.md` | 口播文案 → 分镜表shotDesc/script/duration/directorRef | Step 1 |
| `图片提示词.md` | shotDesc + directorRef → imagePrompt | Step 2-A |
| `视频提示词.md` | shotDesc + directorRef → videoPrompt | Step 3-A |

View File

@@ -2,7 +2,7 @@
> `pipeline.js init` 创建Pipeline 执行Agent 审查。
>
> **禁止 AI 手写 manifest.json**,必须通过 `pipeline.js init` 初始化。脚本从 account.json 自动继承结构字段AI 只提供创意内容items 的 shotDesc/narration/imagePrompt 等)。
> **禁止 AI 手写 manifest.json**,必须通过 `pipeline.js init` 初始化。脚本从 account.json 自动继承结构字段AI 只提供创意内容items 的 shotDesc/script/imagePrompt 等)。
---
@@ -10,18 +10,18 @@
```bash
# Step 2-A 生成 imagePrompt 后,通过脚本初始化(不含 videoPrompt
node pipeline.js init --account 军事账号 --mode single \
--items '[{"shotDesc":"英文画面描述","narration":"中文口播旁白","duration":5,"imagePrompt":"English prompt","directorRef":"tarantino"}]'
node scripts/pipeline.js init --account 军事账号 --mode single \
--items '[{"shotDesc":"英文画面描述","script":"中文口播文案","duration":5,"imagePrompt":"English prompt","directorRef":"tarantino"}]'
# 或从文件读取
node pipeline.js init --account 军事账号 --mode single --items-file ./items.json
node scripts/pipeline.js init --account 军事账号 --mode single --items-file ./items.json
# Step 2-C 人工确认
node pipeline.js confirm --manifest <path> --all
node pipeline.js confirm --manifest <path> --items 1,3,5
node scripts/pipeline.js confirm --manifest <path> --all
node scripts/pipeline.js confirm --manifest <path> --items 1,3,5
# 校验已有 manifest
node pipeline.js validate --manifest <path>
node scripts/pipeline.js validate --manifest <path>
```
---
@@ -58,7 +58,7 @@ node pipeline.js validate --manifest <path>
|------|------|
| `status` | 固定写 `"pending"` |
| `shotDesc` | 英文分镜描述含隐性动势40-80词 |
| `narration` | **该段的完整原文案**(不提炼,保留论证、例子、细节)|
| `script` | **该段的完整原文案**(不提炼,保留论证、例子、细节)|
| `duration` | 计划视频时长(秒),来自分镜阶段 |
| `imagePrompt` | 英文画面描述(给 Gemini/MJStep 2-A 生成 |
| `directorRef` | 导演构图参考tarantino / kitano / fincher三层透传 |
@@ -90,7 +90,7 @@ node pipeline.js validate --manifest <path>
- MJ 换选:`item.file = item.candidates[2]`
- 删除不合格 item直接从 items 数组移除,重新跑 `--phase images`
- 调整 prompt 重跑:改 `imagePrompt`status 改回 `pending`
- 人工确认:`node pipeline.js confirm --manifest <path> --all`
- 人工确认:`node scripts/pipeline.js confirm --manifest <path> --all`
---
@@ -115,7 +115,7 @@ Agent **不需要记住这些条件**pipeline 内部自动匹配。仅供理
| images | `status=pending` + 有 `imagePrompt` |
| upload | `status=done` + 有 `file` + 无 `url` |
| videos | `status=done` + `confirmed=true` + 有 `url` + 有 `videoPrompt` + 无 `video` |
| tts | `status=done` + 有 `narration`(回退 `text` + 无 `audio` |
| tts | `status=done` + 有 `script`(回退 `text` + 无 `audio` |
### pipeline.phases 整体状态
@@ -137,7 +137,7 @@ Agent **不需要记住这些条件**pipeline 内部自动匹配。仅供理
```bash
# 只改 prompt 不改图片风格 → 重试即可
node pipeline.js run --manifest <path> --phase images --retry-failed
node scripts/pipeline.js run --manifest <path> --phase images --retry-failed
# 需要换 prompt → 先改 item.imagePrompt再重试
# (改完后跑上面同一条命令)
@@ -147,7 +147,7 @@ node pipeline.js run --manifest <path> --phase images --retry-failed
```bash
# API 临时故障、网络超时 → 直接重试
node pipeline.js run --manifest <path> --phase videos --retry-failed
node scripts/pipeline.js run --manifest <path> --phase videos --retry-failed
# 提示词问题 → 先改 item.videoPrompt再重试
# (改完后跑上面同一条命令)
@@ -158,7 +158,7 @@ node pipeline.js run --manifest <path> --phase videos --retry-failed
**全阶段重试**
```bash
node pipeline.js run --manifest <path> --retry-failed
node scripts/pipeline.js run --manifest <path> --retry-failed
```
### `--retry-failed` 内部行为