From ef43c282c7830e398af48da76a17bfb2fd48b96b Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Sat, 18 Jul 2026 04:39:15 +0200 Subject: [PATCH] fix(reframe): lower SCENE_MIN_SEC default 1.0s -> 0.4s A/B audit on 10 topic-diverse clips showed the 1s merge deleted real sub-second shots in fast-cut content (10/13 lost real cuts in gaming, 9/10 in anime, 5/8 in music videos were present in the raw TransNetV2 output and removed by the merge). 0.4s still kills flash/single-frame scenes and snap bursts without eating real fast cuts. --- scene_detection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene_detection.py b/scene_detection.py index e7de575..e584376 100644 --- a/scene_detection.py +++ b/scene_detection.py @@ -13,7 +13,7 @@ case can never kill a job. Environment variables: SCENE_ENGINE "transnetv2" (default) | "pyscenedetect" (legacy) SCENE_MIN_SEC minimum scene length in seconds; shorter scenes are - merged into a neighbor (default 1.0, TransNetV2 path + merged into a neighbor (default 0.4, TransNetV2 path only — the legacy path stays untouched) TRANSNETV2_THRESHOLD shot-boundary probability threshold (default 0.5) TRANSNETV2_DEVICE torch device: "auto" (default) | "cpu" | "cuda" | "mps" @@ -119,7 +119,7 @@ def _detect_transnetv2(video_path): if total_frames > bounds[-1][1]: bounds[-1] = (bounds[-1][0], total_frames) - min_sec = float(os.environ.get("SCENE_MIN_SEC", "1.0")) + min_sec = float(os.environ.get("SCENE_MIN_SEC", "0.4")) bounds = _merge_short_scenes(bounds, fps, min_sec) scene_list = [(FrameTimecode(s, fps), FrameTimecode(e, fps))