Files
video-create/.claude/skills/video-from-script/references/workflow-issues-20260501.md
lc 6eec0e8889 feat(skills): 完善视频生产 pipeline 及新增健身跟练账号
- SKILL.md: 新增工作流阶段定义、质量卡点、分镜规则
- manifest-schema.md: 补充完整字段规范及类型定义
- phase-tts.js: 优化 TTS 合成长逻辑,添加进度追踪
- capcut-tracks.js: 扩展轨道构建能力,支持更多元素类型
- capcut-timeline.js: 改进时间线生成,支持淡入淡出
- capcut_assemble.js: 新增 assemble 阶段完整实现
- cmd-init.js: 完善 init 命令逻辑
- qwen-tts.js: 调整超时配置
- accounts/禁忌帝王学: 更新拆分/图像/台词提示词
- accounts/健身跟练: 新增账号含 account.json 及全套提示词模板
- 新增 workflow-issues-20260501.md 参考文档

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 22:53:37 +08:00

92 lines
3.3 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 初始化缺少 file 字段
**现象:**
```
[assemble] 成片失败: The "path" argument must be of type string. Received undefined
```
**根因:**
`pipeline.js init` 生成的 manifest.json 中,每个 item 只有 `shotDesc``script``duration` 等字段,**缺少 `file` 字段**。
`capcut_assemble.js` 依赖 `item.file` 来定位本地图片:
```js
const filePath = path.join(inputDir, item.file)
return fs.existsSync(filePath)
```
没有 `file` 字段时,`path.join(inputDir, undefined)``undefined` → 报错。
**修复:**
手动给每个 item 补上 `file` 字段:
```js
m.items.forEach((item, i) => {
item.file = 'images/scene_' + String(i+1).padStart(2,'0') + '_' + slug + '.jpeg'
})
```
**建议改进:**
`pipeline.js init` 应自动根据 items 索引和 slug 生成 `file` 字段,与后续 assemble 阶段无缝衔接。
---
## 问题二:并行生图命令的 cwd 问题
**现象:**
```bash
# 6 个并行命令,其中 5 个报错
cd .claude/skills/video-from-script/scripts && node gemini-image-generator.js ...
# Exit code 1: no such file or directory
```
**根因:**
5 个并行命令在解析时zsh 把 `.claude/...` 路径中 `.` 视为当前目录的相对路径,而并行任务可能在不同 cwd 下执行,导致路径解析失败。
**修复:**
改用绝对路径:
```bash
SCRIPTS="/Users/lc/Desktop/CLAUDE/video-create/.claude/skills/video-from-script/scripts"
node "$SCRIPTS/gemini-image-generator.js" generate "..." -o "$OUT" -r 9:16
```
**建议改进:**
CLI 命令始终使用绝对路径,避免相对路径在并行环境下的歧义。
---
## 问题三shot 6 在 mv 重命名时被遗漏
**现象:**
6 张图生完后,重命名时只有 5 张被正确命名为 `scene_0X_xxx.jpeg`,缺少 `scene_06_跪着.jpeg`
**根因:**
mv 命令基于修改时间排序zsh glob `generated_*.jpeg` 只匹配当时存在的文件。6张图的生成时间戳不同重命名脚本从最旧的文件开始取tail -1但脚本顺序与实际时间顺序可能不匹配。
**修复:**
直接对生成的临时文件重命名为固定名称,不依赖时间排序逻辑。
**建议改进:**
pipeline.js 的生图阶段应直接输出为 `scene_{NN}_{slug}.jpeg`,而非先生成 `generated_*.jpeg` 再重命名。
---
## 问题四pipeline.js assemble 阶段的路径解析 Bug
**现象:**
`pipeline.js run --phase tts,assemble` 时 tts 正常,但 assemble 阶段找不到文件而报错。直接调用 `capcut_assemble.js --input <dir>` 则正常。
**根因:**
pipeline.js 在调用 assemble 时,传递的 input 路径为相对路径,且未正确设置 `item.file` 字段,导致 assemble 内部 `path.join(inputDir, item.file)` 得到 undefined。
**建议改进:**
`pipeline.js run --phase assemble` 前应先检查 items 是否都有 `file` 字段,缺失时自动补充。
---
## 建议的改进方向
1. **`pipeline.js init`** 自动生成 `file` 字段,与图片命名规范一致
2. **CLI 命令** 统一使用绝对路径,避免 cwd 歧义
3. **生图脚本** 直接输出为 `scene_XX_xxx.jpeg`,消除重命名步骤
4. **`pipeline.js validate`** 增加 assemble 阶段的前置检查items.file + items.audio 完整性)