script:
#!/bin/bash
filename=$(perl -e «print time»)
foldername=$(date —rfc-3339=date)
curl «http://127.0.0.1:8080/?action=snapshot» > $filename
timestamp=stat -c %y $filename
if ! [ -d/path/to/dir/$foldername ]; then
mkdir /path/to/dir/$foldername
fi
### timestamp
convert $filename -fill black -fill white -pointsize 15 -draw «text 5,15 ‘${timestamp:0:19}'»/path/to/dir/$foldername/$filename.jpg
###
rm $filename
add to crontab:
*/1 * * * * /snapshot.sh >/dev/null 2>&1
Convert to videofile:
ffmpeg -framerate 10 -pattern_type glob -i «*.jpg» out.mkv