To create timelapse videos as the one in the previous post or this one here are some simple steps:

1. connect the camera (Canon 450d in my case) to the computer and turn it on

2. unmount it if it’s mounted automaticaly

3. run the following script (timelapse.sh) to capture images to the computer:

<pre lang="bash">#!/bin/bash

for i in $(seq 900); do
   no=$(printf "%04d" $i)
   gphoto2 --capture-image-and-download --filename="timelapse-$no.jpg"
   sleep 15s;
done

You can adjust the number of images or the sleep interval.

4. combine the images at 10fps to create time-lapse.avi

<pre lang="bash">
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 -vf scale=1980:1080 -mf type=jpeg:fps=10 mf://*.jpg -o time-lapse.avi

5. experiment & enjoy