Browse Source

add documentation

develop
Simon Vieille 1 month ago
parent
commit
6346a85629
Signed by: deblan <simon@deblan.fr> GPG Key ID: 03383D15A1D31745
1 changed files with 6 additions and 7 deletions
  1. +6
    -7
      README.md

+ 6
- 7
README.md 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
```

Loading…
Cancel
Save