# Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutorial)



## aditya1987 (Nov 25, 2008)

*Create your own Very high quality DVDRiP with AC3 sound.(Tutorial)*

*Encoding DVDs to High Quality Movie Files with XviD and AC3*


*Table of Contents :-*

· What You're Going To Need
· Rip Your VOBs And Index Your Movie
· Set Up The Frameserver And Fix The Aspect Ratio
· Setting Up XviD's First Pass
· Setting Up XviD's Second Pass


from 4.89 GB in VOB files down to 1.79 GB in XviD, 36.6% of its original size while
retaining virtually all of the quality of the original.


*What You're Going To Need*

This tutorial assumes you have all of the following installed and in working order. Any
questions about these projects should be forwarded to their respective authors or
contributors, not me. If for some reason these links are broken, check for more updated
versions of these programs at VideoHelp.com, which is one of the best resource sites I've
ever found when it comes to computer video.

Codecs

· XviD Codec
Grab the latest XviD codec binary.
· AC3Filter
This handles the playback of the AC3 audio that we're going to mux into the final
movie file.

Utilities

· DVD Decrypter
Rips the necessary VOB files off the DVD disc. Especially useful for encrypted
discs and content.
· DGMPGDec DGIndex
This tool will take the unencrypted VOB files and create an indexed D2V project
file. It also outputs your AC3 audio stream in the process.
· VFAPI Reader
This tool is used in conjuction with DGIndex to frameserve the MPEG content in
your VOB files to VirtualDubMod for encoding.
· AC3 Delay Corrector and GfaWin32.ocx
If your AC3 files end up with small delays this utility will fix the delays to
maintain your audio/video sync. Make sure you also download GfaWin32.ocx and
put it in the same directory as your AC3 Delay Corrector files or the program will
crash.
 · VirtualDubMod
You'll need this app to do the actual encoding. We'll also fix some aspect ratio
and letterboxing issues and mux in the AC3 audio with this tool.


*Rip Your VOBs*

I'm not going to spend too much time discussing the whole process of using DVD
Decrypter to rip off your VOB files because there are plenty of guides that cover the
process just fine. Instead, here's the quick instructions to get you moving along.

Put the DVD in your drive and fire up DVD Decrypter. Make sure you're operating in
IFO mode, not File mode. You can change this by going to the Mode menu and choosing
IFO.

Next go to the Edit menu and click Select Main Movie PGC. This will select the longest
program chain on the DVD, which is presumably the movie itself. If the duration looks
right on the Input tab than it's probably the right program chain. Make sure that all of
your chapters are selected and that you set the output directory and click the big decrypt
button. This process could take anywhere from a few minutes to up to an hour depending
on the size of the files and the speed of your computer and DVD drive. Once finished,
however, you'll have a set of numbered VOBs on your hard drive that are ready to be
indexed.



*Index Your Movie And Grab Your AC3 Audio*


Load up DGIndex, which is going to do double duty and index our VOB files for
frameserving as well as output our AC3 audio file for muxing back in later. Go to Open
under the File menu and select all your VOBs and click Open.

You should then be bombarded with a file listing of all the VOBs you just selected. Make
sure they're all there and that they are in numerical order. Once correct, click OK.

Now select Preview from the File menu. The movie should start playing and DGIndex
will open up a status window displaying the information it's collecting. Let the preview
run for about 5 minutes to ensure that it gathers enough information.
In the screens above you can see both the preview video and the statistics window. As is
quite apparent in the preview video, there is a huge aspect ratio problem in the source
video. Why is it stretched like that? DGIndex is interpreting it as 16:9 widescreen, when
in reality most movies are shot in a wider aspect ratio such as 2.35:1 or 1.85:1. This isn't
a problem, in fact we'll capitalize on this later when we set up VirtualDubMod to encode.

Now take a look at the statistics window. As you can see, the movie was interpreted as
16:9. Again, that's OK, we'll fix it later. More importantly, look at what's displayed in
the Video Type box. It it says Film, you'll need to perform an additional step before we
output the indexed D2V file. If you're encoding a movie that was released in theaters,
chances are it will be film. Close the statistics window.

