I know…I am hilarious and witty. So here it is almost 2 months after the fact, but better late than never. I have been playing with my camera rig making lots of time laps videos and playing with the setup. One thing I haven’t played with much is the script itself.
# To take timelapse photos
mkdir -p $SAVEDIR
echo "Shooting $filename"
fswebcam -r 960×720 $SAVEDIR/$filename
# sleep for 5 seconds
The last 5 lines are repeated a few times after this so the camera will take a picture every 5 seconds. I set the cronjob to run the script every minute….I know I got lazy. I am sure there are much easier ways to set this repeating command to occur. This script runs from 6am until 9pm everyday. At 9:15pm I have a second script that runs and compress’ all of the pictures into a single video for the day. Here is that script
mencoder mf:///Pictures/*.jpg -mf w=800:h=600:fps=15:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o /home/pi/$TD-movie.avi
rm -fr /Pictures/*
The Movie script does delete the pictures from that day, which is nice to keep the SD card clear of any unnecessary files.
One problem I have is keeping correct time on the RPi. This is currently done via the network, when I am at home the Pi will connect to the network and update it’s time. However when I am not near a “known” network it will not update the time, so it will go off the last time it knew about, which is usually a day or two behind. This isn’t normally a big deal, but I am looking to deploy this setup out in the field or in nature to get some nice time lapse nature videos, and it will be important for the videos to be dated properly. I don’t want to add a GPS to the system because I fear that might overload the power requirements. I am currently looking at getting a solar panel and battery to keep this thing very portable/network independent.
Here is a photo of my current setup.
The camera is a Logitech 720p Webcam, battery pack on the bottom, and of course my RPi in the middle with a few bands to keep it all together.