How to create a time-lapse video using a webcam.

Simple Time-Lapse
Downloading the vodafone webcam archive
Sample Video
Installing ImageMagick in Cygwin

Simple Time-Lapse

Time-lapse animations have always fascinated me. With a time-lapse you can make things visible to the human eye that are normally happening too slow. The movement of stars in the sky or the process of putting up a house are very interesting to look at when the clock has been accelerated.

Apart form creating time-lapse animations using my own pictures I also found it worthwhile to create them from web-cam images. A webcam near the place I live provides images of quite high resolution. With the little script below, I was able to create this video: Fog over Dornbirn

I found that for videos that include clouds it is ok to take a frame every 5 seconds or so. As I don’t have the time and patience to save the webcam images manually, I created this bash script:

Download the script here: timelapse.sh

Of course you have to replace the url with a meaningful one.

To be able to use the power of bash on my windows machine, I installed cygwin, which creates a linux-like environment, with the ability to use many of the linux command line tools. To be able to use wget you have to manually install it by selecting it from the available packages during the install process.

To create the final movie, I import the images in to picasa, sort the folder by name to make sure they are in the right order, select all of them and click the “Movie” button. Select “time-lapse” for the transition and you are ready to create the video.

Since the start of the eruption of the Eyjafjallajökull volcano, I assembled quite a few time-lapse animations using the vodafone webcam. Some videos were created like the one above, by downloading the current image every few seconds.

Downloading the vodafone webcam archive

But the vodafone webcam has an archive of images for every minute of a given day, that means, you can create such time-lapse animations after the fact, you just have to harvest the folders and download the individual images one-by-one.

As a complication, the images are actually two images stored side-by-side:

To be able to use the image in Picasa you first have to cut in two halves. At first I did that using batch conversion in IrfanView, but in the end I came up with a script that does also the slicing of the image. To be able to do that I had to install ImageMagick in cygwin by selecting it in the cygwin setup.

There was a problem with the installation of ImageMagick, see the instructions below on how to resolve the issue.

This is the bash script that downloads all the images for a given day from the vodafone server. You must provide a day, and you can provide a month and a year, if no month and year are given they are determined based on the current date. The script writes the downloaded images in a folder which is named for the current date. In this folder two sub-folders are created which contain the left and right part of the image, already cropped to the 16:9 aspect ratio necessary for creating HD videos in youtube.

Download the script here: day.sh

Sample Video

This is a video created with the above script:

https://www.youtube.com/watch?v=ZXEAHVkhvj0

ImageMagick installation issues

To install ImageMagick in Cygwin search for the Word ImageMagick in the select packages view and clck on the package to include it in the install.

But when I tried to run a convert command, I got the following error:

After some searching on the web, I found out that some libraries were probably missing, luckily there is a way to check for missing dlls using the command cygcheck:

To fix the issue I had to run the cygwin setup.exe again and install the following libraries:

  • libltdl7
  • libtiff5
  • libgomp1