Encoding: H.265 final montages, slow preset, sunrise retention

- sky-cam.conf: add ENCODE_PRESET=slow (applied to all encodes);
  split CRF_MONTAGE (intermediates, H.264) from CRF_MONTAGE_FINAL=22
  (archive montage, H.265); add SUNRISE_RETENTION_DAYS=10; improve
  CAPTURE_INTERVAL comment with storage/density table
- montage-mvt.sh: steps 1+2 use preset; step 3 final switches to
  libx265 + CRF_MONTAGE_FINAL + -tag:v hvc1 for broad compatibility
- 4-seasons.sh: both encode steps use ENCODE_PRESET
- daily_sunrise_video.sh: all encode steps use ENCODE_PRESET; rolling
  retention deletes sunrise videos older than SUNRISE_RETENTION_DAYS

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-20 17:27:57 +00:00
parent ab06c1cc2b
commit a395f9baba
4 changed files with 42 additions and 20 deletions
+23 -12
View File
@@ -217,20 +217,28 @@ SUNRISE_TARGET_SECS=10
SUNRISE_OVERLAY_ENABLED=true
# Opacity of the sunrise-time text (0.0 = invisible, 1.0 = fully opaque).
SUNRISE_OVERLAY_OPACITY=0.45
# Delete daily sunrise videos older than this many days (rolling window).
# Set 0 to keep forever.
SUNRISE_RETENTION_DAYS=10
# ── Video encoding quality ────────────────────────────────────────────────────
# FFmpeg CRF: lower = higher quality / larger files. Typical range 1830.
# 18 ≈ visually lossless 23 = ffmpeg default 28 = smaller/lower
# Different scripts use different defaults by design — intermediate/draft
# encodings use a higher CRF (smaller files, quality less critical), while
# final "polished" outputs use a lower CRF for better quality.
# Each is independent — changing one does NOT change the others.
# H.265 (libx265) CRF is not directly comparable — H.265 CRF 22 ≈ H.264 CRF 26
# in visual quality but ~40-50% smaller file. Final montages use H.265;
# intermediates (deleted after use) stay H.264.
#
CRF_SUNRISE=28 # daily_sunrise_video.sh — daily Mattermost upload
CRF_SEASONS_RAW=28 # 4-seasons.sh — raw concat before speed-adjust
CRF_SEASONS_FINAL=26 # 4-seasons.sh — final daily clip (goes into montage)
CRF_MONTAGE=26 # montage-mvt.sh — concat and speed-adjust and final
AUDIO_BITRATE=192k # montage-mvt.sh — music track on movement montages
# ENCODE_PRESET: slow = better compression, same CRF quality, ~2× encode time.
# Use 'medium' on slower machines, 'slow' or 'slower' on fast ones.
# All encodes run at night so 'slow' is the right default.
#
CRF_SUNRISE=28 # daily_sunrise_video.sh — daily Mattermost upload (H.264)
CRF_SEASONS_RAW=28 # 4-seasons.sh — raw concat before speed-adjust (H.264)
CRF_SEASONS_FINAL=26 # 4-seasons.sh — final daily clip (goes into montage) (H.264)
CRF_MONTAGE=28 # montage-mvt.sh — intermediate concat + sped steps (H.264)
CRF_MONTAGE_FINAL=22 # montage-mvt.sh — final archive montage (H.265)
ENCODE_PRESET=slow # ffmpeg preset for all encodes (slow/medium/fast)
AUDIO_BITRATE=192k # montage-mvt.sh — music track on movement montages
# ── Montage attribution overlay ───────────────────────────────────────────────
# A translucent bar across the top of each movement montage, naming the
@@ -254,12 +262,15 @@ MONTAGE_ATTR_FADE=1 # attribution fade-in and fade-out length (seconds)
# CAM_RTSP_<cam> goes in .env (see bottom of this file), not here.
# Seconds between captured frames (applies to all cameras).
# 10 = one frame every 10 s → 8640 frames/day → good timelapse density.
# Lower = smoother timelapse + larger storage footprint:
# 10 s → 8,640 frames/day ~2.5 GB/day (default, good balance)
# 5 s → 17,280 frames/day ~5 GB/day (smoother motion)
# 2 s → 43,200 frames/day ~12 GB/day (very smooth, high storage)
# CAPTURE_STALE_SECS should always be at least 2× CAPTURE_INTERVAL.
CAPTURE_INTERVAL=10
# Seconds without a new frame before the watchdog sends a stall notification.
# Should be at least 2× CAPTURE_INTERVAL. A recovery notification fires
# automatically when frames start arriving again.
# A recovery notification fires automatically when capture resumes.
CAPTURE_STALE_SECS=30
# ── Sunrise audio capture ──────────────────────────────────────────────────────