Last Updated: July 23, 2003

DVDs can contain as much as 9 GB of data, mostly in the form of video which has been encoded in a format called mpeg2. This video can be copied onto a computer, but it consumes quite a bit of space. There are a number of other video compression formats out there that can preserve an amazing amount of the quality of a video while reducing it in size by a factor of ten. This guide focuses on archiving DVD video onto a computer using one specific compression format called DivX.

With DivX, a typical movie that is just under two hours can be reduced to fit onto a CD. When one shrinks the dimensions of the video to fit a PDA screen, the video can be reduced even further. Movies can often be squeezed down to 256 MB when they only need to be played on a 3.5 inch screen. By increasing the compression of a DVD movie, it is possible to store a library of movies on a computer hard drive, or consider bringing a movie on a road-trip to play on a PDA. Be aware that you will typically need almost 10 GB of hard drive space to work.

Note: There are a large number of free tools out there to help people in this video conversion process. In these pages, we describe one set of tools that has worked well in the past. Other video encoding guides may suggest different tools, and we’re sure many of them are very good (and some tools are definitely faster), but these have worked for us.

This guide is divided into 5 major sections, each covering part of the process of converting DVD video into a more compressed format.

  • Setting up the necessary software for the first time (needed only once)
  • Ripping the DVD
  • Encoding the Audio
  • Setting up Video Frame Serving
  • Encoding the Video

Setting up the necessary software for the first time

Most of the software can be downloaded from the Doom9 web site, which is dedicated to copying video from DVD into other formats. Unless otherwise indicated, you should download all of the following software from Doom9.

  • SmartRipper
  • DVD2AVI
  • HeadAC3he
  • VFAPI
  • VirtualDubMod
  • DivX 5.05 Pro from www.divx.com. Download the free version with Adware. The instructions here will describe how to disable the Adware.

We’re going to describe the steps necessary to configure this software to work. In subsequent sections we will describe what we do with each piece of software. Start by extracting SmartRipper, DVD2AVI, HeadAC3he, and VirtualDubMod into their own directories. It is not necessary to run any kind of setup or install file for these four programs. They are all set to run without installing anything.

VFAPI Plug-In menuNext, we want to set up VFAPI. Unzip it into its own directory. One of the files in the VFAPI directory is vifpset.bat. Run this program and it will register the necessary components. Then we want to verify the installation by running DVD2AVI.exe from its directory. A window will open and you should ensure that under the Help menu there is a checkmark next to the VPAPI Plug-In menu item. You can close DVD2AVI once you have verified that the checkmark is there.

Finally, we need to install the DivX 5.05 codec. Please read these instructions before running the installation file. The install file for the free Adware-supported version from www.divx.com installs the professional version of the codec. It also installs a piece of software called gator that immediately contacts the Internet and starts to pull down advertisements onto your computer. Obviously, it’s not good to have Adware on your computer, so before running the install file, it is good to prevent keep any advertising software from contacting the Internet.

After you download the DivX 5.05 installation file, unplug your connection to the Internet, or configure your firewall to prevent any programs from reaching the outside world. Unplugging from the Internet is the best choice. Then, run the installation file. It will ask if it is okay to install gator. Go ahead say OK. When the whole installation finishes, we then need to remove gator:

  • Bring up the Task Manager (in Windows XP, you can do this by hitting ctrl-shift-esc), and change to the Processes tab.
  • Locate a process named gain_trickler_xxxx.exe and kill the process by selecting the process and clicking the End Process button.
  • Then open up the registry by running regedit.exe from the Start | Run prompt.
  • Find the following keys and delete them (not all of the keys may be present)
    • HKEY_LOCAL_MACHINE\software\gator.com\
    • HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\stashedgef
    • HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\stashedgmg
    • HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\trickler
  • Delete the file c:\program files\DivX\DivX Pro Codec\gain_trickler_xxxx.exe.

Later, if you run a program like Adaware that removes advertising software, make sure you don’t remove a registry key named HKEY_CLASSES_ROOT\CLSID\{21ffb6c0-0da1-11d5-a9d5-00500413153c}\. This key is necessary for DivX to work.

All of your software should now be configured and ready for copying DVDs.

Ripping the DVD

We will use SmartRipper to "rip" the DVD. Ripping is the process of copying media files from a DVD or CD. In this case, we want to rip video from the DVD onto our hard drive so that we can start processing it.

After you put the DVD in the drive, and start SmartRipper, it may complain that it is unable to read the DVD. If it does, try these two suggestions: Play the DVD in your DVD playing software (such as PowerDVD or WinDVD) and then open SmartRipper. You might also try running SmartRipper using the NoASPI.bat file in the SmartRipper directory. When the application opens, it looks like this:

smartripper

