From 8b79261b8171339cb27003c7a378f3bd4c21d8de Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 16:32:47 +0000 Subject: [PATCH 1/2] =?UTF-8?q?4-seasons:=20remove=20fps=3D25=20from=20spe?= =?UTF-8?q?ed-adjust=20=E2=80=94=20keep=20all=20source=20frames?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fps=25 caused ffmpeg to discard 15 of every 16 source frames, making the final clip jump by ~2.5 minutes per frame. The original script had no fps filter, so all source frames were preserved. Without it, the setpts speed-adjust keeps every frame; the effective framerate in the output rises proportionally (e.g. ~400fps for a full day at 10s intervals into an 11s clip), which is fine for H.264 and all downstream montage steps. https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ --- 4-seasons.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/4-seasons.sh b/4-seasons.sh index 484ac2f..49c539a 100755 --- a/4-seasons.sh +++ b/4-seasons.sh @@ -153,7 +153,7 @@ echo "Step 2/2: speed factor $speed_factor..." final_file="$output_dir/${CAM_NAME}-${yesterday}_Mvt${MVT_NUM}-Day${DAY_OF_MVT}of${DAYS_IN_MVT}-final.mp4" if ! ffmpeg -loglevel warning \ -i "$temp_video" \ - -vf "setpts=PTS/$speed_factor,fps=25" \ + -vf "setpts=PTS/$speed_factor" \ -c:v libx264 -pix_fmt yuv420p -preset "$ENCODE_PRESET" -crf "$CRF_SEASONS_FINAL" \ -t "$target_per_clip" -an \ -y "$final_file"; then From 32bd64459e5d48d440345b8d74a2111cb1d764bf Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Apr 2026 16:58:16 +0000 Subject: [PATCH 2/2] 4-seasons: exit cleanly when all frames fail validation Accessing ${images[-1]} on an empty array under set -u causes a bash error. Guard with an explicit check so a fully-corrupt image directory exits with a clear message instead of a cryptic crash. https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ --- 4-seasons.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/4-seasons.sh b/4-seasons.sh index 49c539a..f480596 100755 --- a/4-seasons.sh +++ b/4-seasons.sh @@ -123,6 +123,11 @@ done [ "$bad" -gt 0 ] && echo "WARNING: skipped $bad corrupt/empty frame(s) of ${#all_images[@]}" [ "$grey" -gt 0 ] && echo "INFO: skipped $grey grey/uniform frame(s) (SEASONS_GREY_STDDEV_MIN=${GREY_MIN})" +if [ "${#images[@]}" -eq 0 ]; then + echo "ERROR: no valid images remain after filtering — skipping $yesterday." + exit 0 +fi + for img in "${images[@]}"; do printf "file '%s'\nduration %s\n" "$img" "$INTERVAL" done > "$temp_file"