lesavka/scripts/manual/video-frame-fetch.sh
2025-06-28 03:34:48 -05:00

18 lines
595 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
PI_HOST="nikto@192.168.42.253" # user@IPof lesavka
REMOTE_DIR="/tmp" # where eye*-idr.h264 are written
set -eu
WORKDIR="$(mktemp -d)"
echo "⏬ pulling h264 samples from $PI_HOST ..."
scp "${PI_HOST}:${REMOTE_DIR}/eye*.h264" "$WORKDIR/"
echo "🎞️ converting to PNG ..."
for h264 in "$WORKDIR"/eye*.h264; do
png="${h264%.h264}.png"
ffmpeg -loglevel error -y -f h264 -i "$h264" -frames:v 1 "$png"
echo "🖼️ $(basename "$png") ready"
xdg-open "$png" >/dev/null 2>&1 &
done
echo "✅ done - images are opening (directory: $WORKDIR)"