feat(video-pipeline): 增强参考图自动上传与视频生成重试机制
- 在 `init-manifest` 阶段添加输入文件清理日志和 WARNING 提示 - `getReferences` 改为异步并自动将本地参考图上传至 OSS,减少手动操作 - `phase-videos` 支持 `pending`/`failed` 状态 item 的自动重试,自动清理旧视频引用 - 优化 `phase-assemble` 中字幕与配音开关的逻辑,根据实际内容动态判断
This commit is contained in:
@@ -17,9 +17,28 @@ async function phaseVideos(manifest, manifestPath, options) {
|
||||
const accountConfig = options.accountConfig || {}
|
||||
const videoModel = manifest.videoModel || accountConfig.videoModel || 'veo3-fast-frames'
|
||||
|
||||
const items = manifest.items.filter(it =>
|
||||
it.status === 'done' && it.confirmed !== false && it.url && it.videoPrompt && !it.video
|
||||
)
|
||||
// 筛选需要生视频的 item:
|
||||
// done — 正常流程,图片已确认且已上传
|
||||
// pending / failed — 重试场景,agent 只需将 item 设为 pending 即可触发再生
|
||||
// 前提:有 url(图片已上传)+ videoPrompt,且 confirmed 未被显式拒绝
|
||||
const videoCandidates = manifest.items.filter(it => {
|
||||
if (it.confirmed === false) return false
|
||||
if (!it.url || !it.videoPrompt) return false
|
||||
if (['done', 'pending', 'failed'].includes(it.status)) return true
|
||||
return false
|
||||
})
|
||||
// 对重试 item 自动清理旧视频引用,无需 agent 手动删除
|
||||
const items = []
|
||||
for (const it of videoCandidates) {
|
||||
if (it.video) {
|
||||
if (it.status === 'done') continue // 已有视频且完成,跳过
|
||||
delete it.video // pending/failed 但有旧 video → 清理重来
|
||||
delete it.videoUrl
|
||||
delete it.videoDuration
|
||||
delete it.videoTaskId
|
||||
}
|
||||
items.push(it)
|
||||
}
|
||||
if (items.length === 0) { log('videos', '无待处理 item,跳过'); return }
|
||||
|
||||
// 选择生成器
|
||||
|
||||
Reference in New Issue
Block a user