The longest media segment (which is almost always the movie) is automatically selected. If you want to rip other parts of the DVD, you can choose different chapters instead.

maximum file sizeBy default, SmartRipper will break up the output file into segments no larger than 5,000 MB. In this particular case, SmartRipper will be able to create a single file because in the lower right corner we see that the required diskspace is only 3,832,970 KB. If the required diskspace were greater than 5,000 MB, then we would get multiple output files. We find it useful to just work with a single file. To change the threshold where a new file is created, go to the Settings tab and change the file size limit.

Pick an appropriate target directory, and click the Start button. SmartRipper will copy the data off of the DVD into the directory you chose. After SmartRipper is done, you no longer need the DVD in the drive.

Encoding the Audio

The biggest file that is created from ripping the DVD has a .vob extension. The VOB file contains the video encoded in mpeg2 format, as well as all of the sound tracks to the movie. We’re going to extract the audio from the VOB file and encode it as an mp3 file, which will help save on space in our final product. At the same time, some of these steps will be useful for the next section.

Open DVD2AVI. DVD2AVI is a program that knows how to read VOB files. Select File | Open (or F3) and select the VOB file you created in the previous section. It will prompt you to add additional VOB files that you want to append on the end. Since we ripped the DVD as one big file, you shouldn’t need to append other VOB files. Click OK.

adding vob files to dvd2avi

aspect ratioSince we have the movie loaded in DVD2AVI, we may as well find out some information about the movie which will be important for the encoding step. Press F5 to start previewing the movie, and a statistics window will display. Take note of the Aspect Ratio, which is usually either 16:9 or 4:3. This ratio describes the proportion of the width and height of the video. We’ll need it later when we resize the video. You can hit the ESC key to stop the preview. The other thing we should do is select the Video | Field Operation | Forced FILM menu item (make sure it is checked).

Finally, we’re ready to extract the video from the VOB file, which will then enable us to re-encode it in another format. Select the Audio | Track Number | Track 1 menu. Track 1 is almost always the main audio track. If you would like to extract the other tracks, feel free to select them. Then, select the Audio | Dolby Digital | Decode menu option.

finished dvd2aviSelect the File | Save Project menu and pick a file name that represents the name of the movie. You can put this in the same working directory as the VOB file. When you save the project, it creates a D2V project file that we will use later on for processing the video. It also runs through the VOB file and extracts the audio track into a file with an AC3 extension. Be sure to wait until the Statistics window says FINISHED before closing DVD2AVI.

The AC3 file is your audio file. AC3 is a Dolby Digital sound format. It’s possible to put AC3 in our video file, but it’s pretty large. For the purpose of this guide, we’re going to turn the AC3 file into an mp3 file. Start HeadAC3he and press the Source button. Select the AC3 file.

Based on the filename that DVD2AVI created, HeadAC3he will automatically choose a value for the Delay field. In many DVDs, the audio track is delayed by a small interval, and DVD2AVI communicates the right interval to HeadAC3he through the filename. In our case, there is no delay (as we can tell by the 0ms in the filename).

Choose mp3 as the Destination format. Press the Options button twice and choose CBR as the mode. CBR stands for Constant Bit Rate. There are other ways of encoding audio that allow you to devote more bits to the parts of the track that needs it, but the video file format we’re going to create, AVI, only supports CBR.

If this video is going to be played on a computer, pick a bit rate above 160 Kbps. If the video is going to be played on a PDA, we need to choose a lower bit rate to keep the file size small. Going as low as 32 Kbps is reasonable. Click Start. After some time, you’ll end up with a file with the same name as the AC3 file, but with an mp3 file.

Setting up the Video Frame Serving

In the previous step, we created a D2V file using DVD2AVI. It was a side effect of extracting the audio track with DVD2AVI. The D2V file contains information about how DVD2AVI would process the VOB file if we were using it to create our AVI video file. We don’t want DVD2AVI to do the encoding since there are better tools out there to do the encoding. We do want DVD2AVI to help us out though. It turns out that DVD2AVI is one of the best tools for decoding the mpeg2 video in a VOB file. We’re going to use it to provide each frame of video to another program that is going to do the actual encoding. Providing video frames to an external program is called Video Frame Serving.

We set up DVD2AVI to do serve our video frames by using VFAPI. VFAPI is a neat little tool. It takes a D2V file as an input and it creates an AVI file. You can play the AVI file in a media player and as it plays, DVD2AVI is reading the video from the VOB file. In the next step we’ll use the AVI file from VFAPI as the input for our video encoder.

To create the AVI file with VFAPI, run VFAPIConf.exe. Click the Add Job button and select the D2V file. Press the convert button and allow the tool to finish. It should not take much time at all. If you want, you can test playing the AVI file it creates (which is named as something like <Title>_d2v_vfapi.avi). You should see video, but no sound.

