Fix executable bits and add camera name to 4-seasons notifications

- chmod +x all *.sh and *.py in install.sh so permissions survive git checkouts
- Fix daily_sunrise_video.sh and Python scripts missing executable bit
- Add [CAM_NAME] prefix to all 4-seasons.sh notify.sh calls so multi-camera
  setups show which camera each daily clip came from
- Include camera name in output filename: YYYY-MM-DD_<cam>_MvtN-DayXofY-final.mp4

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-22 12:56:37 +00:00
parent dbdd59677f
commit ae40b898f6
7 changed files with 7 additions and 4 deletions
+4 -4
View File
@@ -106,7 +106,7 @@ echo "Raw duration: $raw_duration s"
speed_factor=$(echo "scale=6; $raw_duration / $target_per_clip" | bc) speed_factor=$(echo "scale=6; $raw_duration / $target_per_clip" | bc)
echo "Step 2/2: speed factor $speed_factor..." echo "Step 2/2: speed factor $speed_factor..."
final_file="$output_dir/${yesterday}_Mvt${MVT_NUM}-Day${DAY_OF_MVT}of${DAYS_IN_MVT}-final.mp4" final_file="$output_dir/${yesterday}_${CAM_NAME}_Mvt${MVT_NUM}-Day${DAY_OF_MVT}of${DAYS_IN_MVT}-final.mp4"
if ! ffmpeg -loglevel warning \ if ! ffmpeg -loglevel warning \
-i "$temp_video" \ -i "$temp_video" \
-vf "setpts=PTS/$speed_factor,fps=25" \ -vf "setpts=PTS/$speed_factor,fps=25" \
@@ -114,7 +114,7 @@ if ! ffmpeg -loglevel warning \
-t "$target_per_clip" -an \ -t "$target_per_clip" -an \
-y "$final_file"; then -y "$final_file"; then
rm -f "$final_file" rm -f "$final_file"
"$SCRIPT_DIR/notify.sh" "FAILED: $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT speed-adjust ($yesterday)" \ "$SCRIPT_DIR/notify.sh" "FAILED: [$CAM_NAME] $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT speed-adjust ($yesterday)" \
"ffmpeg speed-adjust failed — re-run 4-seasons.sh $CAM_NAME while JPGs exist" || true "ffmpeg speed-adjust failed — re-run 4-seasons.sh $CAM_NAME while JPGs exist" || true
exit 1 exit 1
fi fi
@@ -126,11 +126,11 @@ echo "Daily clip: $final_file ($adjusted s)"
drift=$(echo "scale=3; $adjusted - $target_per_clip" | bc | sed 's/^-//') drift=$(echo "scale=3; $adjusted - $target_per_clip" | bc | sed 's/^-//')
if awk "BEGIN{exit !($drift > 0.5)}"; then if awk "BEGIN{exit !($drift > 0.5)}"; then
echo "WARNING: clip duration ${adjusted}s differs from target ${target_per_clip}s by ${drift}s" echo "WARNING: clip duration ${adjusted}s differs from target ${target_per_clip}s by ${drift}s"
"$SCRIPT_DIR/notify.sh" "WARNING: $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT duration drift ($yesterday)" \ "$SCRIPT_DIR/notify.sh" "WARNING: [$CAM_NAME] $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT duration drift ($yesterday)" \
"Clip ${adjusted}s vs target ${target_per_clip}s (drift ${drift}s)" || true "Clip ${adjusted}s vs target ${target_per_clip}s (drift ${drift}s)" || true
fi fi
"$SCRIPT_DIR/notify.sh" "$SEASON Mvt$MVT_NUM Day$DAY_OF_MVT/$DAYS_IN_MVT saved ($yesterday)" \ "$SCRIPT_DIR/notify.sh" "[$CAM_NAME] $SEASON Mvt$MVT_NUM Day$DAY_OF_MVT/$DAYS_IN_MVT saved ($yesterday)" \
"$(basename "$final_file")${adjusted}s" || true "$(basename "$final_file")${adjusted}s" || true
# ── Auto-trigger montage on last day of movement ────────────────────────────── # ── Auto-trigger montage on last day of movement ──────────────────────────────
Regular → Executable
View File
Regular → Executable
View File
+3
View File
@@ -29,6 +29,9 @@ fi
mkdir -p "$UNIT_DIR" mkdir -p "$UNIT_DIR"
echo "Installing systemd units to $UNIT_DIR ..." echo "Installing systemd units to $UNIT_DIR ..."
# ── Ensure all scripts are executable ────────────────────────────────────────
chmod +x "$HERE"/*.sh "$HERE"/*.py 2>/dev/null || true
# ── Pre-create data directories for all cameras ─────────────────────────────── # ── Pre-create data directories for all cameras ───────────────────────────────
echo "Creating data directories..." echo "Creating data directories..."
for cam in "${CAMERAS[@]}"; do for cam in "${CAMERAS[@]}"; do
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File