add documentation
This commit is contained in:
parent
f322e40d88
commit
6346a85629
|
@ -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/"
|
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 PARENT in "$SNAPSHOTS_DIRECTORY"*; do
|
||||||
for MOVIE in "$PARENT"/*.mp4; do
|
for MOVIE in "$PARENT"/*.mp4; do
|
||||||
THUMB="$(echo "$MOVIE" | sed 's/.mp4/.jpg/')"
|
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 $MIDDLE "$THUMB"
|
||||||
ffmpeg -i "$MOVIE" -vcodec mjpeg -vframes 1 -an -f rawvideo -s 300x168 -ss 1 "$THUMB"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue