westnet logo

CRUSTY QUINNS

GoINTRO

GoHALL OF FAME

GoMESSAGEBOARD

GoNOTICEBOARD

GoREPORTS

GoGALLERY

GoRESULTS

GoTHE HOG AWARD

GoSTATISTICS

GoVIDEO

GoNURSE BEC


TECH TIPS

GoINTRO

GoSUSPENSION

GoGEARBOXES

GoXR RERING

GoXR TEARDOWN

GoSTATOR

GoCDI

GoEASYOUT

GoPLASTIC WELD

GoMYO GASKET

GoXVID VIDEOS

GoDIY TECHTIP

GoSTUFF

GoADMIN AREA

Getting Xvid.


XviD is a mpeg4 compliant open source video codec. A video codec is a thing that tells your computer how to understand a video file, so that it can play it on the screen for you. mpeg4 is a good standard ( high quality video, small file size) and I like the concept of open source. Alternative mpeg4 compliant video codecs include DivX, but they sold their soul to the devil when they started charging for it. Microsoft have their own versions, but all are patented and can only be used under licence. Pah to that, XviD it is.

The only downside to XviD is that it isn't naturally installed on any computer. So the first thing you need to do is:

Download XviD setup

Right mouse click on the above link, select "save to disk" and choose somewhere to download the file to. Once it is in (about 500kb) run it. Press next a few times, let it install itself. At this stage, you can now watch any XviD video files. Yah.

Converting a video to Xvid.


It's all good to watch somebody elses XviD, but I want to make my own. Okay, no worries, but it is a bit involved. First, you'll need some tools. I'm assuming you are using Microsoft Windows. Download VirtualDub, a nice open source video tool, and then LAME, an open source version of the MP3 audio codec.

Quick explanation: XviD is a _video_ codec, ie moving pictures. It it dead silent, there is no audio involved. However, we live in a time of moving pictures with sound, so we bundle the video data stream (in XviD flavour) together with an audio data stream and store it in a "container". The container we'll use is the AVI container, which simply stands for Audio Video Interface. Lets not worry about how the video and audio get stored in the AVI, lets just be happy that they do. So, just like there is a video codec for the video stream, so to there is an audio codec for the audio stream. In this case the MP3 standard is still very popular, all computers naturally understand it, data size is very small for good quality audio. To get the most out of MP3 if we install LAME we will get all the bitrates and formats and the best compression engine out there.

Download LAME_ACM_3.96.1.zip

First, save the LAME setup files to your disk. Now, extract the 3 files from the zip onto your disk. Using windows explorer, right mouse click on LAME.inf and say "install". Done.

Nip over to sourceforge and download VirtualDub

Extract all of the files from the download into a directory on your disk, C:\VirtualDub sounds good. VirtualDub is not installed by running an installing program, you just extract it and run it from there. So, make up a shortcut to the program (C:\VirtualDub\VirtualDub.exe) and bung it on your desktop!

Before we get too carried away, lets talk about the video file you are going to convert to XviD. VirtualDub won't accept MPEG2 or WMV formats, because they are proprietary formats - ie, would cost money to support. So if you are using ulead or adobe to put together your magnificent video, I suggest you export it as a raw AVI files (big file size) or as a very high bitrate mpeg1 or Microsoft mpeg4.

Right, we are ready to begin. Run up VirtualDub. You will be greeted with a fairly standard looking application.

File->Open, select your file.

On the Video menu, make sure "Full Processing Mode" is selected, as shown.>

picture

Back to the Video menu, select "compression". You will be greeted with the dialog as shown.

You should have XviD as an option, right at the bottom. If you don't, you haven't installed XviD.

Click on the "Configure" Button.

picture

Now you'll get a XviD Configuration box like shown. Don't worry about 95% of it.

change the "Encoding type" to "Twopass - 1st pass"

Quick explanation: When you compress a video, the compressor looks at the video stream and compresses it to the size you specify, the bitrate. Now if you say "make me a video that is a constant 600 kilobits per second" then you'll get a video that is all 600 kbps.

