How to: convert video footage with VirtualDub

How to: convert video footage with VirtualDub
Whether you're converting wedding footage or creating a time-lapse video, there are several reasons to make VirtualDub your friend.

In these days of free, consumer-level video-processing tools such as Windows Movie Maker, it may seem pointless to invest time and effort in learning to use an open-source package such as VirtualDub which, at first glance, appears complex and far from user-friendly.

But when you just want to do a quick editing or transcoding operation, and don't want to wait three days for Windows Live Essentials to download and install, VirtualDub is the perfect alternative. It offers several valuable features that other packages lack, and helps you get quick results without any fuss or patronising wizards.

In its current guise it's just a 1.6MB download - it doesn't even need to be installed: just unpack the ZIP file on your hard disk and run the executable directly.

What can VirtualDub do?

VirtualDub started life as a video capture utility, back in the days when camcorders and video sources were normally analogue and you needed a dedicated video capture card to digitise the analogue source for your PC. Today, that function is redundant for most of us, as modern camcorders produce native digital files. Getting video onto your computer thus becomes a simple matter of plugging the camera into a USB or FireWire port and dragging the files to your desktop.

But that still leaves VirtualDub with three important uses: basic video editing, processing and recompression into different video formats.

When it comes to editing, one of VirtualDub's most useful features is the direct stream copy function. It's useful whenever you need to make edits to a video that's already been saved to a compressed format, such as MPEG. For example, say you want to take a clip from the middle of the file. Other (supposedly more user-friendly) editors will insist on recompressing the clip once you've extracted it, even if they're saving to the same format as the original file. But VirtualDub allows you to make basic edits - cropping and cutting scenes - and save the file back to disk without needlessly decompressing and recompressing it.

This is a boon for two reasons. First, it saves the video from generational degradation: decompressing from a "lossy" video format and recompressing will inevitably reduce its quality. Just as importantly, though, it also saves bags of time. You'll appreciate this if you've ever tried to make a quick DVD edit with Windows Movie Maker and ended up sitting for an hour staring at a compression progress bar.

Virtualdub helps you get quick results without any fuss or patronising wizards.
Virtualdub helps you get quick results without any fuss or patronising wizards.

It works the same if you want to join together two video files: as long as they're in the same format, with the same resolution and frame rate, VirtualDub can splice them together into one seamless video without recompressing them. Direct stream copy also works for audio, as you'll see if you take a look at the video conversion walkthrough on the next page.

Another distinctive feature of VirtualDub is the ability to produce a video file from a series of still images. This gives you a completely free way to get into time-lapse photography and stop-motion animation: your camera or capture device doesn't need to have a specific time-lapse or stop-motion mode. Give VirtualDub a folder full of files and it will combine them and spit out a video file.

If you're interested in software development, VirtualDub is also noteworthy for being one of a few modern applications to include hand-written assembly language in its code. Writing speed-critical sections of a program in native machine language - as opposed to a higher-level language such as Visual Basic or C++ - was common practice a decade or two ago, when computer processors were tens of times slower than they are today. But nowadays, programmers habitually rely on clever compilers to optimise their code for them.

Indeed, the jury is out on whether trying to optimise machine language code "by hand" is really a good idea in today's world of branch-prediction and speculative-caching processors, where it's all but impossible to anticipate exactly how the CPU will process a particular routine. But the fact remains that VirtualDub is very fast when it comes to time-consuming reprocessing and transcoding of video files.

That brings us to yet another of VirtualDub's strengths: transcoding. It can, for instance, read the 5GB+ of VOB files from a DVD and convert them into a more advanced compressed format, such as DivX, to produce a file of about 1GB with little loss in quality. VirtualDub doesn't include the MPEG2 decoder to work with VOB files by default, but its abilities can be extended with plugins, and you can find one suitable for you via a simple web search.

Note, though, that strictly speaking, it's illegal to use this method to archive or recompress commercial DVDs. It is useful though for converting things like wedding DVDs, or videos of your local sports team.

Step by step screenshot walkthough: click below for the next page...

Walkthrough:: Convert a DVD to an AVI file

 The MPEG2 format used by DVDs can easily be compressed to a smaller, single file for hard disk storage. We’ll demonstrate by converting a non-protected DVD of a mountain-bike event. Remember that ripping commercial DVDs is illegal.
The MPEG2 format used by DVDs can easily be compressed to a smaller, single file for hard disk storage. We’ll demonstrate by converting a non-protected DVD of a mountain-bike event. Remember that ripping commercial DVDs is illegal.

 VirtualDub doesn’t include an MPEG2 decoder, but thankfully, the open-source community has provided one. Visit neuron2.neth to download an array of plugins. Pop the downloaded file into VirtualDub’s plugins folder.
