From bc3fe1f9d48e72324fe8e0608d3b7d9017a18de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastjan=20Arti=C4=8D?= Date: Tue, 28 Apr 2026 17:17:11 +0000 Subject: [PATCH] Add explicit FFmpeg trim command logging + duration verification --- scripts/reframe.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/reframe.py b/scripts/reframe.py index 3cf842b..5e9570e 100644 --- a/scripts/reframe.py +++ b/scripts/reframe.py @@ -235,9 +235,20 @@ def main(): if args.duration is not None: cmd += ["-t", str(args.duration)] cmd += ["-c", "copy", tmp.name] - subprocess.run(cmd, check=True, stderr=subprocess.DEVNULL) + print(f"🔧 TRIM CMD: {' '.join(cmd)}", file=sys.stderr) + result = subprocess.run(cmd, capture_output=True, text=True) + if result.returncode != 0: + print(f"❌ TRIM FAILED: {result.stderr[-500:]}", file=sys.stderr) + sys.exit(1) work_input = Path(tmp.name) print(f"✂ Trim → {work_input}") + # Verify trim output duration + verify = subprocess.run( + ["ffprobe", "-v", "error", "-show_entries", "format=duration", + "-of", "default=nw=1:nokey=1", str(work_input)], + capture_output=True, text=True + ) + print(f"🔍 TRIMMED FILE DURATION: {verify.stdout.strip()}s (expected ~{args.duration}s)", file=sys.stderr) info = get_video_info(work_input) print(f"📹 Vhod: {info['width']}x{info['height']} @ {info['fps']:.2f}fps, {info['duration']:.1f}s")