Encoding the Video

We now have two files that we’re going to use for creating our final video. The first is the mp3 file that we created with HeadAC3he. This contains the soundtrack for our video. The second file is an AVI file created through VFAPI. The AVI file will display the video that is contained in the VOB file.

Our tool of choice for combining the audio and the video and for encoding and compressing the video is VirtualDubMod. Run VirtualDubMod and use the File | Open video file… menu to open our AVI file. Within VirtualDubMod you should see two windows that contain the video we’re trying to encode. On the left is the source video, and on the right is our target video.

virtualdubmod

resizing the videoNext we need to make sure that our video is the right shape. The video stored on the DVD is stored as a 720×480 pixel video. The 720:480 ratio is a 3:2 ratio. When we were looking at our video in DVD2AVI, though, it said that our video should be a 16:9 ratio. When we put DVDs in a DVD player, it automatically stretches the picture into the right shape. When we’re encoding video, we need to make sure we do the same thing. We select the Video | Filters… menu option, and choose the Resize filter. We can get a 16:9 ratio if we make the height 405 pixels instead of 480. Whenever we change the size or shape of a video, we lose or add pixels into the picture. We need to choose an algorithm for deciding what to do with these pixels. The "Lanczos" filter mode usually yields decent results. The letterbox options allow us to add black bars to the top and bottom of the picture. The DivX compression algorithm requires that the dimensions of the picture to be divisible by 4, so it is useful to put the letterbox bars on the picture.

selecting the video compressionThe next step is to choose our compression method. Under the Video menu, make sure that Full processing mode is selected. Then select the Video | Compression… menu. A window titled "Select Video Compression" will show up with all of our installed options for compressing video. Select DivX Pro 5.0.5 Codec and click the Configure… button.

We’re going to encode our video in two passes. VirtualDubMod will first examine the video and record information about the best way to encode it. Then, on the second pass, it will actually write the encoded video. In the Configure window, select "Multi-pass, 1st pass" in the Variable bit rate selection. Choose a bit rate using the slider. We find that 750 Kbps or higher is good for playing full screen on a computer. For a PDA, 250 Kbps is plenty. Make sure that "Do not prompt for errors and warnings" is selected" before clicking OK.

properties for the first pass

The bit rate affects the final size for our video file. 750 Kbps of video plus 160 Kbps of audio yields a total of 910 Kbps. That’s bits, not bytes, which are more commonly used for talking about file sizes. Dividing 910 Kbps by 8 bits per byte gives 113.75 KB/second. For every second of the movie, we’ll use up 113.75 kilobytes. A 110 minute movie ends up about 751 MB. You should round up because the video file contains a little bit more basic information, beyond the video and audio. This will barely fit on a CD.

At this point, we still have not told VirtualDubMod about our soundtrack. That’s okay. In the first pass of evaluating the video information, we don’t need the audio yet. Select File | Save As… and pick a file name for the temporary AVI file that this first pass will create. The name doesn’t really matter as this AVI will not be playable. It’s just needed for doing the first pass of this two-step process. Make sure that the "Save as type" is set to AVI. Also make sure to select "Don’t run this job now; add it to job control so I can run it in batch mode". This will queue up the work for the first pass so we can run it later after we’ve set up the second pass. The first pass will take hours, so we would prefer to set up both passes before starting either. Click OK.

saving the first pass

Now, open the same File | Compression… window and again click on the Configure… button. This time, change the Variable bit rate selection to "Multi-pass, nth pass". Leave all of the other parameters the same and click OK to return to the main VirtualDubMod window.

Click on the Streams | Stream list menu. It is here where we will add the different audio tracks (or streams) to our video. AVI files support only one audio track, but there are other video "containers" that can have multiple tracks. Click the Add… button and select our mp3 file. We’re ready to save our second pass job. Select File | Save As… and pick a name for our final video file. Again, make sure the Save as type is AVI, and that we still have selected "Don’t run this job now; add it to job control so I can run it in batch mode".

audio stream

Finally, it’s time to actually do the video encoding by running our two jobs. Select File | Job Control to bring up the job control window. You should see two entries, corresponding to the two passes of our video encoding work. Press the Start button. You can click the OK button to close the Job Control window, but don’t close VirtualDubMod while it’s still encoding the video.

job control

You can select the menu called Dub in Progress! | Status window to bring up a window that describes the progress of each job. After the first minute or so, it should give you a pretty good estimate of how long the current job is going to take. On our computer (a 1.7 GHz machine with 512 megs of RAM), each pass can take 4-5 hours. Our example (Lilo and Stitch) takes less time because an animated movie isn’t as hard to compress.

job status

You’re done! Once you’ve verified that your final AVI file works, you can delete all of the other files we’ve created along the way — just don’t delete your newly created AVI file!