4-seasons: replace size-rejection with 1MB fast-skip for grey filter

File size can't reliably reject bad frames (200KB can be good or bad).
Remove SEASONS_MIN_FRAME_BYTES.  Instead, the grey/green uniform-colour
filter (SEASONS_GREY_STDDEV_MIN) now skips the expensive ImageMagick
check for files above SEASONS_LARGE_FRAME_BYTES (default 1 MB) since
those are always good.  Only sub-1MB files get the content check, making
the filter practical on days with 40k+ images.

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-23 02:34:26 +00:00
parent a9faa63cd9
commit 98dcf23687
2 changed files with 28 additions and 17 deletions
+10 -5
View File
@@ -256,18 +256,23 @@ ENCODE_PRESET=slow # ffmpeg preset for all encodes (slow/medium/fast)
AUDIO_BITRATE=192k # montage-mvt.sh — music track on movement montages
# ── Frame validation (4-seasons.sh) ──────────────────────────────────────────
# Corrupt or empty frames (e.g. first frame after a camera reconnect) are always
# skipped automatically via ffprobe. No config needed.
# Empty (0-byte) frames are always skipped. No config needed for that.
#
# SEASONS_GREY_STDDEV_MIN / SEASONS_GREY_DARK_FLOOR — optional bad-signal filter.
# Catches uniform-colour frames caused by a bad RTSP signal: solid green, grey, etc.
# These are valid JPEGs but contain no real image content.
# Uncomment both lines to enable. A frame is dropped only when BOTH are true:
# 1. pixel standard deviation (0255) < SEASONS_GREY_STDDEV_MIN (frame is uniform)
# 2. mean brightness (0255) > SEASONS_GREY_DARK_FLOOR (frame is not dark)
# This keeps genuine night frames (dark + low variation) while dropping
# solid-grey bad-signal frames (mid-bright + no variation).
# Night frames are dark so they always pass even if stddev is low.
# Requires ImageMagick (convert). Start with these values and tune from there:
#SEASONS_GREY_STDDEV_MIN=5 # skip if stdev < 5 (very uniform)
#SEASONS_GREY_STDDEV_MIN=5 # skip if stdev < 5 (very uniform colour)
#SEASONS_GREY_DARK_FLOOR=30 # …but only if mean brightness > 30 (not a night frame)
#
# Performance: ImageMagick is only called on files below SEASONS_LARGE_FRAME_BYTES.
# Files above that threshold are always good and skip the check entirely.
# Default 1 MB — adjust if your camera produces larger bad-signal frames.
#SEASONS_LARGE_FRAME_BYTES=1048576
# ── Montage attribution overlay ───────────────────────────────────────────────
# A translucent bar across the top of each movement montage, naming the