Capture still image on schedule

Forum for questions and support relating to the 1.25.x releases only.
Locked
gmar_87
Posts: 72
Joined: Sat Aug 13, 2011 11:38 pm
Location: Melbourne, Australia

Capture still image on schedule

Post by gmar_87 »

I would like to capture one still image every hour to collate a time lapse video. Is this possible? If yes, how?

I currently have a camera in monitor mode saved as running state "1" and the same camera configured for record mode in running state "2". I have set up a cron job to change between the running states, but the minimum time in between cron jobs is 1 minute. Therefore i end up with a ~50 second event. I could script the change in run states with a short gap between commands and execute the script as a hourly cron job, but i this still creates an event with multiple stills.

I really want to capture a single still. Please help!
koolb
Posts: 14
Joined: Tue Oct 04, 2011 3:30 am

Re: Capture still image on schedule

Post by koolb »

Hi,

I did this with a remote foscam (this as little to do with zm):

crontab -e # enter the following into the file:
# m h dom mon dow command
0,30 * * * * /var/www/src/getsnap.sh > /tmp/cron_getsnap.sh 2>&1



Then create a script file, eg:
cat<<EOF>/var/www/src/getsnap.sh
#!/bin/bash
/usr/bin/wget -q "http://mydomain.com/snapshot.cgi?user=u ... d=password" -O /var/www/src/$(date +"%Y-%m-%d_%H:%M:%S").jpg >> /tmp/getsnap.log 2>&1
EOF
chmod +x /var/www/src/getsnap.sh

Finally to create an avi i just run the following (in a script):
cat<<EOF2>makemjpg.sh
i=0
srcdir=src
dstdir=tmp
[ -d $dstdir ] || mkdir -p $dstdir
for src in $srcdir/*.jpg
do
dstfn=$(printf "%03d.jpg" $i)
dst="$dstdir/$dstfn
echo "src: $src -> $dst"
cp $src $dst
i=$((i + 1))
done
ffmpeg -r 10 -b 4800 -i "$dstdir/%03d.jpg" out.mjpg
rm -f $dstdir/*.jpg
EOF2
chmod +x makemjpeg.sh
Locked