Fix cutter compare fallback for single-shot matches

This commit is contained in:
Melbar
2026-05-08 13:18:56 +02:00
parent 5407f08fbc
commit 4eeecca80d
2 changed files with 13 additions and 1 deletions
Binary file not shown.
+13 -1
View File
@@ -463,9 +463,21 @@ def collect_rows(
# Frame-locked compare video # Frame-locked compare video
cmp4 = clips_dir / f"beat_{bid:02d}_compare.mp4" cmp4 = clips_dir / f"beat_{bid:02d}_compare.mp4"
compare_segs = segs
if not compare_segs:
seg_dur = max(0.04, min(beat_dur, rec["out_point_s"] - rec["in_point_s"]))
compare_segs = [{
"trailer_offset_s": 0.0,
"duration_s": seg_dur,
"scene_id": rec.get("scene_id"),
"in_point_s": rec["in_point_s"],
"out_point_s": rec["in_point_s"] + seg_dur,
"match_score": rec.get("match_score", 0.0),
"is_confirmed": rec.get("is_confirmed", False),
}]
if build_compare_clip( if build_compare_clip(
trailer_path, beat["start_s"], beat_dur, trailer_path, beat["start_s"], beat_dur,
source_path, segs if num_segs >= 1 else [], source_path, compare_segs,
cmp4, cmp4,
): ):
compare_clip = cmp4 compare_clip = cmp4