Timelapse movie with Raspberry Pi and fswebcam

I’ve been playing with my Raspberry Pi to make a Timelapse movie using a webcam.

I use fswebcam to operate the webcam. It is simple and has many options.

Because I used a 2GB  SD card, I saved the frames to a NFS share, it is also possible to save the frames to this SD card directly if there is sufficient space.

Prerequisites

Raspberry Pi for Timelapse movie

The Raspberry Pi and its webcam

Hardware required:

  • Raspberry Pi
  • 2GB SD card
  • NFS share
  • Microsoft LiveCam HD 3000

For the software, a fresh Raspbian is enough. Default user is:

  • Usename: pi
  • Password: raspberry

Install packages

sudo apt-get update
sudo apt-get install fswebcam

Mounting the NFS share

In the shell:

sudo mount -o nolock nas.lan:/share/Temporary /mnt

Create a configuration file

In /mnt/fswebcam.conf

device /dev/video0 
resolution 1280x720 
no-banner 
jpeg 90 
loop 5
background
save /mnt/last.jpg
delay 1
skip 30

Note that the frames can be inconstant due to the time for the sensor to adjust to the conditions. Increasing the number of skipped frame (skip) can solve this problem.

Create a script to rename the frames

In /mnt/rename.sh

#!/bin/sh
DATE=`date +%s`.jpg
mv /mnt/last.jpg /mnt/$DATE

Make the script executable:

chmod +x /mnt/rename.sh

Run the capture

Start the capture (in background with as specified in the configration file)

fswebcam -c /mnt/fswebcam.conf --exec /mnt/rename.sh

Stop the capture

killall fswebcam

Assemble the frames into a movie

I use Photolapse to assemble the frames, it’s a simple freeware that gets the job done quickly!

PhotoLapse3
And the result, one evening in Beijing:

Leave a Reply