Time Lapse Videos in Linux

I love watching time lapse videos.  Some time ago I discovered http://timescapes.org and enjoy watching some of the amazing work they have done.  It has even motivated me to do some experimenting with making my own time lapse videos.

So far the best information I have found on creating time lapse videos in linux are http://ubuntuforums.org/showthread.php?t=2022316 and http://ultrawide.wordpress.com/2009/01/27/timelapse-photography-on-linux/.  CyberAngel’s post on ubuntuforums is really awesome because he was kind enough to release his deflickering script.

So, in way of testing everything, I setup my tripod at the edge of our office, set my camera into manual mode, setup my intervalometer, and took 512 JPG images.

I copied these images off my CF card onto my computer and decided I wanted to encode them to an H.264 video.  This lead me to following the instructions at https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide so that I could get an H.264 compatible ffmpeg.

After I had my ffmpeg working, I following CyberAngel’s advice and ran:

cd source_folder_of_pictures
mkdir resized
mogrify -path resized -resize 800x533 *.jpg
cd resized

I also ran CyberAngel’s script (which I have mirrored here) to deflicker the images.

Unfortunately I didn’t have good luck with the mencoder command, so I ended up running:

ffmpeg -start_number 1055 -start_number_range 512 -f image2 -i IMG_%d.JPG -vcodec libx264 -vf "scale=iw:trunc(ih/2)*2" -r 30 video.avi

instead.  My jpeg images started at IMG_1055.JPG and ran up to IMG_1568.JPG, hence the start_number and start_number_range.  If I didn’t include the scale option to vf I got an irritating error “height not divisible by 2 (800×533)”.

Without further ado, here is the result:

Not too bad.  Now I just need to snap some pictures of something more useful.  Maybe if this weekend is nice I will get to make time lapse videos of the sky instead of the dog!