Let's set up DGIndex to demux our AC3 audio for us. Go to the Audio menu, choose
Output Method, and select Demux Tracks. When we save our project, the AC3 audio
track selected in the Audio > Track Number menu will be dumped to an AC3 file for us.
In most cases, the standard English audio track is track number 1, but if you want
something else make sure to verify which track number it is and select the appropriate
one. You could also select Demux All Tracks from the Output Method menu and listen to
them later to find the right one.

Now if the statistics window reported that your video type was Film, go to the Video
menu, choose Field Operation, and select Forced Film. This will force our output to be at
23.976 frames per second, which is the correct framerate for movies.
Fixing aspect ratios isn't that big of a deal, but screwing up framerates can be a royal
pain, especially if you ever have any hope of getting your audio and video synchronized.
However, the movie I encoded has perfect audio/video sync and that's what we're going
for.

Finally, select File > Save Project to save your D2V file. I like to name it something
informative, like "NameOfMovie.d2v" but it's completely up to you. Your AC3 file (or
files, if you selected Demux All Tracks) will also be dumped in this directory.

Once it's finished indexing, which should only take a few minutes, shut down DGIndex.



*Fixing Delays In Your AC3 Audio*


Check out the filename of the AC3 file that DGIndex dumped out for you. If it states a
delay (anything other than "DELAY 0ms") we need to fix this delay to maintain the
audio/video sync of our final movie file. Thanks to AC3 Delay Corrector, this is a fairly
simple processes. Load up AC3 Delay Corrector. If the program crashes right away, you
need to get a hold of the GfaWin32.ocx file and put it in the same directory as your AC3
Delay Corrector files. The link to download GfaWin32.ocx can be found on the "What
You're Going To Need" page.

Next to the Source File box click the button with three dots. Locate your desired AC3 file
and open it. AC3 Delay Corrector is smart and automatically interprets the delay in the
filename and sets all the options for you. All that's left to do is click the Write button.
When it's finished writing it will haved dumped a delay corrected AC3 file in the same
directory with "_fix" appended to the filename. Close AC3 Delay Corrector and use the
new AC3 file from here on out.



*Building The Frameserver with VFAPI Reader*


Congratulations, this is the easiest part of this entire tutorial! Fire up VFAPI Reader.
Click the Add File button and select your D2V project. Another screen will pop up asking
you where you would like to save the AVI file. Pick a location and a name, leave the
other options alone, and click OK.

Now just click the Convert button. We've now got an AVI file that will frameserve the
MPEG data from the VOB files ready for encoding and an AC3 audio track ready for
muxing. Close VFAPI Reader and move on to VirtualDubMod.



*Removing Letterboxing And Fixing The Aspect Ratio*


Go to the File menu, choose Open Video File, and select the AVI file that VFAPI Reader
just created. You should be able to scrub through the video by dragging the slider at the
bottom of the window.


What is letterboxing? If you've ever watched a widescreen movie you've seen it.
Basically, it's the use of those black bars above and below the image to show the movie
correctly. Why don't we want the movie to retain it's letterboxing when we encode it?
Well, there's really no reason to keep it. Media players on computers can handle video
files of any resolution, so why not make our movie a size that exactly fits the video data?
Not only that, but if you include the black bars in the video file they're going to be
wasting some our precious bitrate to store their information.
Instead, we can chop off those black bars and use all of our bitrate on the video, which is
the important part anyway. Another added benefit is that when you play it back in a
media player you get the darkest black your monitor can display on either side of the
video, not the washed out "bright" black of a compressed video file.

To set up this cropping go to the Video menu in VirtualDubMod and select Filters.
VirtualDubMod has a list of built in filters you can use to modify the output it produces.
You can see the cropping button in the bottom right hand corner, but it's not enabled yet.
Click the Add button, choose the Null Transform filter, and click OK to return to the
filters window.


