fix(ai): 过滤黑屏警告卡与 OP/ED 区域;add 的源时间范围必须在已分析片段内

实测 V2 成片前半段:全黑帧、演职员表叠加的片头画面、黑屏警告
提示卡——模型从采样数据里挑到了这些高分垃圾段。

修改:
1. 规划数据过滤黑屏/警告/提示卡/敏感说明等描述(JUNK_CARD)
2. 长素材(>5 分钟)排除前 110 秒 OP 区与最后 120 秒 ED 区,
   短片不受影响
3. 提示词明确:in/out 必须取自片段列表中的 start/end
4. 净化层强制:素材已有分析数据时,add 的 in/out 必须与已分析
   片段相交,否则忽略该操作(防模型编造源时间范围)
5. 新增 OP/ED 区域过滤与范围约束测试
This commit is contained in:
xhgit committed 2026-11-14 20:07:11 +08:00
1 parent c7c963ceaa
commit 3e73b46005
4 files changed
+35 -3

No files matched your search

+5 -1
View File
@@ -93,7 +93,11 @@ export function sanitizeOperations(p,operations){
else if(m.type==='image'){clip.in=0;clip.out=Math.min(clampValue(raw.out,'out')??Math.min(5,60),60);}
else{clip.in=Math.min(clampValue(raw.in,'in')??0,Math.max(0,m.duration-.1));clip.out=Math.min(clampValue(raw.out,'out')??m.duration,m.duration);}
if(!(clip.out>clip.in+.05))return note('忽略 add:出点必须大于入点');
if(track!=='subtitle'){const key=clip.mediaId+'|'+Math.round(clip.in*10)+'|'+Math.round(clip.out*10);if(seenRange.has(key))return note('忽略 add:与现有片段重复使用同一源片段');seenRange.add(key);}
if(track!=='subtitle'){
const scored=(m.analysis?.segments||[]).filter(s=>s.score!=null);
if(scored.length&&!scored.some(s=>clip.in<s.end+.5&&clip.out>s.start-.5))return note('忽略 add:源时间范围不在已分析片段内');
const key=clip.mediaId+'|'+Math.round(clip.in*10)+'|'+Math.round(clip.out*10);if(seenRange.has(key))return note('忽略 add:与现有片段重复使用同一源片段');seenRange.add(key);}
if(raw.text!==undefined)clip.text=cleanText(raw.text);
for(const k of ['fade','brightness','contrast','saturation','fontSize']){const v=clampValue(raw[k],k);if(v!==undefined)clip[k]=v;}
if(raw.color!==undefined){const col=cleanColor(raw.color);if(col)clip.color=col;}