i hate weather

This commit is contained in:
legop3
2026-04-29 15:15:15 -04:00
parent fcfcdc907a
commit ef5c6fab89
5 changed files with 50 additions and 0 deletions
+4
View File
@@ -41,3 +41,7 @@ paths:
all:
source: publisher
sourceOnDemand: no
# Rover Snapshot Writer
# Keep rover snapshots continuously updated while a rover video path is live.
runOnReady: /usr/local/bin/rover-snapshot-writer.sh
runOnReadyRestart: yes
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Rover Snapshot Writer Hook
# Purpose: Runs under mediaMTX runOnReady to keep per-rover JPEG snapshots updated on disk.
# Scope: Writes only rover video path snapshots and ignores audio/forward/room paths.
set -euo pipefail
PATH_NAME="${MTX_PATH:-}"
SNAP_DIR="${ROVER_SNAPSHOT_DIR:-/var/lib/rover-snapshots}"
# Ignore non-rover-video paths.
case "$PATH_NAME" in
""|*-audio|*-fwd|room/*)
exit 0
;;
esac
mkdir -p "$SNAP_DIR"
exec ffmpeg -hide_banner -loglevel warning \
-i "srt://127.0.0.1:9000?streamid=read:${PATH_NAME}" \
-an \
-vf fps=2 \
-q:v 6 \
-update 1 \
"${SNAP_DIR}/${PATH_NAME}.jpg"