Now click the cropping button to adjust our cropping settings. Scrub to a frame of your
movie where the edges of the video are pretty well defined. Drag the tops and bottoms of
the image down until they get pretty close to the edge of the image and then use the up
and down arrows in the Y1 Offset and Y2 Offset boxes for pixel-perfect control. Make
sure that both the Y1 Offset and Y2 Offset values are even numbers. You may need to
cheat the actual boundry a little bit to do this but it's better to cut off a line of image than
it is to leave a line of black bar. Finally click OK.


You won't see the cropping in the list of filters, but it's important to note that the
cropping will take place before any other filters we use.

Next we need to apply a resize filter to fix that pesky aspect ratio problem. Click the Add
button in the filters window again and add a resize filter. When you click OK you'll be
presented with an options dialog that let's you set the new video size. Now here's where
a little bit of math comes into play. To keep the highest resolution possible, we want to
retain our 720 pixel width. We just want to "squash" the video into the correct aspect
ratio.

What you need to do is divide 720 by the desired aspect ratio to get the correct height for
our new video. You'll need to look on the back of the DVD box to find what aspect ratio
it was shot in. Some common ratios include 2.35:1, 1.85:1, 16:9, and 4:3. To simplify the
math, here's a basic table that provides the width and height values for different aspect
ratios.
Common Aspect Ratio Real Aspect Ratio Video Frame Size
2.35 2.35:1 720×306
1.85 1.85:1 720×390
16:9 1.78:1 720×404
4:3 1.33:1 640×480

Please note that with the 4:3 aspect ratio we can acheive the greatest quality by changing
our width, not the height.


Type in your new width and height values in their respective boxes on the resize filter
options screen. Under filter mode I prefer Lanczos3 for the highest quality but feel free to
choose something else if you like. Do not check the Interlaced checkbox and especially
do not check the Expand Frame And Letterbox Image checkbox, because that would
undo all the work we're doing right now. Finally, click the Show Preview button. Scrub
through your video and make sure that it looks right and that you chopped off all the
necessary black bars earlier. This is what our output video file will look like. If it looks
good to you, close the preview window and click OK on the resize options screen to
return to the filter list. Click OK to close the filter list.



*Setting Up XviD's First Pass*

Here comes the complicated parts. We need to set up VirtualDubMod to run two projects
in batch processing mode. The first project it runs will the be the first pass by the XviD
encoder, which won't actually output anything. Instead it will collect information about
each frame to give you higher quality results when it actually encodes on the second pass.

Go to the Video menu and make sure that Full Processing Mode is selected. Next, go to
the Video menu and select Compression. This will bring us to the the screen that allows
us to configure our encoder options. Select the XviD MPEG-4 Codec from the list on the
left and click the Configure button.


Now we need to configure the encoder for it's first pass. Use the following settings.
 Setting - Value
Profile @ Level - AS @ L5
Encoding Type Twopass - 1st Pass

If there are any zones defined in the Zones box, select and apply the following settings to
each one.

