diff --git a/4-seasons.sh b/4-seasons.sh index 484ac2f..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" @@ -153,7 +158,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