Using a Raspberry PI with a webcam to make time lapse videos.

1 minute read

64807I 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 

  1. Connect to your Raspberry PI via SSH terminal
  2. Update your Raspberry PI sudo apt-get update 
  3. Install fswebcam sudo apt-get install fswebcam
  4. 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
  5. Write a script for fswebcam and automate
    1. Open up a terminal text editor such as nano sudo nano timelapse.sh
    2. In the nano editor type the follow script #!/bin/bash fswebcam -d /dev/video0 -l 10 test-%Y-%m-%d--%H-%M-%S.jpeg
    3. Use [ctrl]+[x] to save and close this file.
  6. Change the scripts permissions to allow for execution chmod +x timelapse.sh
  7. Run the script ./timelapse.sh

Leave a comment