Setting - Value
Start Frame # - 0
Rate Control - Weight 0.00
Begin With Keyframe - Checked
Greyscale Encoding - Unchecked (unless your video isn't in color)
Chroma Optimizer Enabled - Checked
BVOP Sensitivity - 0

Now click on the Advanced Options button. Use the following settings on the Motion tab.

Setting - Value

Motion Search Precision - 6 - Ultra High (reduce for smaller files)
VHQ Mode - 4 - Wide Search (reduce for smaller files)
Use Chroma Motion - Checked
Turbo - Unchecked
Frame Drop Ratio - 0
Maximum I-Frame Interval - 240 if you needed to select Forced Film in DGindex
otherwise set to 300

Cartoon Mode - Unchecked (unless you're encoding something like anime)



Use the following settings on the quantization tab.

Setting Value
Min I-Frame Quantizer - 1
Max I-Frame Quantizer - 31
Min P-Frame Quantizer - 1
Max P-Frame Quantizer- 31
Min B-Frame Quantizer - 1
Max B-Frame Quantizer -31
Trellis Quantization - Unchecked


Finally, on the Debug tab use the following settings.

Setting Value

Automatically Detect Optimizations - Selected
FourCC Used - XVID
OutputDebugString Debug Level - 0×0
Print Debug Info On Each Frame - Unchecked Display Encoding Status - Unchecked

Now click OK to close the advanced options window and click OK to close the XviD
configuration window. Lastly, click OK to close the video compression window.

Go to the File menu and choose Save As. Make sure the file type is Audio-Video
Interleave (*.avi) and give it a file name. Most importantly, check the box that says
"Don't run this job now; add it to job control so I can run it in batch mode." Click the
Save button. That's it for the first pass.



*Setting Up XviD's Second Pass*


Don't close VirtualDubMod or reopen the file or anything. Just go back to the Video
menu and select Compression again. Click Configure to open the encoder options
window. I'm only going to give you the settings you need to change. Leave everything
else the way it was before.

Setting Value

Encoding Type Twopass - 2nd Pass


For high quality video ,toggle the Target Bitrate/Target
Size button to Target Bitrate. Type 1500 in the box to its right. That'll give the video a
bitrate of 1500 kbps which produces excellent quality video.

If you want to aim for a particular file size toggle the button to Target Size and click the
Calc button to open the bitrate calculator. Type in your target size (in kilobytes) and leave
the subtitles box at 0. Make sure the Container Format is set to AVI-OpenDML. Type in
your movie's duration. If you checked Forced Film in DGIndex select 23.976 (FILM), if
not select 29.97 (NTSC). Select AC3 as your audio format and choose the average bitrate
of your AC3 audio file. This can be found by looking in the file name of the AC3 file we
outputted earlier using DGIndex. Finally, click OK to close the bitrate calculator.
Remember, only perform these steps if you're aiming for a particular file size.

Click OK to close the XviD options window and click OK to close the video compression
window. Now we've got to add our AC3 audio to be muxed in on the second pass. Go to
the Steams menu and select Stream List. Click the Add button and select your AC3 audio
file from earlier. After a short pause as VirtualDubMod parses the AC3 audio, it should
show up in the stream list. Click OK to close the stream list box.


Go back to the File menu and select Save As. Type in the same name you did before
(taking care to select the AVI file type) and again check the "Don't run this job now"
box. Click Save to close the window. Now open the job control box by going to the File
menu and selecting Job Control. Both the first pass job from earlier and the second pass
job we just configured should be listed. Your box will differ from the screenshot below
because I've already finished encoding. Just click the Start button and VirtualDubMod
will start the long and arduous process of encoding your movie. This would be a good
time to go and do something else for... quite a while. Once the project starts running you
can open a status window from the main VirtualDubMod window that will display its
progress and let you play with the priority settings.




After it's done you will have your beautiful new high-quality XviD movie file with AC3
audio. Good luck!


*Here is a sample :-*


*Input File (Before Encoding):-*

*i34.tinypic.com/21bx4y.jpg



*Output File (After Encoding) :-*

*s4.tinypic.com/vqh9vo.jpg




*Input File (Before Encoding) :-*

*i38.tinypic.com/2ueim90.jpg




*Output File (After Encoding) :-*

*s4.tinypic.com/2cygz79.jpg




*Input File (Before Encoding) :-*

*i37.tinypic.com/qp4b3b.jpg




*Output File (After Encoding) :-*

*s4.tinypic.com/o6wej6.jpg



*You Can See That There Is No Difference In Picture Quality Between Original File And Output File.*


*NOTE:-*

XviD will not encode videos with an odd-numbered height. For example, when
encoding a 1.85 aspect ratio movie at the previously stated size of 720×389 it will
crash out with an error message. All XviD files must have an even height. The
correct frame dimensions have been updated.


*P.S :- I DON'T RECOMMEND AUTOGK BECAUSE IT DOESN'T ALWAYS GIVES CORRECT ASPECT RATIO AFTER RIPPING. MY METHOD ALWAYS GIVES CORRECT ASPECT RATIO.*


*PLEASE COMMENT, WHETHER YOU LIKED THE TUTORIAL OR NOT*


----------



## thewisecrab (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

Great Tutorial. Thanks


----------



## MetalheadGautham (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

Please avoid using the word "Lossless" loosely.
Otherwise its a nice tutorial.


----------



## Krazzy Warrior (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

Will try..Will try..Will try..looking damn cool..


----------



## clmlbx (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

megui is also best ripping software I have used .........

and all quality rippers use that only ......


----------



## gopi_vbboy (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

Good try....

Dont't know how to rip  like aXXo and FxG....They rock......have any idea.....they don use this method for sure


----------



## amitava82 (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

Since you have forgotten to mention the source; I'll do it for you: *www.bobsomers.com/files/xvidac3tutorial.pdf

*img141.imageshack.us/img141/9550/contactcatfw1.jpg
*img141.imageshack.us/img141/contactcatfw1.jpg/1/w270.png


----------



## axxo (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

hmm..I could see some loss in color in the resultant xvid/divx encoded video.


----------



## Faun (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

lol...who has time to transcode videos, its fcuking waste of hours and HDD space.

EDIT: Yes you do have so KTSU



aditya1987 said:


> *
> Input File (Before Encoding) :-
> 
> *i37.tinypic.com/qp4b3b.jpg
> ...



lol, there is huge difference.


----------



## axxo (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*



T159 said:


> lol...who has time to transcode videos, its fcuking waste of hours and HDD space.
> 
> EDIT: Yes you do have so KTSU
> 
> ...


 
ya..side view & front view


----------



## Faun (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

^^lol...keep on posting. Of course I can see your effort. 
Sometimes we just pull legs  So don't take anything seriously in forums, most of us hang out here for fun.


----------



## aditya1987 (Nov 25, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*



gopi_vbboy said:


> Good try....
> 
> Dont't know how to rip  like aXXo and FxG....They rock......have any idea.....they don use this method for sure



You can get aXXo & FxG quality by using the same method just convert AC3 to MP3 with 112kbps . You can do this by :-

Vdub > Audio > Full Processing mode > compression > and choose lame Mp3


----------



## aslam.doctor (Nov 26, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

I just use AutoGK for this, its great, most of dvd rippers uses it 

you can get it here, its free

*www.autogk.me.uk/modules.php?name=Downloads


----------



## aditya1987 (Nov 26, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*



aslam.doctor said:


> I just use AutoGK for this, its great, most of dvd rippers uses it
> 
> you can get it here, its free
> 
> *www.autogk.me.uk/modules.php?name=Downloads



*I don't recommend AutoGK because it does not always gives correct aspect ratio. Sometimes afte conversion the picture is slightly squeezed and sometimes it's stretched. But the method that I have described always gives correct aspect ratio. *


----------



## parthbarot (Nov 26, 2008)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

virtualDub is the best... . Rip of your DVDs and use VirtualDub to get exact result what you want...i have used it many times... for size..for quality... 

Xvid + VirtualDub

regards.


----------



## hell_storm2006 (Feb 11, 2009)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

Can I use this process to Rip VCD's  and DAT files as well????


----------



## phreak0ut (Feb 13, 2009)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*



aditya1987 said:


> *I don't recommend AutoGK because it does not always gives correct aspect ratio. Sometimes afte conversion the picture is slightly squeezed and sometimes it's stretched. But the method that I have described always gives correct aspect ratio. *



It has always worked fine for me


----------



## stellarbpo (Feb 18, 2009)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

Nice article.Thanks for the information.


----------



## comp@ddict (Feb 18, 2009)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

The loss can be noticed, I would rather suggest a higher capacity HDD and keep the good quality.

Nevertheless, good article.


----------



## expertno.1 (Mar 22, 2009)

*Re: Create your own Very high quality DVDRiPs (Almost Lossless) with AC3 sound.(Tutor*

TUTORIAL IS GOOD but the truth is now Xvid is no way into competition , 
use H.264 and AAC to get 300 mb movies ........

i will be posting a tutorial on this soon .


Thanks
Regards.....
Expertno.1


----------

