feat(video-pipeline): 用 ffprobe 实际测量音视频时长并统一字段名为 script

将项目中的 `narration` 字段统一重命名为 `script`,并新增 `getAudioDurationSec` 函数通过 `ffprobe` 实际测量音频和视频文件的时长,替代 Manifest 中的估计值,提高时间线组装的准确性。同时优化字幕逻辑,仅在有 TTS 音频时调整视频速度。
This commit is contained in:
2026-05-01 01:52:02 +08:00
parent 7d526d2b60
commit c878abc39b
8 changed files with 130 additions and 41 deletions

View File

@@ -32,7 +32,7 @@ function validateManifest(manifestPath) {
if (manifest.items && Array.isArray(manifest.items)) {
manifest.items.forEach((item, i) => {
const prefix = `items[${i}]`
if (!item.narration && !item.text) issues.push(`${prefix} 缺少 narration 或 text中文旁白`)
if (!item.script && !item.text) issues.push(`${prefix} 缺少 script 或 text中文文案`)
if (!item.shotDesc) issues.push(`${prefix} 缺少 shotDesc分镜描述`)
if (!item.imagePrompt) issues.push(`${prefix} 缺少 imagePrompt`)
if (manifest.mode === 'framePair' && !item.lastFramePrompt) {