feat(video-pipeline): 用 ffprobe 实际测量音视频时长并统一字段名为 script
将项目中的 `narration` 字段统一重命名为 `script`,并新增 `getAudioDurationSec` 函数通过 `ffprobe` 实际测量音频和视频文件的时长,替代 Manifest 中的估计值,提高时间线组装的准确性。同时优化字幕逻辑,仅在有 TTS 音频时调整视频速度。
This commit is contained in:
@@ -40,7 +40,7 @@ function initManifest(options) {
|
||||
}
|
||||
|
||||
// 校验必填字段
|
||||
const requiredFields = ['shotDesc', 'narration', 'imagePrompt']
|
||||
const requiredFields = ['shotDesc', 'script', 'imagePrompt']
|
||||
const resolvedMode = mode || 'single'
|
||||
|
||||
for (let i = 0; i < rawItems.length; i++) {
|
||||
@@ -72,7 +72,7 @@ function initManifest(options) {
|
||||
id: i + 1,
|
||||
status: 'pending',
|
||||
shotDesc: raw.shotDesc || '',
|
||||
narration: raw.narration || raw.text || '',
|
||||
script: raw.script || '',
|
||||
duration: raw.duration || 5,
|
||||
imagePrompt: raw.imagePrompt,
|
||||
confirmed: false,
|
||||
|
||||
Reference in New Issue
Block a user