VirtualDub doesn’t include an MPEG2 decoder, but thankfully, the open-source community has provided one. Visit neuron2.neth to download an array of plugins. Pop the downloaded file into VirtualDub’s plugins folder.

 Browse to the folder on your DVD that contains the VOB files and look at their file sizes. You’ll likely see that the first one or two VOB files are only a few kilobytes in size. Note down the file name of the first file that’s 1GB (1,048,574KB) in size.
Browse to the folder on your DVD that contains the VOB files and look at their file sizes. You’ll likely see that the first one or two VOB files are only a few kilobytes in size. Note down the file name of the first file that’s 1GB (1,048,574KB) in size.

 Start VirtualDub by double-clicking virtualdub.exe (not vdub.exe – that’s the command-line version). Then select File | Open video file. Navigate to the folder containing your VOB files and click on the file name you just noted down.
Start VirtualDub by double-clicking virtualdub.exe (not vdub.exe – that’s the command-line version). Then select File | Open video file. Navigate to the folder containing your VOB files and click on the file name you just noted down.

 Before clicking Open, tick “Ask for extended options after this dialog”. Now click Open. You’ll automatically see options for the MPEG2 plugin. Tick “Open multiple VOB files as one virtual file” and also “Allow ‘Direct Stream Copy’ of MPEG audio”.
Before clicking Open, tick “Ask for extended options after this dialog”. Now click Open. You’ll automatically see options for the MPEG2 plugin. Tick “Open multiple VOB files as one virtual file” and also “Allow ‘Direct Stream Copy’ of MPEG audio”.

 The Open Multiple VOBs dialog: as you selected the first VOB file of the video proper (here, VTS_01_1.VOB), the correct succeeding files should be selected automatically. VirtualDub can now seamlessly link them when it creates the output video. Hit OK.
The Open Multiple VOBs dialog: as you selected the first VOB file of the video proper (here, VTS_01_1.VOB), the correct succeeding files should be selected automatically. VirtualDub can now seamlessly link them when it creates the output video. Hit OK.

Click below for page three...

 

 The plugin will now start to analyse the files, and eventually you’ll see two views on the resulting video in the main VirtualDub interface. Now we need to head to Video | Compression to open the Select Video compression dialog.
The plugin will now start to analyse the files, and eventually you’ll see two views on the resulting video in the main VirtualDub interface. Now we need to head to Video | Compression to open the Select Video compression dialog.

 In the compression dialog, select the codec you want to compress to – in our case, DivX 6.9.2. If this doesn’t appear you’ll need to install DivX, which is a free download from www.divx.com. Don’t select the decoder – you’re encoding!
In the compression dialog, select the codec you want to compress to – in our case, DivX 6.9.2. If this doesn’t appear you’ll need to install DivX, which is a free download from www.divx.com. Don’t select the decoder – you’re encoding!

 Hit the Configure button and you can play around with the encoding settings. There are lots of options, but with DivX you can leave the defaults as they are and get good results. Note that the free version of DivX has a few advanced options disabled.
Hit the Configure button and you can play around with the encoding settings. There are lots of options, but with DivX you can leave the defaults as they are and get good results. Note that the free version of DivX has a few advanced options disabled.

 With the encoder configured, you can now simply select File | Save as AVI. The default file name will be the name of the first VOB file in the sequence. Change the filename to something meaningful for easy searching in future. Then just hit Save.
With the encoder configured, you can now simply select File | Save as AVI. The default file name will be the name of the first VOB file in the sequence. Change the filename to something meaningful for easy searching in future. Then just hit Save.

 VirtualDub springs into action, with a handy progress bar and an estimated time to completion for the transcoding operation. If you find the constant flickering of the output windows disconcerting, untick “Show input video” and “Show output video”.
VirtualDub springs into action, with a handy progress bar and an estimated time to completion for the transcoding operation. If you find the constant flickering of the output windows disconcerting, untick “Show input video” and “Show output video”.

 To squeeze the maximum possible performance out of your PC, you can increase the thread priority using the dropdown list. Remember that this will affect the responsiveness of your system while it’s transcoding.
To squeeze the maximum possible performance out of your PC, you can increase the thread priority using the dropdown list. Remember that this will affect the responsiveness of your system while it’s transcoding.

Source: Copyright © PC Pro, Dennis Publishing

Copyright © 2013 Haymarket Media. All rights reserved. This material may not be published, broadcast, rewritten or redistributed in any form without prior authorisation.
Your use of this website constitutes acceptance of Haymarket Media's Privacy Policy and Terms & Conditions.