Fix one-frame bug; add --test mode to daily_sunrise_video.sh

Root cause: the concat list had no 'duration' entries, so all JPEG
frames collapsed to timestamp 0 and only one frame survived encoding.
Fix: add 'duration CAPTURE_INTERVAL' per entry in both scripts.

Also add fps=25 to the speed-adjust step so the VFR source is resampled
to a standard frame rate — without this, players see ~6fps and may drop
frames to reach the declared rate.

daily_sunrise_video.sh --test [MINUTES]:
  Skips sunrise.py lookup and capture-window wait. Uses the last MINUTES
  minutes of captured frames (default 2). Overlay shows the mid-point
  frame's timestamp. Audio grabbed live from RTSP immediately.
  Output: <date>-daily-sunrise-test.mp4 — no notifications or upload.

  Usage: ./daily_sunrise_video.sh east --test 2

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-21 17:52:29 +00:00
parent 4c02de5fd4
commit 1a1ff1a041
2 changed files with 186 additions and 106 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ echo " Raw: ${raw_dur}s speed: ${speed}x"
echo "Step 2/4: speed-adjust to ${SUNRISE_TARGET_SECS}s..."
ffmpeg -loglevel warning \
-i "$TMP_RAW" \
-vf "setpts=PTS/$speed" \
-vf "setpts=PTS/$speed,fps=25" \
-c:v libx264 -pix_fmt yuv420p -preset "$ENCODE_PRESET" -crf "$CRF_SUNRISE" -an \
-t "$SUNRISE_TARGET_SECS" \
-y "$TMP_SPED"