From 0c2201fab5e192e922891bd4983e6d88d6277317 Mon Sep 17 00:00:00 2001 From: tcpsyn Date: Thu, 12 Mar 2026 19:22:03 -0600 Subject: [PATCH] Fix Remotion render error reporting and harden clip timestamps - Show full stderr (head + tail) instead of truncating to last 500 chars - Add --timeout=60000 and --log=verbose to Remotion render command - Clamp word timestamps to [0, duration] to prevent negative/OOB values Co-Authored-By: Claude Opus 4.6 --- make_clips.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/make_clips.py b/make_clips.py index 4292b2a..4b4caea 100755 --- a/make_clips.py +++ b/make_clips.py @@ -1194,10 +1194,14 @@ def generate_clip_video_remotion( for line in caption_lines: remotion_words = [] for w in line["words"]: + w_start = max(0, round(w["start"] - clip_start, 3)) + w_end = min(round(duration, 3), round(w["end"] - clip_start, 3)) + if w_end <= w_start: + w_end = w_start + 0.1 remotion_words.append({ "word": w["word"].strip(), - "start": round(w["start"] - clip_start, 3), - "end": round(w["end"] - clip_start, 3), + "start": w_start, + "end": w_end, }) remotion_lines.append({ "start": round(line["start"], 3), @@ -1226,6 +1230,8 @@ def generate_clip_video_remotion( "npx", "remotion", "render", "src/index.ts", "PodcastClipDemo", f"--props={props_path}", + "--timeout=60000", + "--log=verbose", output_path, ] @@ -1233,7 +1239,13 @@ def generate_clip_video_remotion( props_path.unlink(missing_ok=True) if result.returncode != 0: - print(f" Remotion error: {result.stderr[-500:]}") + stderr = result.stderr + # Show head (error message) and tail (stack trace) of stderr + if len(stderr) > 1000: + print(f" Remotion error (first 500 chars): {stderr[:500]}") + print(f" ... (last 500 chars): {stderr[-500:]}") + else: + print(f" Remotion error: {stderr}") return False return True