add documentation

This commit is contained in:
Simon Vieille 2020-04-24 11:11:04 +02:00
parent f322e40d88
commit 6346a85629
Signed by: deblan
GPG Key ID: 03383D15A1D31745
1 changed files with 6 additions and 7 deletions

View File

@ -65,15 +65,14 @@ Voici le script qui réalise la copie depuis le serveur de l'application web :
SNAPSHOTS_DIRECTORY="$HOME/web/motion/snapshots/"
rsync -avz --exclude lastsnap.jpg pi@terrarium:/var/lib/motioneye/Camera1/ "$SNAPSHOTS_DIRECTORY"
rsync -avz --exclude lastsnap.jpg $1 --delete pi@terrarium:/var/lib/motioneye/Camera1/ "$SNAPSHOTS_DIRECTORY"
for PARENT in "$SNAPSHOTS_DIRECTORY"*; do
for MOVIE in "$PARENT"/*.mp4; do
THUMB="$(echo "$MOVIE" | sed 's/.mp4/.jpg/')"
for MOVIE in "$PARENT"/*.mp4; do
THUMB="$(echo "$MOVIE" | sed 's/.mp4/.jpg/')"
MIDDLE=$(ffprobe "$MOVIE" 2>&1 | grep Duration: | egrep -o "[0-9]*:[0-9]*:[0-9]*.[0-9]*" | awk -F ':' '{print ($3+$2*60+$1*3600)/2}')
if [ ! -f "$THUMB" ]; then
ffmpeg -i "$MOVIE" -vcodec mjpeg -vframes 1 -an -f rawvideo -s 300x168 -ss 1 "$THUMB"
fi
done
ffmpeg -i "$MOVIE" -vcodec mjpeg -vframes 1 -an -f rawvideo -s 300x168 -ss $MIDDLE "$THUMB"
done
done
```