However, some scenes on your video won't need 600kbps, for instance a black screen needs hardly any kbps. However, fast moving scenes need a heap more than 600kbps - or they will end up looking "chunky."

So, by passing over the file twice, the first pass it checks out where it needs the most kbps, and the least, and builds a table. On the second pass (later), it uses an *average* of 600kbps and uses more or less bits where needed. This means a much better quality video!

picture

Press Ok a few times.

Now, on the Audio menu, ensure that "Full processing mode" is selected.

picture

Go back to the Audio menu, click on Compression.

From the list on the left, click on Lame MP3.

Now, on the right, select the best audio bitrate. As a hint, most MP3 music on the internet is "44100Hz, 128kbps CBR (constant bitrate), Stereo." If you are going for super-dooper quality audio, use a higher kbps. I wouldn't go above 256kbps, that is heaps.

If you are aiming for really really small filesizes, drop down as far as 112kbps, or 96kbps, but don't go below 80kbps - that will sound pretty scratchy.

If you have only a mono soundtrack, halve the kbps (ie, only one channel!)

picture

Press Ok to go back.

VirtualDub can do more than just compress videos, it can apply filters as it compresses - such as brightness/contrast, resizing, cropping. Lets apply a few just to get that filesize down.

From the Video menu select Filters.

Click on "Add"

You'll get a list of filters, scroll down to "smoother" and press Ok.

You'll get a box as shown. This is the amount of smoothing. Wind it up to 3, and tick the prenoise filter.

Quick explanation: By smoothing out the video a bit, the compression doesn't have to store as much data, so the filesize will drop even further. Better still, if your source video was from a video camera, some of the "noise" will be filtered out as well, improving the eventual "look" of your video.

picture

Let's add another filter - resize.

Press Add again.

scroll down to resize, press Ok.

I like to use 384x288 - this is half of the PAL size, and is 4:3 ratio. You could however use whatever you like, even distort the aspect ratio.

Oh, and like in the image, make sure you choose "Lanczos3" as the resize mode - it is by far the best method!

picture

If your video has dodgy edges - especially if it was captured from a video camera, cropping is useful too.

In the filters box select the resize filter and press "Cropping. You can now blank out as much of any edge of the video that is messy.

picture

Back on the main VirtualDub page, select File-> "Save As Avi".

Now, since this is the first pass of a two pass process, the first file is going to be junk. So, give it a junk name, stick it somewhere that you can delete later on.

Make sure you tick the box in the bottom "Don't run this job now..." - we'll cue up the first pass and second pass and run them together in a moment.

picture

Select from the Video menu "Compression", then select XviD again, then press "Configure."

Now select the encoding type to "Twopass - 2nd pass".

At this stage The "Target Bitrate"/"Target Size" button will become active. You have a choice, you can either nominate a file size and the resulting video will be that size, or specify a bitrate and the average bitrate will be that.

For really quick and dirty web videos, drop the bitrate down to between 300-400. It will be pretty clunky. For a nice web video but a pretty small size, go 500-600. For a video that you won't notice any clunkyness at all, go 700-800+.

Once you've made the file, you'd view it and say "hmm, I might go more on the bitrate" and repeat this process until you have the tradeoff between small filesize and nice quality.

If you are making a really big movie and you simply want it to fit on a CD, then switch to Target Size mode and type in either 650000kb or 700000kb, depending on whether you are using a 650mb or 700mb CD.

picture

Everything else remains the same (ie the audio, the filters, etc, they all remember the last state) so go File Save As AVI again.

This time it is the real file so give it a name, put it somewhere nice. Again, don't forget to tick the "Don't run this job now..." box.

picture

From File select "Job Control".

What you will see now is the two "jobs" you have queued up sitting in wait to be processed.

Press the "Start" button, and away it will go.

Depending on the file sizes, it will take a while - a few minutes if the video is only a minute long, to several hours if the movie is over an hour long.

You can check on the progress by popping up the "Show status" window.

Once the jobs are completed, you can delete the first pass file and delete all the jobs from the job control list. Check out your file, see what the quality is like for the file size. Good Luck!

JAW, 16 Sep 2004.

picture