Tuesday, January 14, 2014

Using VirtualDub

Ok, so first off, this is total plagiarism. I totally ripped this document off from this site -> http://timelapseblog.com/2009/08/04/using-virtualdub-for-time-lapse/ 

 I use virtualdub for a number of projects including stitching my time lapse stills from my GoPro camera into videos. It's a free software that isn't so intuitive to use, but the above document makes it easy. That doc was written in 2009 and I had fear of losing it so I'm copying the text over here in case it goes away for some reason, and also to make it easy for me to find.  The original doc has some nice screenshots to go with it so I suggest using it so long as it exists.

One nice thing is that once you've been through the document, you can save your settings to use later and it's super easy to just open Virtualdub, load your settings and point it at your folder of stills, and then it spits out your video. But every so often it's good to go back and refresh what you are doing with it.



Bam! Open VirtualDub and you’re immediately hit with one of the most desolate user interfaces around.  There’s no flashy logo or timeline, just a wall of gray.  You’d be forgiven for thinking you made a mistake.  But if you can get past the stark user interface, VirtualDub offers a highly functional and free way to create time-lapse videos.

What is VirtualDub?

VirtualDub is a GNU General Public License video editor.  Basically, it’s an open source piece of software with plenty of free third-party filters available on the web.  For our purposes, it’s also an excellent way to create time-lapse videos.  While my recent post Using Windows Movie Maker for Time-Lapse showed how to make a time-lapse video using software already installed on most PCs, it was a bit of a jury-rigged solution.  VirtualDub is actually intended for time-lapse, among many other things.  The program can be overwhelming in its simplicity so today’s tutorial will stick to the very basics of creating a time lapse-video.

Download VirtualDub

The VirtualDub software can be found at http://virtualdub.sourceforge.net/.  After downloading, install the software onto your computer.


Arranging Your Pictures

Unlike Windows Movie Maker, VirtualDub requires the photos used for a time-lapse be in their own folder and numbered sequentially without gaps between number (i.e. 2,3,4 works but 1,3,5 doesn’t).  The easiest way to do this is to select all files, right click, and choose “Rename.”  It doesn’t matter what the beginning number is as long as the rest follow in order.  If you’re like me and take snapshots as well as time-lapse sequences on the same memory card, make sure you seperate them before proceeding.

Once your photos are separated, go to “File;Open video file…” and select the first photo in the series.  Make sure “Automatically load linked segments” is checked at the bottom of the import window.

VDub open video

You should now see a large, distorted image of your first photo.  Right click and choose 25% viewing size and then resize the window next to it.  The photos might still look distorted because the resizing filter hasn’t yet been applied.  The left window is the input file and the right is the output file.

Frame Rate

The first adjustment we’ll make is to the frame rate.  For Windows Movie Maker, we used a 16fps frame rate because we had to use a trick in order to get a working time-lapse.  While 16fps is usually fast enough to create persistence of motion, 24fps is the movie standard as well as the television standard in North America.  Europe uses just under 30fps 24fps works better, which is why it’s the movie standard.  The American NTSC frame rate is 30fps while European PAL is 25fps (Thanks to Dominic for the correction).

In VirtualDub, go to “Video;Frame rate…” and select “Change frame rate to (fps):”  Change the frame rate to 24 and click “Ok.”  This might be too fast or too slow for you, so play around until you find a rate that works.

Resizing

The photos you imported are probably bigger than the final video you want, so we’ll have to resize the output.

Go to “Video;Filters…” and click “Add.”  Find the “resize” filter and click “Ok.”  Because you’ve already imported your photos, the filter knows the image dimension and aspect ratio.

VDub resize filter

At the top of the window, select “Absolute (pixels).”  The pixel size of a modern HDTV is 1920×1080.  This size is called 1080i or 1080p depending on whether the image is interlaced or progressive scan, but that doesn’t matter at this stage.  What matters is the maximum resolution of a TV screen is 1920×1080 so your video won’t gain anything by being larger than this.

Change the second number of absolute pixels to 1080.  If you shoot in 16:9 ratio, the first number should now read 1920.  If you shoot in the photographic standard 4:3 ratio, the first number should read 1440.  Click “Ok” to close the filter details and then click “Ok” again to close the filter list.

Compression

We’re going to save the final video as an avi. file, so we’ll need to use compression to prevent the video from becoming unwieldy.

Go to “Video;Compression…”  Here you’ll see a list of codecs.  You might have different codecs installed on your system than mine but many people will have the Divx or Xvid codec.  I use the Xvid codec; not for any particular reason.

Preview

Now all the basic settings have been adjusted, you can either render your video or watch a preview.

At the bottom of the screen is a series of small buttons.  The first is a stop button, followed by a play button with a little “I,” and a play button with a little “O.”  These are the input and output play buttons.  Click on the output play button and your video should start rendering in the output window.

VDub preview

Saving Your File

To save, simply select “File;Save as AVI…” and VirtualDub will do the rest.  You can upload this file type directly to websites such as youtube or edit it further in another program.

As I said at the beginning of this post, this is just a basic tutorial meant to get you started without any unnecessary complications.