Using a Raspberry PI with a webcam to make time lapse videos.
I have made a bunch of time lapse videos in the past with my Cannon S90 using the CHDK hacked firmware. These videos turn out great and I have very happy with the results. The problem is that I have to leave my expensive camera unattended for hours or days at a time and I am unable to use the camera while it is in use.
A few weeks ago I found a few cheap HD webcams (HP HD-3110 Autofocus 720p 30FPS Widescreen Webcam) on NCIX. These Webcams work with the Raspberry PI and consumes a less power then other webcams I have tested in the past.
I wrote up a little bash script that uses fswebcam to take a picture once every 10 secs and store it on the local disk (SD Card).
Instructions
- Connect to your Raspberry PI via SSH terminal
- Update your Raspberry PI
sudo apt-get update
- Install fswebcam
sudo apt-get install fswebcam
- Test fswebcam. This should take an image from the webcam and store it in your local directory.
fswebcam -d /dev/video0 -l 10 test-fswebcam.jpeg
- Write a script for fswebcam and automate
- Open up a terminal text editor such as nano
sudo nano timelapse.sh
- In the nano editor type the follow script
#!/bin/bash fswebcam -d /dev/video0 -l 10 test-%Y-%m-%d--%H-%M-%S.jpeg
- Use [ctrl]+[x] to save and close this file.
- Open up a terminal text editor such as nano
- Change the scripts permissions to allow for execution
chmod +x timelapse.sh
- Run the script
./timelapse.sh
Leave a comment