Sunday, January 24, 2010

Timelapse Video: Mountain View Rainstorm 2009-01-19

Updated with more technical details.

My current office in Mountain View is on the 4th floor and has a wonderful view, even better than the previous building. One never knows how long these blessings will endure, and I've been itching to do some long-term timelapse out the window. Finally, starting in December, I got something going and have been capturing the view out my window almost every day.

Today I'm posting the first video from the project. I chose January 19th because of its interesting weather. I hope you enjoy it.

Hint: Click the "full screen" button on the viewer. This is the widescreen version of the video. I have also posted a copy with the original 4:3 aspect ratio.

Technical Notes

For a long-term timelapse project it is essential to use a camera that supports remote capture. I wanted to dedicate a good quality point-and-shoot camera to it rather than my usual practice of using a DSLR -- the mirror/shutter action is way too loud.

At first I thought I could use my Canon SD1100IS, but surprisingly it doesn't do remote capture. Turns out Canon has been phasing this feature out of their point-and-shoot cameras and I would have to go back to an older model. I finally purchased a used Canon SX110 on eBay (the newer SX120 won't work).


There are 8,723 individual still images, each of them 1600x1200 JPEG (4:3 aspect ratio) taken every 3 seconds over 8 hours, 25 minutes. The main considerations for processing them into a video are (a) how long a video do we want and (b) what aspect ratio will we present it at.

How Long?

Typical American video runs at 30 frames per second ("29.970"), the NTSC standard TV frame rate. At 30 fps our 8,723 images will run for 291 seconds, or 4:51. That's too long -- I think the video needs to run in around two minutes or else people will get bored. There are a variety of ways to speed things up, depending on your editing tools and your quality goals. I'll say a little more about this below.

What Aspect Ratio?

The original images are 4:3, which is fine for standard video but problematic for HD. Normal HD videos are 16:9. An HD-quality 4:3 video will look fine in, say, Quicktime but on YouTube it will have black bars on the sides.

The version shown above is 16:9. I originally posted the 4:3 version to YouTube but quickly decided it would look better in 16:9.

If I want to get rid of the black bars my alternatives are either to crop or to stretch. In this case I don't want to crop -- there's nothing in the frame I want to lose. On the other hand, the nature of the scene is such that I thought such stretching may not be noticeable.

Preserving Quality

One aspect of preserving quality is to avoid losing information during processing. There are two things that can easily get lost: you can lose frames and you can lose pixels.

Pixels -- It would be very natural to convert the 1600x1200 images into a 1440x1080 HD video stream, preserving the aspect ratio. But if you now decide to stretch it to 1920x1080 HD, you will have lost information in the horizontal dimension. So if that's a consideration it's better to keep the 1600x1200 format for as long as possible (even though it will slow your processing). Then you can resample this full-resolution video into whatever you want.

Frames -- Video editors slow to a crawl when manipulating 8,000 still images and the solution is to prerender them to video. In one version of this video I rendered them at 30fps, giving me a 4:50 video clip. Then I set my editor to playback at 2x normal speed. I thought that would be fine since all the frames are still there, but that's not how it works. Doubling the playback speed works by throwing away half the frames. Most of the time you don't notice, but when one slows the playback velocity during editing the video gets choppy. The solution, at least with my editor, is to prerender at 60fps so I can defer the decision on when to drop frames.

Pre-Render with QuickTime

My video editor (Sony Vegas) is quite capable of importing still image sequences, but doesn't handle more than a thousand of them very well.  I've found that it's much faster and way more convenient to use Apple QuickTime (Pro) to  prerender the images into a full-resolution video.  Then just add the video as a track in the editor.

  • You must buy QuickTime Pro.  The free version won't do this.
  • From the File menu click "Open Image Sequence".  Then select just the first frame of your sequence.  It will automatically load the rest.
  • Be sure to select "60 frames per second".

Editing With Sony Vegas

Besides prerendering with QuickTime, there are a other things that took me some trial and error to figure out in the editing process with Sony Vegas.  If you want to do a widescreen (stretched) video:
  • Set your project properties to 1920x1080 and 60 (59.9...) fps.
  • After you add the QT video to a track, set its properties and uncheck "Maintain aspect ratio".  This allows the 4:3 camera frame to stretch to fill the 16:9 HD frame.  

Rendering the Results

I'm no expert on rendering but these are the best settings I've found so far to render a reasonably sized file that is usable both on YouTube and on the computer.  I used the Sony AVC codec with a custom template I call "YouTube 1920x1080".  I started with the default settings and made these changes:
  • Video rendering quality: Best
  • Frame size: "High definition (1920x1080)"
  • Frame rate: 29.970 (NTSC)
  • Pixel aspect ratio: 1.0
  • Video Bit rate (bps): 4,000,000 (i.e. 4 Mbps)
  • Audio sample rate: 44,100 (all my source material is sampled at 44.1)
The result is an MP4 file of about 80 MBytes that works fine as an upload for YouTube HD and also looks good on my computer.

How about you? Leave a comment, let me know what you've been doing to create Time-Lapse videos from still photos.

No comments: