Creating Time-lapse Videos with Mencoder

Creating Time-lapse Videos with Mencoder

Time-lapse videos have grown in popularity as a direct result of their unusual perspective on the world and the success of digital stills cameras. Here's my low cost route to creating them.

A photo captures a single image over a period of time, whilst a video captures multiple images typically in real time at 30 fps. The obvious ways of playing with time in video are to either slow down motion (high speed video) or speed up motion (time-lapse video). It's the latter that has seen a renaissance in recent years that are no better exemplified than by the work of photographers such as Mike Oblinski's stunning storm chasing or Dave Hunt’s wonderfully evocative scenery of Ireland (below). However, the sumptuously ground breaking work of Ron Fricke in Samsara is a must see if you haven't come across it.

Whilst these photographers may have pushed the boundaries of time-lapse videography, it is a technique that is easily within reach of just about anyone with a camera.

Planning Your Video

The first step is to work out what you want to capture, how long the event will last, the time interval between images and the speed of the video. For example, whilst on holiday in St Malo, France, I noticed the apartment I was staying in was opposite the ferry terminal and ideally situated to photograph the cruise ship docking. First sighting to final docking lasted about 30 minutes. The time interval needs to be fast enough to capture any motion in sufficient detail to prevent jittery video, whilst the speed of the video (in frames per second) will determine video length. These last two require a little experimentation in order to get settings that work well visually.

For the ferry docking below, I shot at 30s intervals over 25 minutes giving a total of 50 frames. At 3fps, this gave a 6s video. It would have benefitted from a reduced interval to give a better sense of movement, but was good as a first approximation.

I've also used a GoPro for a wedding reception which continually captured at 3s intervals before they were switched off at the end of the night. What's great about this style of wedding video is that it compresses time and you can see the entire events of an evening in a matter of minutes. A great memory.

Shooting Your Video

Ideally, you want to be able to automate the regular capture of images. Many cameras have a built-in intervalometer which requires you to set the number of images and interval between them. If your camera doesn't have such a feature, then you might be able to use an external control (like this one) or, failing that, use a standard wired remote, a watch and your finger!

It's important that your camera is in manual mode so that any variations in exposure are a direct result of illumination in the actual scene and not the camera trying to maintain a well exposed image.

Processing Your Images

At this point, I bring the images into Lightroom and select the frames I'm interested in. I post-process the first image and then apply the same settings to the remaining images. Once complete they are exported at the desired the resolution.

For the conversion of the images to a video, I use the open source, command line, Mencoder. My initial command is:

mencoder "mf://@photos.txt" -mf fps=6 -o timelapse_video.avi -ovc lavc -lavcopts vcodec=mjpeg:vbitrate=1600 vqmin=3

This specifies JPGs listed in a file called photos.txt, at a frame rate of 6fps, gives it a filename and specifies the MJPEG video format with some quality settings. MJPEG is the simplest of video formats possible as it stacks each and every JPEG in a single file. This makes it a great input format to websites such as YouTube or for transcoding to products like DVDs. I've found YouTube particularly effective at conversion to online content for sharing.

If you are using the command line on Windows to produce the photos.txt file, then you can automatically create a sequential filename list with the following command:

dir /a-d /b /on > photos.txt

This is my open source route to time-lapse creation. It gives a great deal of flexibility in how you process your images and then turn them into the video itself. A good example of this is the wedding video above where, prior to using Mencoder, I added text information including the time, to the output images. More on this in a follow-up post.

Do you have any preferred methods for creating your own videos? Any tips for shooting them? Or links to your favorite?

Log in or register to post comments

2 Comments

Rob Davis's picture

It's nice to see someone keeping up the awareness of these excellent command line tools. I often find ImageMagick and DCRaw incredibly useful for certain tasks.

Ok, nothing wrong with the theory but I would call watching pictures at 3fps a ‘speedy slide show’ (which is really uncomfortable to watch, I wonder how often- or if at all, Joe an Liv say: “lets watch our wedding time lapse...”) a timelapse, in order for it to be at least close to smooth motion, you’d need at the very least 15 fps, or best if at least 23.976...