janhaa / simple-timelapse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simple-timelapse

Call as simple-timelapse.sh 1m to take an image every 1 minute.

You can use any duration format supported by sleep.

dependencies

  • ffmpeg

code

cam="GENERAL WEBCAM"

mkdir images
cd images
for (( ; ; ))
do
    date=$(date +%s)
    ffmpeg -f dshow -i "video=$cam" -frames:v 30 "img-$date-%d.jpg"
    for i in {1..29}
    do
        rm -f "img-$date-$i.jpg"
    done
    sleep $1
done
cd ..

About


Languages

Language:Shell 100.0%