It inspired me to build something similar, but instead of using the Pi as a security camera, I wanted to do some outdoor time-lapse photography. Here is an animated GIF that the Pi produced. I'm working on longer and higher resolution versions.
And here is the device itself, the "Lapse-Pi":
I used the following hardware to build it:1. Microsoft Lifecam Show 2.0MP - $13 from NCIX
2. Power Bank 12000mAh External Battery Charger USB - $25 from eBay
3. Ultra Mini USB Wireless LAN Adapter 802.11n - $7 from Monoprice.com
4. Lego Bricks, Raspberry Pi, SD Card etc.
Below is a close-up of the battery. I've let my Raspberry Pi idle on it for around 24 hours before the juice runs out.
I've had lots of trouble getting webcams working on Linux, fortunately, the Microsoft Lifecam Show 2.0MP is UVC compatible. It was basically plug and play. I highly recommend getting a UVC compatible webcam. It will be almost guaranteed to work with your Raspberry Pi. See the Linux UVC driver webpage for compatible webcams.
On the software side I am using:1. Official Raspbian Wheezy Image, "2012-07-15-wheezy-raspbian.zip"
3. Imagemagick Convert
Step by step instructions:1. Install Streamer and SSHFS
sudo apt-get install streamer
sudo apt-get install sshfs
2. Mount your network share to store the time lapse images wirelessly. I use SSHFS, however you can use SAMBA, NFS, or whatever else you want.
sshfs username@server:/home/username /home/pi/server_mount
3. Run streamer to capture the frames.
mkdir -p server_mount/timelapse
streamer -o 0000.jpeg -s 352x248 -j 100 -t 00:20:00 -r 0.1 -c /dev/video0
Some notes on the command line parameters:
- "-o 0000.jpeg" specifies the filename format for the individual frames
- "-s 352x248" specifies the resolution. I think the Pi can handle much higher than this.
- "-j 100" is the JPEG quality"
- "-t 00:20:00" instructs it to capture for 20 minutes
- "-r 0.1" indicates the frame rate of 0.1 frames/second
- "-c /dev/video0" specifies the video device. It should be the same for you.
4. On the server, convert the captured frames to an animated GIF using Imagemagick's "convert" utility
convert -delay 5 *.jpeg -loop 0 animated.gif
Future Plans:I have recently purchased a 4.5V OCV / 450mA SCC solar panel from eBay for about $20. I am in the process of figuring out how to charge the battery with it. If that happens then I can take time-lapses over multiple weeks and months rather than just 1 day.
I also will be trying higher resolution time-lapses. The Lifecam Show is capable of 2MP or 1600x1200. And hopefully in October the official Raspberry Pi camera module will come out that will be capable of 5MP or 1080p at 30fps!