How To Compress A Video File with Virtualdub

Anyone who has played around with any kind of video knows how huge uncompressed video files can be. The huge size of video files is what has led to the proliferation of video compression algorithms like DivX, Xvid, MP4 etc, but how exactly do you compress an uncompressed video to one of these formats, to save space and maintain your sanity ?

In this post, we’ll teach you exactly that. We’ll be using an open source application called Virtualdub to compress a video file while still retaining the quality of the original.

VirtualDub is a video capture/processing utility for Windows. It is free and open source and is released under the GNU GPL license.

To get started with using Virtualdub, download and install it from virtualdub.org. By default, Virtualdub does not come with any video compression codecs built in, because of licensing restrictions. You can however get started by downloading the Xvid codec from www.xvid.org. This is the format that we will compress our video to.

Once you have the codec installed, launch Virtualdub and click ctrl+O to load the uncompressed video. Virtualdub should load the video and you should see a screen similar to the one below.

Virtualdub

This is called the timeline view.

A video format like the .avi that I have loaded here has two parts, the video part and the audio part and we can treat both parts seperately for compression. To give an idea about the level of compression we achieve, the uncompressed file is about 716MB in size. We’ll look at the size of the compressed file once we’re done with the process.

Virtualdub

Click on Video and chose the Compression option (Or click ctrl+P). From the list of Codecs displayed on the left side of the window, choose the “Xvid MPEG-4 Codec” and click on

Configure

.Virtualdub

The only option that you need to worry about in the Configure window is the Target bitrate.  When you open this window for the first time, you will see a default value in it which is the bitrate of the original file. Mine was 700 kbps. I changed it to 300 kbps. 300 is a decent enough bitrate if you’re producing video for the web and are concerned about the size of the file, which is what this tutorial is about, right ?

Click on Ok and come back to the time-line view.

Now, we need to select a compression codec for the Audio part of the file. From the Audio menu, select the option titles “Full processing mode“. Now, select Audio again and click on Compression.

Virtualdub

From the list of Audi codecs, choose MPEG Layer-3 and click on Ok to get back to the time-line view.

Now, to create the compressed file, choose the File->Save as AVI option and give a new name for the compressed file. Virtualdub should now start saving the compressed file to your chosen location.

Virtualdub

After the compression process is done, you can check out the size of the new file.

VirtualdubIsn’t that amazing ?

The compressed file will, obviously, be of slightly lower quality but I’m sure you can live with that, considering the huge savings in space.

8 comments

    • I’m not sure if Virtualdub will work with wine. If you’re using Linux, though, you can do the same thing using either mencoder or ffmpeg. Both of these are command line tools though so you don’t get a fancy GUI with them.

  1. Sorry I made a mistake is not in Synaptic but you can install Avidemux is very similar, has the same functions and you can install from synaptic.
    congratulations for your blog!

    • Yes, virtualdub is not available in the ubuntu repositories. Infact, I don’t think its available for Linux at all. I’ll give avidemux a try too. Sounds like another post on the topic is due :-)

  2. i make alot of tf2 demos and turn them into avi’s then compress them with xvid mpeg4 in vdub and the quality looks decent but i see videos on youtube and the quality looks so rich like they were playing the game rite there,what do i have to do to get that quality???

    • video quality depends on a lot of things like the kind of camera, lighting (if you’re recording using an external camera), resolution of the capture and if you’re compressing the video then the codec used and the various settings for it.

      It’s really difficult to tell what you’re doing wrong here but I’d suggest that you start with capturing at a higher resolution and then playing with the compression settings in your convertor software.

      • When i record its with the in game recorder “no cams or anything”,then when i compress into a avi i use cam lossless video compression and run in 840×480 in a window “someone said it would scale better to youtube if i run it 840×480″i dunno i will try and capture at a higher res and play with the bitrate ..thank you very much for the help…

Comments are closed.

Sponsored Stories