VideoHelp.com forum archive
http://www.supermediastore.com/



Forum Archive Home -> User guides -> DVD to XviD Conversion



DVD to XviD Conversion
DJRumpy posted 2004 May 18 08:56
Changelog:
2/17/06: Updated the XviD settings to comply with 1.1.0 options

This guide is to assist you in converting DVD (or MPEG2/SVCD) to XviD. XviD is a freeware version of the MPEG-4 codec. It allows for excellent quality encodes at very low bitrates. You can typically place a full length movie onto one or sometimes two CD-R's, using full DVD resolutions. This guide will basically show you the behind the scenes method used by many of the automated scripting tools out there.

NOTE: If your not interested in the details that happen behind the scenes, I'd suggest you try something like Auto Gordian Knot (http://autotgk.net/). It will do most of these things for you with a few button clicks. Why the guide then? Many of the customizations needed for longer or shorter video's are not available to you with these one-click solutions. Either that, or they reduce your resolution as a result of the longer videos. If your not interested in tweaking or optimizing your output, then the Auto Knot method is probably your best bet. If you want to output better quality depending on each project, then read on...

All of the tools listed here are freeware. You should be able to find most in the TOOLS section. If you can't find them in TOOLS, check the www.doom9.org webiste in the Downloads section, or alternately, search www.google.com for them.

For this example, we'll be converting the Widescreen version of Brother Bear to XviD.

Tools Required:
Any 1 of these: DVD Decrypter, DVDFab Decrypter, AnyDVD, ImgBurn
DGIndex (v 1.4.6 or higher, which you can get from here or the www.doom9.org website. It's a new version of the classic dvd2avi)
AVISynth (version 2.5x or higher)
MPEG2DEC3 Plugin for AVISynth (MPEG2DEC3.DLL)
VirtualDub (version 1.5.10 or higher)
XviD Video Codec (find it in the TOOLS section)
NANDub (optional if you have VirtualDubMod which incorporates NANDub features).

This assumes you have previously installed all of the above. The MPEG2DEC3.DLL file should be placed in your AVISynth PLUGINS directory. You will typically find this in your C:\Program Files\AVISynth 2.5\ directory. Just copy or move the file to the PLUGINS directory located there.

Step 1: Ripping your DVD with DVD Decryptor
I used DVD Decryptor for this, but any ripping software will do. Essentially we want to rip only the main VOB files for your movie. Read the documentation with whatever ripping software you use as needed. I've put the Decryptor examples here just to give you an idea of what you should be starting with.

We'll start by ripping our DVD. If you have already ripped the files onto your hard disk, or your converting SVCD/CVD mpegs, skip to step 2. Since we don't require any Menu's with XviD file's, we'll use the default IFO mode (accessable via the MODE menu).



Inser the DVD to be ripped, and launch DVD Decryptor.
Select a destination folder by clicking on the Destination folder graphic (see image above)
Click the convert button to get things started. The default settings for DVD Decryptor will automatically select the main movie VOB's for you, so you shouldn't need to change anything here.

When the rip completes, you should now have a VIDEO_TS folder, with various files in it. The one's were interested in are the VOB's.


Step 2: Creating a Project File in DVD2AVI
Launch DVD2AVI, and from the FILE menu, select OPEN, or if you have DVD2AVIdg, select AutoIncrementOpen:

Select the first of the main movie VOB's (or MPG files if your converting from MPEG). The first will be the lowest numbered of the VOB files. For example, if your VIDEO_TS directory contains 4 VOB files, the first VOB might be named something like this: "VTS_5_1.VOB", with the 5 number being anything from 1 to 99 (example: VTS_5_1.VOB, VTS_5_2.VOB, VTS_5_3.VOB, VTS_5_4.VOB )

Make sure that all of the VOB's are added to the list. If you need to add or remove additional VOB files, then use the ADD/DEL buttons to ensure all of the VOB's are loaded and in the correct order. DVD2AVI version 1.76 will automatically try to add all VOB's matching the first VOB pattern, so any files named VTS_5_x.VOB (x being any number), will be loaded. the dg version of DVD2AVI will only do this if you selected AutoIncrementOpen from the FILE menu.

The first thing we're going to do here is to configure your DVD2AVI settings. We'll start with the AUDIO menu. Note - If a setting is not explicitly listed here, leave it at the default setting.

For the Audio menu:
Track Number = 1
Output Method = Demux (if you want to choose which audio track, select 'Demux All')
Dolby Digital Decode = Off
48 -> 44.1Khz = Off

For the Video menu:
iDCT Algorithm = 32 Bit
Field Operation = None
Color Space = YUV 4:2:2
YUV -> RGB = PC Scale

At this point, we should be all set to Preview your VOB files with DVD2AVI. Why do we do this? Two reasons. We need to determine what type of video your DVD had. Possible types are:
Interlaced, Film, Hybrid

The other reason we do this is to ensure we have the proper VOB's loaded in order. It is not necessary to preview the entire movie. Just preview the first few minutes to ensure everything appears in order, and to give DVD2AVI adequate time to veify what TYPE of video it is looking at.
(IMPORTANT: Ensure VIDEO -> FIED OPERATION is set to 'NONE' before previewing. If it is not, your preview results will be wrong)

Press F5 to preview your video or select FILE -> Preview from the menus.
The display to the right will report video information.

Properly setting the VIDEO -> FIELD OPERATION setting:
Examine the info box Frame Rate section.

If your Frame Rate is: 25.000 fps
This indicates a PAL source. If the Frame Type is 'Interlaced', verify your source is actually Interlaced (DVD2AVI seems to have difficulty verifying if PAL sources are interlaced or progressive). Set your FIELD OPERATION setting to NONE.

If your Frame Rate is: 29.970 fps
If your Video Type is reporting 'FILM' at a percentage higher or equal to 90% or it just displays FILM, set the FIELD OPERATION setting on 'Force Film'.
If the percentage is lower than 90%, then set the FIELD OPERATION setting to NONE.

If the Frame Rate reported is anything but these two values above, ensure your VIDEO -> FIELD OPERATION setting is set to NONE, and then repeat the PREVIEW steps above.

In our example, my video is FILM, so I'll turn my FIELD OPERATION setting to 'Force Film'

After setting your FIELD OPERATION setting, we're ready to save our Project File. From the FILE menu, select FILE -> "SAVE PROJECT (v1.76)", or if that option is not available, select FILE -> "SAVE PROJECT". Pick a directory to place your project files, and save the project file in that directory. Call the file "DVD2AVI.D2V" (without the quotes of course ;) ).

Step 3: Open your project file in AVISynth

AVISynth is a command line editor. It allows you to perform all sorts of effects and edits to your file, before feeding the output to your encoder. We'll use AVISynth to resize our file, and crop off any letterboxing. We resize our file, to reduce the resolution just a bit. This has the benefit of allowing us to use a lower encoded bitrate, while giving good quality. The standard width for XviD/DivX files is 640 pixels. The height will vary, depending on the Aspect Ratio of your source files (more on this later).

The first thing we want to do is open the D2V project file we created in Step 2, with AVISynth. We do this using the MPEG2DEC3 plugin we previously placed in our AVISynth 2.5 Plugins directory.

Open NOTEPAD by selecting the START button ( START -> RUN ).
Type in "NOTEPAD", and press enter, or click OK
Notepad should launch. This is what where we will write our AVISynth AVISynth script.
(note: This assumes you have a working install of AVISynth. If you have problems getting AVISynth running, please post your issue in the main forum)

Enter the following text into Notepad:

MPEG2Source("dvd2avi.d2v")

This is how we 'play' our DVD2AVI D2V project file we created earlier. We should now be ready to crop our video.
Save the file again (FILE -> SAVE). You can name the file anything you like as long as you give it an .AVS extension (example: "movie.avs" ). You should also include quotes around your filename as in the above example "movie.avs". This is to prevent Notepad from appending a .TXT extension to the file you save. Once you have saved the file, you can then drag and drop your new .AVS file onto Windows Media Player. We should see the video playing normally. Note that there will not be any audio at this point.
If your video has any letterboxing, you should now be ready to crop it off. (if your video has no letterboxing, you can skip this step).

For the beginner, this is easiest to do using VirtualDub. We're not going to actually crop anything in VirtualDub, but it has a handy GUI that will tell us exactly HOW MUCH to crop. If your video does not have any letterboxing, move on to Step 5.

Cropping: Open VirtualDub, and drag & drop your .AVS file onto it.
From the VIDEO menu, select VIDEO -> FILTERS. Note that the cropping button is grayed out (unavailable).
Click the ADD button, and scroll through the list until you find the 'Null Transform' filter.

Highlight it, and click OK.
We should now see our filter in the list and the CROPPING button will no longer be grayed out.

Click the cropping button.
Increase the numbers in the Y1 and Y2 dialog boxes. You'll see a gray area covering any letterboxing as you increase each number. Increase each number until the gray area just touches the edge of the video image area. It should completely cover the black letterboxing area of your video. Also ensure the number is an EVEN number. Note the numbers you have for Y1, and Y2 (we'll need those numbers in a second), and then click CANCEL.

For my encode, I have a Y1 value of 60, and a Y2 value of 60. These numbers don't necessarily have to match! Just ensure they are both even numbers (round to the nearest even number). Now open your AVS script in NOTEPAD again. We're going to input the CROP command like so:

MPEG2Source("dvd2avi.d2v")
Crop(0,Y1,0,-Y2)


You should replace the values Y1, and Y2 above with the values reported by VirtualDub. If VirtualDub, reported Y1 as 60, and Y2 as 58, then your crop command would look like this:

Crop(0,60,0,-58 )

Note that the last number ( -58 ) is a negative number. There are faster ways to crop, but for this tutorial, we'll stick to the longer (easier to read) versions of these commands. Your script should now look something like this:

MPEG2Source("dvd2avi.d2v")
Crop(0,60,0,-60)


(Note: There are filters out that will automatically remove any letterboxing in avisynth with a simple command, which make this step very easy. I note this after the fact for those that want to 'cheat'. Search google for "avisynth and autocrop".

Step 4: Resizing Our Output
Last but not least, the command to resize our output. You should do this according to the aspect ratio of your source. If the DVD package reports that your movie is a 1.85:1 video, then you would divide our new target width of 640 pixels, by 1.85
( 640 / 1.85 = 345.94 ). If you don't know what aspect ratio your source video is, search GOOGLE with the Movie Title, and the keywords "Aspect Ratio", and "DVD". You should see quite a few links reporting what aspect ratio the DVD uses.

We then round our vertical HEIGHT to the nearest value that is divisible by 8. If your not sure, just plug values into CALCULATOR ( START -> RUN -> CALC ), until you get a value that returns a whole number. 346 / 8 = 43.25, so that won't work. 344 / 8 = 43, which is a whole number, so this is a good target height. We're going to resize our video to 640 x 344.

In case your lazy ;), here's a quick table of common aspects using a 640 pixel widths:
(table1)
2.35:1 video = 640x272 (Anamorphic Widescreen)
1.85:1 video = 640x344
1.78:1 video = 640x360 (16:9 reported on the Box)
1.33:1 video = 640x480 ( 4:3 Fullscreen video )


We can now plug these values into our resize command. We'll use the LancZosResize command, since it gives us a nice sharp output. My example video is 1.85:1, so I'll resize my output to 640x344. I should not that my sample video has no letterboxing, so for those of you trying to use this to specificaly convert Brother Bear, the CROP command is added only as an example ;). I would normally have skipped the CROP step as detailed above since my examle source has no letterboxing. Open your AVS script in NOTEPAD and type in the LanczosResize line, entering in whatever values you needed from table 1 above:

MPEG2Source("dvd2avi.d2v")
Crop(0,60,0,-60)
LancZosResize(640,344)


Save your .AVS file (FILE -> SAVE), and again, preview it in Windows Media Player. We should now be ready to encode this in VirtualDub. Close Windows Media Player.

Step 5: VirtualDub (1st Pass)
Drag and drop your .AVS file onto VirtualDub.
Set your AUDIO menu to 'No Audio'
Set your VIDEO menu to 'Full Processing Mode'
Select VIDEO -> Compression
You should be prompted with a list of available codecs. Find XviD in the list. It should be near or at the bottom of the list.
Highlight it, and then select the configure button

The settings here are for version 1.1.0 (the images may be from an older version as I do not update them as often). Be aware that sometimes you may see settings mentioned that do not appear in the XviD images below:

Configure your screen so it resembles this one. We'll start with the Profile @ Level setting.
If your using a newer version of the XVID codec, you can use the Unrestricted Profile. If your going for DivX player compatability, use the L5 profile.
(Profile @ Level:) = AS @ L5 - Click the MORE button to the right of this setting)
The profile settings has three tabs. I'll list of the settings for each tab.

PROFILE TAB:
Profile @ Level: AS @ L5
Quantization type: H.263 for 1 disc xvid or MPEG for 2 disc xvid output
Adaptive Quantization: checked reduces quality slightly for better compressability..two disc sets can typically leave this unchecked)
Interlaced Encoding: Checked ONLY if your source is interlaced
Quarter Pixel: Leave this unchecked for compatability or checked for better quality. This doubles your motion search precision from 1/2 pixel to 1/4 pixel precision, but it does have some overhead. Depending on the video source, it could theorectically cause a reducution in quality. I've found it always produces better quality when turned on in my encodes.
Global Motion Compensation: Leave this unchecked for better compatability). Great idea, but not alot of support. If your not worried about compatability with DivX players, then leave this checked.
B-VOPs: Checked
Max Consecutive VBOPs: 2
Quantizer ratio: 1.50
Quantizer offset: 1.00
Packed bitstream: checked
Closed GOV: checked

I've been asked about the quantization matrix to be used. I've decided to expand a section here to hopefully better explain how they effect your output.
The MPEG matrix is designed for projects that have a higher bitrate output. It allows for finer detail at the cost of compressability. It should be used on 2 CD output, or for short video's that are targeted for 1 CD.
H263 should be used only for 1 CD projects or for long video projects (those approaching 3 hours on a 2 cd set). This is due to the fact that the H263 matrix encodes less fine detail, which increases compressability. If your creating a 2 CD XviD, you can typically use the MPEG matrix since you are using a higher bitrate. If space is a premium, choose the H263 matrix, as it will contain less detail, but allow a higher compression ratio. (In short..MPEG = more detail, bigger size and H263 = less detail but higher compression). When in doubt, simply encode a small sample using your target bitrate, and compare both matrices to see which you find acceptable. Using either matrix will not affect compatability, as both are fully supported under the DivX standard.

LEVEL tab, and the ASPECT RATIO tab:
Should both be left on their defaults. LEVEL will be set to AS @ L5 since we configured it that way on the main properties page, and the ASPECT RATIO tab should be set to 'Pixel Aspect Ratio' (Square)
Click OK

Click the MORE button next to 'Encoding Type' (Encoding type should be set to 'Twopass - 1st pass')
Click the button next to 'Stats filename', and browse to your project directory.
Change the Stats filename setting from the default of "\video.pass" to ".\video.pass" (without the quotes of course). This is only necessary the first time you configure your codec. It will save your setting for future sessions. This will cause the encoder to place the .pass file in your project directory.
Full Quality First Pass: Unchecked
Discard First Pass: Checked
Click OK

Back on the main codec configuration screen, examine the ZONES are to see if any zones have been defined. If you do use a defined zone, I would suggest you use the following settings (accessed via the Zone Options button):
Start with frame: 0
Weight: 0
Begin with keyframe: Checked
Grayscale Encoding: Checked ONLY if your source is black and white
Chroma Optimizer Enabled: Checked
BVOP Sensitivity: 0

You can delete the zone without an issue. They allow you to 'custom' encode any targeted section of your video. With a zone you could give a high action scene more bitrate for instance. You can usually leave the zone setting at default. I just delete it.

Last but not least, click the 'Advanced Options' button at the bottom of the main screen (see circled above):

Motion tab:
Motion search precision: 6 - Ultra High
VHQ mode: 1 - Mode Decision (faster) or 4 - Wide Search (best quality - slower). I suggest 6 for motion search and 4 for VHQ Mode
Use VHQ for bframes too: Checked
Use chroma motion: Checked
Turbo ;-): Unchecked
Frame drop ratio: 0
Maximum i-frame interval: 300 for 29.97 output, or use 240 for FILM 23.976 fps output.
Cartoon Mode: Unchecked (unless you are encoding anime or cartoon video)

Quantization Tab:
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: Checked

Debug Tab:
Automatically detect optimizations: Selected
FourCC used: XVID
OutputDebgString debug level: 0x0
Print debug: unchecked
Display Encoding status: Unchecked
Click OK

Click OK again. You should be returned to the VirtualDub codec picklist.
Click OK
On the main virtualdub screen, select FILE -> SAVE AS AVI
Browse to your project folder, and type in a name for your AVI (my example will be brother.avi )

Be sure to place a check in the "Don't run this job now" checkbox at the very bottom of the save dialog (see circled above)
After typing in a name for your avi, and checking the Don't run this job now option, click SAVE.

Step 6: VirtualDub (2nd Pass)
Now we need to configure the second pass in VirtualDub. We will make changes ONLY to the codec settings. No other settings should be changed at this point.
Select VIDEO - COMPRESSION, and browse to the XVID codec in the list.
Highlight XVID, and then click the CONFIGURE button.
Change the 'Encoding Type' setting to 'Twopass - 2nd pass'

Use the MORE button to the right of the TwoPass - 2nd pass setting to look at your 2nd pass settings. I use the following:

Stats filename: .\video.pass

Intra Frames Tuning
I-frame boost%: 10
I-frame closer than: 1
Are reduced by: 20

Overflow treatment
Overflow control strenth: 5
Max overflow improvement: 5
Max overflow degradation: 5

Curve compression:
Hight bitrate: 0
Low bitrate: 0

We must now decide how large we want our output to be. We do this by calculating the size of the Audio file (this file shoudl have been created by DVD2AVI in your project folder), and the size of our video file. If our example Brother Bear used AC3 for audio, and my AC3 audio file was 285,951,232 bytes
(note: you can find this value by right clicking the AC3 or MP2/MPA file in Windows explorer and selecting FILE -> PROPERTIES).

If your not interested in making your DivX fit onto any particular media, then click the TARGET button until it reads 'Target bitrate'. I would suggest you set this no lower than 800 kbps (900 is better). If you want to make your project fit on a single, or multiple CD's, then click the TARGET button until it reads 'Target size (kbytes)', and then click the CALC button.
If you want your XVID file to fit onto a single 700 MB CD-R disc, select 716800 (665,600 for a 650 MB CD-R_.
If you want your XVID file to fit onto two discs, just double the above values ( 716800x2 = 1433600 ). You can just type these values in if they are not listed. I would suggest two discs if your video's length is longer than 1 1/2 hours. Another thing to consider is the size of your audio (see AUDIO below)
Format: AVI-OpenDML
Video Length: Type in the appropriate values here. Ensure you select the right framerate.
If your project was FILM (you left FIELD OPERATION on 'Forced Film', select 23.976.
For PAL sources, select 25.0
For true interlaced NTSC (forced film was set to NONE with an NTSC source), select 29.97.

AUDIO:
Set the FORMAT for your Audio file (this is pretty self explanitory. If you plan to use an AC3 file exported from DVD2AVI, then set this to AC3. The same for MP2 or MP3 audio.
(note: You can convert your audio to any format using BeSweet. Check the GUIDES section for help with BeSweet)
For our examle, we're keeping the 5.1 AC3 audio from our DVD, so I set our Audio Format to AC3.
(two example 2nd Pass Configs. Left = 1disc, Right = 2disc)

You can select 'Size (kbytes)' for your audio file, and then click the browse button. This will plug in the size of your audio file for you automatically. Do this now. Now note the Average bitrate being displayed (see blue circled area above). If it's less than 800-900, then definately consider moving your project so it fits onto 2 CD-R's. In this case, my project is showing that my video bitrate would be only 696 Kbps, so I'm going to change my settings so it fits onto 2 CD-R's. I set my target size to 1433600, and note that my Average Bitrag (right example, circled in BLUE above), now jumps to 1846. Much better.

This video is borderline in regards to making it fit onto a single CD. I could easily convert the audio to MP3 using BeSweet, and the reduction in size for my audio would easily allow it to fit comfortably onto a single CD-R with a higher average bitrate for my video (less space taken by the audio means higher bitrate for the video). Use your own judgment here as to what formats and space allowances you want to use. I typically never let my video bitrate go below 900 or 800 in a pinch.

Click OK to reutrn to the main XviD configuration page.
Click OK again to return to the VirtualDub CODEC list.
Click OK to return to the VirtualDub main page.
Select FILE -> SAVE AVI, using the exact same filename, path, and checkbox option (i.e. ensure that the 'do not run this job now' option is CHECKED). and click SAVE.

Your now ready to start the encoding process. Click F4, or select FILE -> Job Control.
You should see both 'passes' listed here, Just click the START button, and let it run until completion. When it's finished, you will have an AVI with no audio, and your original audio file (AC3, MP2/MPA, or whatever format DVD2AVI extracted.

Step 7: Muxing your Video and Audio
If you have VirtualDubMod (v1.5.10.1), then you can mux the audio and video with that version. If you do not have that version, then you can use NANDub to mux the video and audio.
Open your VirtualDubMod or NANDub, and drag and drop your new AVI onto it.

Depending on which software you want to use, to multiplex your audio and video (NANDub, or VirtualDubMod), do only one of the following below:

If your using VirtualDubMod:
From the Streams menu, select STREAMS -> STREAMS LIST
Click the ADD button and browse to your audio (AC3/MPA/MP2/WAV/MP3, etc) file. Select it and click ok.
From the Video Menu, select 'Direct Stream Copy'.
From the FILE menu, select FILE -> SAVE AS and input a new AVI filename.
The SAVE AS dialog on this version has a few checkboxes and options:
All the checkboxes should be UNCHECKED.
Ensure VIDEO MODE is set to DIRECT STREAM COPY
Click OK. Your final AVI should be complete in a few minutes.

If your using NANDub:
From the AUDIO menu, select the type of audio to mux with your video (AVI/WAV/MP3/AC3/OGG), etc). When prompted, browse to your audio file.
From the VIDEO menu, select VIDEO -> Direct Stream Copy
From the FILE menu, select FILE -> SAVE AVI.
Input a new filename and click SAVE.
Click OK. Your final AVI should be complete in a few minutes.



graysky posted 2004 Sep 12 06:45
Great guide man! I have one question for you: after completing step 2, I was left the demuxed files as expected; however, their filenames imply a delay of 49 ms. Here is the content of my work dir:

:
DVD2AVI.d2v
DVD2AVI DTS T02 DELAY -49ms.dts
DVD2AVI AC3 T03 3_2ch 384Kbps DELAY -49ms.ac3
DVD2AVI AC3 T01 3_2ch 448Kbps DELAY -49ms.ac3

Do I need to account for this 49 ms when muxing to avoid sync errors? My plan is to convert the dts or ac3 to ogg and mux with avimux_gui. Thanks!

----

EDIT: nevermind, found an optionin oggmachine that answered my question



Suntan posted 2004 Sep 12 09:52
@DJRumpy

Good guide. This is definitely the way to go (although not the easieast) for the best quality encodes (if only because it opens the encoders eyes to the unlimited capabilities of AVIsynth).

2 suggestions: 1, I would suggest noting that the MPEG (vs H263) quantization would probably be more useful for 2 CD rips. 2 Possibly adding a note that if you encounter playback problems (as many people are using standalone DVIX players) would be to test without each of these unchecked: Packed Bitstream, GMC, Adaptive Quants.

@graysky

My preference for encoding AC3 to Vorbis is Headac3he it will automatically compensate for offsets, just FYI.

-Suntan



winifreid posted 2004 Sep 12 10:01
Have you found that the quality is better than Fairuse or AutoGK at the same file size? Fairuse and AGK are certainly much easier.


DJRumpy posted 2004 Sep 12 10:59
Suntan, I don't have a divx capable player (I use a media pc), but I'll certainly add those in. No complaints as of yet, but it can't hurt to add a warning or two.

winifreid, I simply use what I like. Easier is not always better ;). I find total control over what I'm doing preferable to a one-click solution. Some people don't want to get their hands dirty, and certainly don't want to know the details. If that's the case, then this guide is not for you. Simply use what you like.



winifreid posted 2004 Sep 12 11:12
Could you answer the first part of the pot? I didn't say I wouldn't use your guide. But if it doesn't produce a better product, why bother? Clearly there are things that FU and AGK can't do.


DJRumpy posted 2004 Sep 12 11:16
I did, albeit indirectly. I don't use one click solutions, and have no interest in trying them. Also, quality is a completely subjective thing. What I find appealing, you might find unacceptable. This is one of those things you have to do for yourself, and see if you like the results. ;)


Suntan posted 2004 Sep 13 10:03
@winifreid

As DJRumpy said, I prefer total control, vs one click as well. Mostly because I am a picky bastard. Also, once you understand everything and have everything setup it really isn't much more than copying an AVS script into your new project directory (from your last encode) and changing a few likes of text. I rarely buy more than one DVD a month (as few are worth seeing more than once, imo) so the added time is minimal.

Yes AGK (which actually use AVIsynth behind the scene) and FU give great results, but they are pretty much one size fits all. As with anything that is osfa it can not handle everything always. For example, my wife was feeling nistalgic and bought "Dumbo" awhile back. The film grain is horrible on that (although that is how the movie was made back then) never the less, it is a killer on space and encode quality. With manually setting up AVIsynth you can add a bit of Undot, Peachsmoother and a touch of Temperal Smoothing with three lines of text and it will clean up the grain greatly. You can't do that just by starting up AGK. Another is the copies I make for my IPAQ, I normally add a bit of undot and temporal smoother to all movies to soften it up and aid compressability. The beuty is I can tweak everything to get it just the way I want it.

In short, if you are happy with AGK then I would only suggest trying this if you want to learn something new. It is not going to reduce encode size by half or anything, but it will allow you to get last 2/10ths out of each encode if you set it up properly.

-Suntan



winifreid posted 2004 Sep 13 11:20
Thanks Suntan, I was really just curious if the settings in this guide produce better video at the same file size. I don't mind more steps if there is a reason. One reason I see to use this guide is that AGK and FU have input restrictions. And I still haven't gotten AGK audio to work. This guide has helped me understand xvid and virtualdub better. I just used FU to convert a DVD to a 1 cd xvid. It looks great at 100 minutes long. Properties indicate that it is 576x384 and is 12 bits at 118KB/sec. I capture some video from cable at 720x480 picvideo. It looks fine. I used your settingis for xvid in vdub to convert to xvid, but it looks very pixalated. I resized to 576X384 and used a bit rate setting of 118. The properties of that file indicated that it was 24 bit and used 84KB/sec. I would like to fit about 100 minutes of captured video and audio on 1 CD. What settings should I use? I don't see why the FU produced video was 12 bits unless it was becasue it used a lower framerate (Film?).
Thanks



winifreid posted 2004 Sep 13 11:39
I downloaded MPEG2Dec3v110.zip; is this the correct version? Also, there is a thread on Doom about problems using this, but I assume this version fixed any them.
Thanks



absinthecarolinas posted 2004 Sep 13 11:59
Hey DJ,

Great guide, as usual. I've been using it for a while now and can pretty much make my XviD's with my eyes closed by now :).

But up until now I've just been making 1-disc encodes of episodic-type things. Now I want to do a full-length movie encode, and I'm wondering how exactly to go about splitting the file in 2.

I mean, you don't split your audio file, do you? I suppose one could just load the whole AVI into VirtualDub(Mod) and do a direct stream copy on each half ... but that seems rather inexact as far as getting the file sizes as close to 700 MB as possible.

Is that how you would go about it ... or is there a better way you would recommend?

Thanks, :D

-abs



chinapoppi posted 2004 Sep 13 13:57
Excuse me, DJ~


Am I missing something here, but following your method--produces a quirky, fast-moving 64meg Xvid video (without Audio steps done yet)~

I was a bit worried, since the encoding time only took 20minutes for the VOB-to-Xvid steps~

BTW; I did not do the Avisynth "steps"--since I do not quite understand the scripting steps, but I did manage to make the .AVS document (that was seen by VirtualDub--in order to make the Xvid transition)

Is there something I missed~?


Can anyone tell me how to do a straight VOB-to-Xvid conversion (without avisynth) using VirtualDub? I cannot seem to find any other tutorial using tool~



Please help me! :?:



winifreid posted 2004 Sep 13 14:48
You have to have Virtualdub-mpeg ($) so that vdub can recognize the mpeg (I think). It happens to be what I am doing while I write. You would then open the vob with vdub-mpeg and follow the settings described above for xvid. I am not sure how you would determine the bit rate since you would have to do it for each vob. Unless you want to the original audio format, you will have to demux and convert the audio seperately.


DJRumpy posted 2004 Sep 13 14:59
absinthecarolinas, you can use VirtualDubMod to save your AVI in 700 MB segments. Just make sure you get the bitrate right for a two disc set. The codec comes with a built in calculator. Just hit the 'calc' button in the codec properties. I'd leave yourself a few megs buffer under the 700 MB limit though.
:
BTW; I did not do the Avisynth "steps"--since I do not quite understand the scripting steps, but I did manage to make the .AVS document (that was seen by VirtualDub--in order to make the Xvid transition)

chinapoppi, you cannot simply leave steps out and expect it to work, unless you know exactly what your doing, and how to compensate for the missing steps. Unless otherwise stated, it's pretty much an all or nothing effort. That said, as far as I know, you cannot open D2V files with VirtualDub, and you certainly would NOT want to open the VOB directly if it was telecined (very likely if it's an NTSC DVD). You would end up encoding extra, unecessary frames and wasting bitrate. Attempting to perform inverse telecine in VirtualDub would work, but it's not as exact as the method in DVD2AVI. DVD2AVI gets the pulldown information directly from the horses mouth, so to speak. VirtualDub has to guess.

You should always use DVD2AVI if your source is telecined. See if you can find a D2V import filter for VirtualDub if you insist on using it instead of AVISynth. That way you could open the D2V file directly in virtualdub.

Optionally, it's a rarely discussed fact which would seem obvious, but many just miss the fact that DVD2AVI can indeed give you AVI output, including DivX, XviD, etc. I've never tried multipass, but it should work. It would simply be a matter of saving the first pass, and then manually saving the second pass. Just select FILE -> SAVE AVI. Type in a destination filename, and when prompted, pick the XviD codec, and then click the CONFIGURE button to configure your settings for the codec.



Suntan posted 2004 Sep 13 15:54
@chinapoppi

You really do need to do the AVIsynth step. It is (imo) the easiest and most important step of the process (although all steps are required) once you know what you are doing. Follow his Howto, and you will soon see how simple it is (the hardest part of AVIsynth is to get it installed with any 3rd party filters put in the right folders - which isn't that hard, if you have already managed to rip the DVD and creat a d2v file.)

-Suntan



graysky posted 2004 Sep 13 18:28
:
ast but not least, the command to resize our output. You should do this according to the aspect ratio of your source. If the DVD package reports that your movie is a 1.85:1 video, then you would divide our new target width of 640 pixels, by 1.85


Is there another way to derive this ratio? What if, for example the DVD does not report this? Also, if I am encoding an MPEG-2 stream (from a TVio for example), and I wish to crop/resize. How can I derive this ratio?

Thanks!



DJRumpy posted 2004 Sep 13 18:40
If your source is not from DVD (Tivo for example), then you will need to discern the ratio manually. You can do this by looking up the movie on the internet. A good method is to search google with the movie title, and the key words 'Aspect Ratio'. You'll quickly find a few hits that will report the movie's original ratio.

The problem with MPEG, is that the physical resolution has no bearing on the video's true resolution. Only 4:3 captures (non-hdtv) will have the correct aspect when captured. Those types of captures can be dropped into VirtualDub, and with the help of the crop tool, you can quickly determine exactly which parts are image area, and what the resolution of the image area is. You can find a bit more info here:

http://www.videohelp.com/forum/viewtopic.php?p=622650#622650

If your source is MPEG, and the MPEG has a 16:9 aspect flag on it, then you will need to either find the movies playback width, and then divide that width by the height of the video, or you can simply eyeball it. If your mpeg is 16:9, and the video is fullscreen, then the aspect is 1.78. If the video has the smallest trace of letterboxing, then it is most likely 1.85. If the video has about 10% of the screen using letterboxing, then it is probably 2.35. Remember that these are only for 16:9 video (widescreen). You can use AVICodec, or GSpot to find the aspect flag on the video if it's mpeg.

4:3 MPEG can just be divided in the normal way (width by height), unless it has letterboxing. If it does have letterboxing, then image area that is around 272 pixels high is 2.35. Image area that is around 360 is 1.85. Image area's around 385 pixels high are 1.78, and fullscreen is of course 4:3 video.

Read the resolution guide above for more details on how all of this works.



graysky posted 2004 Sep 13 19:15
Thanks!


graysky posted 2004 Sep 13 19:26
OK, so I read that thread you referenced, but there's still something I don't understand. What res to capture my video in... I've been using 480x480 but I usually resize to 512x384. Should I cap in 640x480? If so, do I need to up the bitrate? Currently is 5200 vbr. Aspect ratio is 4:3 since it's not HD.


DJRumpy posted 2004 Sep 13 19:42
I would capture at 720x480, and then resize to your target size (512x384), or simply capture in the resolution your going to resize to since the frame size is fairly large. For small format's like vcd and cvd/svcd, I usually capture at the largest size I'm capable of (720x480), and then resize to my desired target size. The reduction in size helps to eliminate noise. Your cramming more information into a smaller space and increasing the signal to noise ratio as a result.

As to your other question, yes, you should up the bitrate if you increase the resoution. The only exception is that if you have already exceeded the bitrate requirements of your capture, then you won't improve anything. You'll only increase the size. Make sure you do a few test captures at various different bitrates, for the resolutions your testing first.



graysky posted 2004 Sep 13 19:45
So what bitrates would you recommend at given resolutions? (I have a PVR-250 by the way).

480x480: bitrate = ?
640x480: bitrate = ?
720x480: bitrate = ?

Thanks for the suggestions!



DJRumpy posted 2004 Sep 13 19:53
I would need to know what format your capturing in. Actually, scratch that. I would capture at 9Mbps. If your pressed for hard drive space, assuming your talking about using MPEG2, I would go with 4-7 Mbps for an average, depending on the resolution you capture to.

If your capturing in MPEG-4 (divx/xvid/wmv), then I would suggest you start at 2000 Kbps for 480x480, and work your way up to 5000 kbps for the 720x480. Again, these are only if space is at a premium. Otherwise, use up to 9Mbps for the MPEG-2, and 6000Kbps for the MPEG-4.

Why introduce compression artifacts into your source when you don't have to? This assumes that you'll be re-encoding your material later on. If your trying to fit a particular video/capture into a particular format/# of discs, then you should capture at the max bitrate's above, and then re-encode, rather than trying to capture a 1-pass file with a low bitrate.

Single pass is, unfortunately, a necessity for captures. Because of this fact, scene changes, and high motion scenes suffer as a result. Give your capture plenty of bitrate. If your not sure, capture a high motion video (action movies are good for this), and examine individual frames for compression artifacts (blockiness). Keep turning up the bitrate until you notice none. Scene fades are also an excellent place to spot compression artifacts. This is the type of scene where the image fades out, to be replaced by a new one. Unfortunately, the very fact that your capturing live, means your somewhat at the mercy of your broadcast material :(



graysky posted 2004 Sep 13 20:04
Capping to MPEG-2... 9000 kbps?? Isn't that overkill? Also, if I continue to cap to 480x480, I think resizing to 512x384 is fine from that resolution isn't it? I have been doing it for a while now with no ill effects.


graysky posted 2004 Sep 13 20:10
Hey, one other question about cropping. Some TV shows are 'presented in wide screen' which means they have black bars above and below like a DVD. My question is, should I crop the video to remove these black bars? What, if anything, do I gain by doing so? Also, will I distort the image by doing so (say 50 pixels off the top and 48 pixels off the bottom).

Thanks again!



absinthecarolinas posted 2004 Sep 13 22:53
DJRumpy :
absinthecarolinas, you can use VirtualDubMod to save your AVI in 700 MB segments. Just make sure you get the bitrate right for a two disc set. The codec comes with a built in calculator. Just hit the 'calc' button in the codec properties. I'd leave yourself a few megs buffer under the 700 MB limit though.


Hi DJ,

Yes, I'm familiar with the calculator. But I'm assuming (I say 'assuming' as I haven't done this yet) that calculating a movie for 2 discs will yield one single file which should be about the size of 2 CDs (once you add in the audio).

But that's my question ... the audio. Whether I have only 1 big AVI or 2 smaller ones, either way I definitely have only 1 audio file. Let's say for instance it's an AC3 file. Somehow I've got to split it, either before I mux it or after. In order to keep audio in sync with video, it seems that surely you'd have to mux it in before you split the file.

Not to mention that what I'm encoding is a series of cartoon-ish "episodes," so I'd want to split the two files in between 2 episodes (i.e. a manual split).

So wouldn't the easiest, or even the only, way be to encode 1 long file (using the calculator for length of course), then add in the audio, and then split manually in between episodes at a point very near 700 MB (which I guess I would just have to "eyeball") ???

Am I making sense? :shock:

Thanks, as always!

-abs



DJRumpy posted 2004 Sep 14 15:30
You simply mux your audio into your AVI, and then save it with VirtualDubMod. With Mod, you specify the max file size, and end up with two tidy avi parts, with sound.

A quick breakdown...

1) Figure bitrate (with audio) using calc, for a two disc set (700x2= 1400 MB).

2) Make it 10 MB less to give yourself a wee bit of room (1390 MB).

3) Goto online conversions.com and convert the MB to kbytes.

4) Encode your file using the bitrate specified by calc.

5) Mux your audio into your new AVI

6) Open AVI in VirtualDubMod, and save as new AVI (using DirectStreamCopy), and specify the max filesize as 696 MB.

You end up with two AVI's. Each about 696 MB, and with sound intact.



Suntan posted 2004 Sep 14 15:57
@absinthecarolinas

You can just mux directly in Vdubmod. Open the video stream then go to the "streams" tab and then "Stream Processing" (at work/from memory sorry if the names are wrong) then "add" and select the audio file.

Then hit F7 and give the movie a name, select the max file output look at the boxes below where you put the name in and you should be able to figure it out, (make sure you are set to direct stream copy) and save.

@graysky

Another good place to get info for DVD movies is from Amazon.com. Search for the DVD and they give you all the info like aspect ratio, release date, runtime, brief review etc. That is what I use when I put the info into myTHPC.

Also, the advantage of cropping the black bars from an encode is that that dramatic step between the all black and the moving color picture takes a huge amount of data to represent, even more so if it occurs on an intrablock (not multiple of 16 from the top). However, your playback device may or may not display it correctly depending on what you use. If you can crop the black bars and still get the correct playback do it.

-Suntan



absinthecarolinas posted 2004 Sep 14 18:19
Thanks for tips ...

Yes, I've always muxed in VDubMod, but I've always used AC3 audio. I was planning on trying VBR mp3, which VDubMod of course coughs on ... but I've figured out that Nandub is the tool for that.

Anyway, ya know after I transcoded my audio to VBR mp3 (avg. bitrate 192), the file was actually bigger than the original AC3.

Which brings me to my next question ... If the AC3 audio is available, why do people use MP3 audio at all??? What are the advantages? Is there lower overhead in muxing or something? There doesn't seem to be.

-abs



DJRumpy posted 2004 Sep 14 19:48
If your two files were both the same bitrate, then they should have been relatively the same size, plus or minus minor variations due to header information. MP3 has a higher compression ratio than AC3, which is why it's more popular. MP3 is capable of higher compression, while retaining the appearance of audio quality. It simply uses more advanced techniques to remove audio that can't easily be heard, audio that is cancelled out by other frequencies, and frequencies that are outside of the normal hearing range. These allow it to use a lower bitrate, while still sounding good. AC3 is geared more towards quality, with less emphasis on compression. AC3 also allows more than 2 channels. The original MP3 standard does not. That's why AC3 is better suited to DVD audio, while MP3, being more portable, is better suited to the internet.

In regards to your letterboxing issue, the existence of letterboxing should not effect your encode due to dramatic color changes. XviD can detect chroma changes, as well as motion. Although sharper edges are more difficult to encode, since letterboxing doesn't change between I-Frames, your only encoding the differences, which are essentially 'none' between I-frames. They are removed simply because they are required to create a standard 4:3 or 16:9 frame size. They contain no useful data in regards to a PC. They also take up bitrate, albeit a small amount (even black pixels require bits to encode..the color is pretty much irrelevant as long as it doesn't change from frame to frame). Even though the image area in letterboxing may not change, each I-Frame requires that a new snapshot be taken, and bitrate used accordingly. Xvid could technically have any number of frames between I-Frames, although most would don't go over 300. Minimal bitrate is wasted, however, when converting to AVI formats, you should always remove any letterboxing without question. Letterboxing is required by a 4:3 television to properly display widescreen content, and by a 16:9 tv, to properly display anamorphic widescreen, without distorting your video. Think of them as place holders only. These place holders aren't necessary for a PC, since it can letterbox your video on the fly during playback.

In regards to playback issues, you would be hard pressed to find any player which doesn't properly represent an AVI, which has been properly encoded, since AVI's are encoded as 4:3, and played back as such. They are a digital format, designed for a computer, and until recently, all computers used 4:3 displays. Although that is only now beginning to change, aspect tags in AVI's are not widely supported.

Just crop your AVI's letterboxing, and resize it to the proper aspect (as seen on a 4:3 display), and let the PC manage the rest. ;)



hhhhbk posted 2004 Sep 14 21:09
winifreid :
Have you found that the quality is better than Fairuse or AutoGK at the same file size? Fairuse and AGK are certainly much easier.


i used to go to all the effort of setting the programs up manually like described above
then someone turned me onto auto gk and it is great
with the hidden options you are able to get slightly more control over the encode


in terms of quality i cant notice the difference
autogk uses avisynth and virtual dub to do its processing so this didnt suprise me
the fact that it will create files of 700mb without you having to calculate the space for the audio and for the interleave of audio and video is great

timewise auto gk takes me about a minute to setup and about 4 hours to encode a 90minute dvd film to 700mb avi file with mp3 audio
whereas the old method involved about an hour of fiddling with the audio and avisynth etc and sttrangely seemed to take longer for the encode



DJRumpy posted 2004 Sep 15 04:30
hhhhbk, I'll ask that you do the same. This guide thread is not a forum to discuss the merits of manual vs auto methods. It is a guide. Posts in this thread should be specific to the guide iteself, with questions or problems related to the guide.

Please post your information elsewhere in the forum, or create your own guide regarding it's use. ;)



graysky posted 2004 Sep 15 04:42
:
LEVEL will be set to AS @ L5 since we configured it that way on the main properties page, and the ASPECT RATIO tab should be set to 'Pixel Aspect Ratio' (Square)
Click OK


Yet DJRumpy said that it should be encoded to 4:3? Is this what your meant DJR?



DJRumpy posted 2004 Sep 15 04:46
No, these two settings are different. The Level setting has no relation to the 4:3 aspect ratio. It is more specific to maximum resolutions and bitrates.


ballerstv posted 2004 Sep 15 10:55
Thanks for the great guide


graysky posted 2004 Sep 15 18:31
Got any suggestions for audio/video sync issues? One DVD worked perfectly (used AC3 audio). I repeated the process a second time and the audio is off by over 1 second.


DJRumpy posted 2004 Sep 15 19:22
Did you do anything differently on the second disk? Also, was the disc store bought, or a dvdr?


graysky posted 2004 Sep 16 03:21
As far as I know, nothing changed. It's a store bought disc.

Can this sync problem be because I selected "forced film" which forced the framerate to 23.976 fps when it should have been an NTSC which is 29.970 fps?



DJRumpy posted 2004 Sep 16 04:37
Not likly. Although it can cause choppy video, it wouldn't usually cause audio sync issues. Did DVD2AVI report an offset when it created your AC3 audio? (-xx ms in the AC3 filename).


graysky posted 2004 Sep 16 04:39
null post


DJRumpy posted 2004 Sep 16 04:41
The reported 29.97 is normal, and the standard for dvd video. If it reported Film 99%, then you did that part properly by using force film. What about the audio? (see my ? above).


graysky posted 2004 Sep 16 04:44
Framerate: 29.970
Video type: FILM 99%

Also, when I load one of the main movie VOBs in gspot, it reports 29.970 fps.

So why would I make it forced film if it's clearly 29.970 fps? FILM is 23.970 fps. Is this an error in the guide?



graysky posted 2004 Sep 16 04:44
To answer your question: yes, -66 ms. Seems like it always reports an offset with anything (DVD or MPEG-2 from my PVR). Do I need to account for this somewhere in VDM if I simply add the ac3 stream to my avi once it's encoded?


DJRumpy posted 2004 Sep 16 04:47
Yes. You AC3 Delay Corrector to fix the offset. Although 66 ms wouldn't account for the second delay, it would cause a slight offset.


graysky posted 2004 Sep 16 04:50
ok... what about my other question regarding the framerate? If it's 29.97 native format, why would I force it to film which is 23.976?


DJRumpy posted 2004 Sep 16 04:52
Because, the mpeg's true framerate is 23.976. The mpeg is encoded with pulldown flags. Everytime an mpeg player hit's one of these pulldown flags, it tells the player to repeat a frame. It basically converts it from 23.976 to 29.97 fps on the fly during playback, but it's true 'internal' framerate is still 23.976. That is why DVD2AVI is reporting FILM, instead of NTSC.


graysky posted 2004 Sep 16 05:02
Cool... thanks for the information and the time you invested in your guide. It's very cool. I might try to make a guide based on this one you wrote if you don't mind.. I've been meaning to replace my aged DVDx guide on my own page. Once I master this process that is!


DJRumpy posted 2004 Sep 16 05:06
Not at all. The more guides, the better.

Let me know how your audio turns out. It should be a simple matter to correct the delay, and remux the ac3 with your XviD file.



graysky posted 2004 Sep 16 15:18
After following the guide as I did before, I get the same 1-2 sec of sync problem with the audio/video streams. ...is there a setting in DVD2AVI that could cause this to happen?

The DVD source is in sync. Here's the procedure I followed:

1. Ripped the DVD
2. Created the dv2 file
3. Created the script (just cropped and resized)
4. Encoded to XviD
5. Used Ac3 Delay Corrector
6. Muxed the AC3 witht he video in VDM.

Ideas anyone?



DJRumpy posted 2004 Sep 16 16:05
None here, unless your source mpeg has some mastering errors. Not unheard of, but rare. Since the only thing that has changed is your source, I would have to suspect that first.


graysky posted 2004 Sep 16 16:44
It's that damn movie, "Twisted." I've tried this twice now and twice I have the same result... it has to be something I'm doing wrong.


DJRumpy posted 2004 Sep 16 19:56
Not necessarily. Store bought dvd's can be flawed too. The problem shows up when you split (demux) the audio from the video. That's when sync is lost. Is it a general drift, or an abrupt change somewhere?


graysky posted 2004 Sep 17 04:30
Seems to be off by a constant value... too bad there's not some sync tool out there...


DJRumpy posted 2004 Sep 17 04:39
If it is a constant value, and you have a stretching tool, you can break the audio up into it's 5 component waves (ac3 5.1 righ?), stretch each one so it's duration is exactly the same as the video, and then mux them back together into an AC3 audio file, but it's a lot of work.

Many of the higher end audio editors will let you timestretch your audio this way. Post in the advanced forum if you want to find a few. Personally, I'd see about getting another copy of the video. ;)



graysky posted 2004 Sep 17 11:48
I don't think it's the video... I just did another DVD and got the same result. I think it's something I'm doing wrong. Look at this:

Encoded avi file length: 2:18:42
AC3 stream length: 2:18:15

What's going on here?



graysky posted 2004 Sep 17 11:57
I think the problem is DVD2AVI for sure now... I cut out a little bit at the beginning of the movie this time and re-did the project.

I made my crop and resize script and played it in mplayerc:

Playtime: 2:17:59
AC3 stream length: 2:17:39

What the **** am I doing wrong?



winifreid posted 2004 Sep 17 12:08
I used AGK and got 32 seconds out of sync. I think it was the FBI stuff, which has no sound, that comes between the Company intro, which has sound, and the begining of the file. I was able to Vdub, audio interleving and add 32 seconds and fixed it. I think this must be it because when I encoded a single vob after the first, it was in sync. I think AGK uses a very similair method as this guide. I am assuming that your out of sync by a set amount and it isn not progressive.


graysky posted 2004 Sep 17 12:22
Now that you mention it, it could be related to each VOB. This time, I edited out the BS in the beginning and end. Now the AC3 and the d2v are the same run time. (This is getting me pissed) -- encoding to XviD now. I'll let everyone know when it's finished in about 4 hours.


BSR posted 2004 Sep 17 12:44
I have never had good sync luck cropping in DVD2AVI, especially cropping the beggining.


EDIT - sorry i see AC3 Delay corrector is posted above not reading very good today.



DJRumpy posted 2004 Sep 17 14:39
You shouldn't need to crop or trim you input. You shouldn't be opening anything but the main movie VOBs in DVD2AVI. The main movie vobs will almost always contain only the movie itself, possibly a quick movie studio logo at the beginning, and credits at the end.

If you drop extra/unecessary vob's into DVD2AVI, and they contain no audio, you could experience this problem. I've never run across it before, because I've never tried to keep the FBI warning ;)

I am confused though. You said this was a gradual loss of sync. The issue you describe should have been immediately obvious, even from the beginning of the movie.



graysky posted 2004 Sep 17 14:42
I never said it was a gradual loss, did I? The FBI warning has appeared at the end of 3 movies now in the main VOBs. 55% of pass 2 complete now.


winifreid posted 2004 Sep 17 15:12
The FBI/Interpol warning is part of the first, main vob and comes after the intro. I know some movies contain seperate vobs for the warning some don't.


DJRumpy posted 2004 Sep 17 15:34
Hmm. I must have misread your post, and assumed you meant gradual.

No need to worry about warnings at the end. They won't affect your final output at all.



graysky posted 2004 Sep 17 16:00
OK! I think DVD2AVI is writing invalid AC3 files! So far both Headac3h and AC3 Delay Converter are reporting problems:

Headac3h -
shows incorrect file length (in other words, the file length is susposed to be 2 hours long, but it's only 37 minutes)

AC3 Delay Converter -
WARNING> Filelength is not OK.
WARNING> Possible corrupted file or
WARNING> last frame is too short.

Any ideas anyone?



graysky posted 2004 Sep 17 16:05
Oh well: I have audio/video sync doing it the way I described several posts (in this thread) ago!


Suntan posted 2004 Sep 17 16:26
What rev of DVD2AVI are you using?

I still have not upgraded from 1.77.3dg as it works well and not all do.

YMMV

-Suntan



graysky posted 2004 Sep 17 17:16
The Help>about shows, "1.77.3 by LOLLJ"


DJRumpy posted 2004 Sep 17 17:22
You should be using a newer version. I'd suggest the latest from sourceforge. It's no longer called DVD2AVI though. They call it DGIndex (named for Donald Graft). Many bug fixes incorportated into it.

If you want to stick with the original code series, then find the 1.77.3dg1.1.0.



graysky posted 2004 Sep 17 19:32
Do you have a link? I can't seem to find 1.77.3dg1.1.0 anywhere... just a link that points to the newer version.


graysky posted 2004 Sep 17 19:38
Finally found the new version: dgmpgdec

Still can't find the one you suggested...



DJRumpy posted 2004 Sep 18 11:25
That's the one, or it should be...according to the help on mine, this is hte official website:

http://neuron2.net/fixd2v/decodefix.html

Note that you will need to update your MPEG2DEC for this new version. All of the files, including the updated mpeg2dec (it's now called dgdecode.dll), can be found using this link:

http://neuron2.net/fixd2v/dgmpgdec1012.zip

Note that you still use the same old command "mpeg2source". You should also remove any old mpeg2dec or mpeg2dec3 dll's from your plugins.



graysky posted 2004 Sep 18 15:30
Thanks, that's the one I've been using.


JMH posted 2004 Nov 27 07:48
Could anyone help me please? I have a problem running the avisynth script in media player. The following massage is and here is what i have done like in the guide. Step 1
Step 2..

The avi script played when i change the text to MPEG2Source("D:\Encode\dvd2avi.d2v") ?? is this okey?



DJRumpy posted 2004 Nov 27 08:24
What version of dvd2avi are you using?


JMH posted 2004 Nov 27 08:40
Im using the dgmpgdec1012 . I have done every step in he guide and when i come to the last part to save the file i got the Error: Statfile not found

Also in my vob files the audio dont seem's to be extracted (demuxed?) in avi2dvd...

And one more thing, if i want to crope X1 and X2 how do i write that in avisynth?



DJRumpy posted 2004 Nov 27 08:57
Either your trying to configure XVID for 2nd pass before you do the first pass, or your path to the stat file is incorrect. In the codec settings, next to Encoding Type, click the MORE button, and ensure you have modified the path for the Stat file correctly. It should be ".\video.pass" without the quotes. You can also check to ensure it actually created a video.pass file in your project directory.

Regarding your audio problem, I assume your talking about DVD2AVI, and not AVI2DVD ;) Make sure your audio menu is set to AUDIO -> DOLBY DIGITAL -> DEMUX.

To crop X1 and X2, you would simply increase those parameters using the LanczosResize Command.

LanczosResize(target_width, target_height, src_left, src_top, src_width, src_height)

You increase the SRC_LEFT value, and decrease the SRC_WIDTH to crop the left and right sides of your video. That sets the range of video to sample from the total with. If you start at the 10th pixel position, and take the next 100 pixels in width, from a video that was 200x200 pixels wide, you would sample 100 pixels of the total width, starting from the 10th pixel and taking the next 100 pixels in width. It would look like this

LanczosResize(150,150,10,0,100,200)[/b]



JMH posted 2004 Dec 01 12:25
I cant find AUDIO -> DOLBY DIGITAL -> DEMUX in my version of DVD2AVI,im using dgmpgdec1012...

I have entered the wrong path for the stat file :(



DJRumpy posted 2004 Dec 02 04:43
Sorry guy, I haven't had time to try out the new version. Try grabbing the older version from here, or doom9.org, and resave your project file. If the new version isn't supported, you can get those errors.


JMH posted 2004 Dec 03 06:52
looks like i dont have any audio :( i tried in Auto Gordian Knot but it says i dont have any audio and i cant select audio.. I have installed AC3 filter but i dont now what could be wrong :(


winifreid posted 2004 Dec 03 08:52
Go ahead and run AGK and see if besweet (part of agk) finds the audio. Mine always says I don't have audio, but it still works fine.


DJRumpy posted 2004 Dec 03 15:31
Open the file in AVICodec to see if you have all of the necessary codecs installed.


JMH posted 2004 Dec 08 11:18
I have fixed the problem now. I extracted the audio and encoded it with lame mp3 in Virtual dub mpeg2 and then i did as the guide said :D

thanks for the help people...



JMH posted 2004 Dec 10 08:49
I have a question. If my file tells me that i have 29.970 fps NTCS interlaced what do i choose in DVD2AVI?

Do i choose "If your Frame Rate is: 25.000 fps" (interlaced) or do i choose "If your Frame Rate is: 29.970 fps"

Its difficult because my files are both 29.970 fps and interlaced :D



Ultra_Immortal posted 2004 Dec 28 07:29
Well I am trying to encode Anime DVD's. They are NTSC DVD's region 1,2,4. I worked your guide basically, since I have been trying to encode with those tools for quite some time. The programs you use to crop and things I use different programs, but they do the same things :D . Now when I try and play back my .avi before I have muxed the audio, the .avi starts off fine, just to my liking, but later on during the video it will start to be fuzzy, I mean how do I explain. It looks bad, like the color went wrong. Also in some areas quite often it will like jerk/repeat the same scene again and again. Not like a whole scene, I mean like a 3 sec part of the video will take 5 sec, because in that 3 sec part it will play and go back a little and play and go back a little etc etc. So I am familiar with AVISynth. What filters would you recommend. When I get to the VirtualDubMod step, I add on an internal filter which makes my video look so much better. The Deinterlace Filter helps alot. But what external filters can fix my problems. I get the same problems with AutoGK. I don't like those one - click programs. I like this guide alot. Just that it would help to expose everyone more on the external filters and the capabilites of AVISynth. Then this guide would rock. :)

And if you are wandering I make .mkv files so I use AAC audio and mux that with my .avi. As well I make Dual Audio Rips. So I have 2 AAC audio files.



DJRumpy posted 2004 Dec 29 06:54
Hmm..I must have inadvertantly unsubscribed from my own guide :roll:

I haven't been getting e-mails to notify me when someone posts a question. Sorry about that.

To answer your question, if your video is true interlaced 29.97 fps, then leave the Force Film option OFF (unchecked). I always verify manually when I have a video that reports this. They are somewhat rare, but more common with sportscasts, news video, and live/cam video. Open the video AVS file in VirtualDub and manually step through the video frame by frame to see if each frame really is interlaced, or if it is a mix of progressive and interlaced. Try to choose a busy scene with a lot of action, as that makes spotting the interlaced frames much easier.

Ultra_Immortal, make sure our deinterlace filter falls before any other pre-processing filters. Usually you'll want to deinterlace almost immediately after you load the avi into AVISynth. Regarding your 'fuzzy' problem, can you post an example? That, and the repeating problem has me intrigued. A copy of your AVISynth script might be a good idea too.

Regarding your question about 3rd party filters, there are hundreds out there. Trying to post information on each would be a guide in itself. ;)



graysky posted 2005 Jul 04 06:54
Found a slight error in your guide:

In step 4 you teach that when resizing, one divides 640 by the aspect ratio and the resulting product needs to be divisible by 8. In your table, you still show 640x364 instead of 640x344.



DJRumpy posted 2005 Jul 04 10:04
lol..this guide has been up here forever. I can only assume they didn't he math themselves ;) I'll fix it.


adilkhan posted 2005 Aug 29 13:59
Hi People this post is really great and cool which i hav been searching for past 1 month and i find it really informative. as i wanted to back-up my orginal DVD's using Xvid codec into 700MB file each full with full same DVD quality video+audio. As i started using the steps given in it for .Xvid conversion i downloaded all the programms listed above and kept moving as it said and i hav come to a point where i m unable to pass through STEP :3. it says to type "MPEG2Source("dvd2avi.d2v") " this in a NOTEPAD and save.so wht name should i save the file with ? and where do i find the .AVS file to play in the media player . i m stuck in mid-way and need ur complete gentle assistment frm STEP:3 onwards.

I m a begginer and i hav been trying to convert my FINDING NEMO DVD movie to a .XVID movie of 700MB with excellent video and audio quality. So i kindly request u to explain me step-by-step with total ease frm STEP:3 to STEP:5.

Softwares i m using :
dvddecrypter 3.5.4.0
dvd2avi 1.77.4
AVISynth2.55
VirtualDub 1.6.10
Xvid 1.0.3-20122004 (Koepi)

System info:
Inet P4
512MB ram
80GB harddisk

Codec's installed : forceaspi17, ac3filter1.01

i would be very thankful to u if u could assist me online on yahoo or msn which would save ur valuable time and get me the right way ahead.
yahoo messenger : ad_hrt2003
msn messenger : mskhan_adil

Please do reply me as soon as possible i m waiting with my DVD2AVI.D2V file for further convertion. i also hav a question tht "HOW CAN WE ALSO ADD MENU OPTIONS TO THE .XVID FILE LIKE THE ORIGINAL DVD MOVIE ?"



DJRumpy posted 2005 Aug 29 14:31
You can name the file you save in Notepad in step 3 anything you like. Call it "MOVIE.AVS" for example. I've updated the guide since it did not include the info rearding what to save the file as.

Also, be careful that you do not put the quotes around your command lik eyou have above:

"MPEG2Source("dvd2avi.d2v") "

is not correct.

MPEG2Source("dvd2avi.d2v")

is correct.

As for the rest of it, try following the guide. I can't explain it any better than it already is in the guide itself.

Regarding your menu question, you can't use menu's with DivX. It is not like a DVD where you can have a play button, chapter buttons, ect. It simply plays in your player without those things.



BSR posted 2005 Aug 31 08:05
Adilkahn

Looks like the DIVX team is working on Menu software now.
http://forums.divx.com/groupee/forums/a/tpc/f/911101651/m/571105352/r/319107352
EDIT - hmm just checked again, it might already be out to create divx files like this, not sure about XVID compatibility though.

Also, I've read that if you put your XVID video in a MP4 container, you can have menus and such. Never done it, so can't help.
Info can be found at Doom9 - http://forum.doom9.org/showthread.php?t=62723

It looks like a lot of work even if it does work, but I guess this isn't the thread to discuss this.



Ashed posted 2006 Feb 08 14:40
My video and audio are also not synching too well. It is also off by 1 second. However, I've noticed it's not the audio that's the problem but it's the video that begins a second too late. I've compared the XviD with the original VOB and the latter one definitely begins a second faster. Any idea why this might be?

Also the length of the movie from the DVD (when open with PowerDVD) is 7 seconds shorter than the encoded XviD one. Why is that?



DJRumpy posted 2006 Feb 08 16:35
I can't help you with the PowerDVD problem. I'd suggest you check their webiste for help there. You should check the length of your avi in Virtualdub, and an OS player like Windows Media Player.

If the offset is all in the beginning, then you can offset the audio using the Audio -> Interleaving menu in VirtualDub. Just use a negative value to speed up the audio start. -1000 MS would be 1 second.

You can also use the Delayaudio() command in your AVISynth script to do the same. It's odd that your audio is offset only at the beginning, but the problem could have been introduced anywhere in the process.

Is the video length the same in the source and the AVI?



Ashed posted 2006 Feb 08 23:27
I played the DVD with VLC and the length of the movie is still 7 seconds shorter than the XviD created. :(


DJRumpy posted 2006 Feb 09 11:17
What, if any conversions did you use (pal/ntsc). Also, did you keep the audio as-is, or did you convert it to another format. Did the audio source extracted from the dvd have an audio offset reported?

Also, what script did you use?



Xad posted 2006 Mar 09 21:34
I'm trying to convert a home made DVD to XVid but i have quality problems.

I followed the guide however, the quality of the final video is quite pixelly. When i was going though the 2nd pass i set the bitrate to 2000. I tried setting the bitrate higher to like 4000 just to test it, but it seems the bitrate gets brought down (i see the average bitrate window going lower and lower).

Am i doing something wrong which is causing the pixelly video? I'm pretty sure i followed to guide correctly. Weird thing is when i do the single pass method (as in no stat file just straight conversion) at 2000 bitrate i get better quality - but i read that 2pass encoding is supposed to give MUCH better results.

Anyone know whether i'm going wrong somewhere?



DJRumpy posted 2006 Mar 09 21:42
That would depend on a whole variety of things, from your source's quality, to your settings. Also, is your DVD interlaced or progressive? What is the framerate? What audio bitrate does it have? Is your DVD actually DVD quality, or was it made from VHS, CAM, etc. You get the idea.

You need to supply more information.



Xad posted 2006 Mar 09 23:05
Hi, heres some more info:
Video source: Sony Digital8
Video Length: just under 1 hour
Framerate 25 fps
Interlaced
DVD Bitrate: 8000
Quality: Very good - however, it was transferred from a camcorder - even though it was digital8 the quality isn't as good as retail DVDs - but still good.

I'm not sure about the audio as its a DVD a friend made and i'm not 100% sure how to check properly, however, in GSpot it says "DVD_LPCM_AUDIO"



DJRumpy posted 2006 Mar 10 01:56
Ok, for the audio, your going to want to convert it to either AC3 or MP3 using BeSweet, or AC3Machine (or any other encoder you prefer). For your video, you need to ensure that you select "Interlaced Encoding" under the "Profile @ Level" settings. Also, make sure that your Maximum I-Frame Inerval is 250 (your frame frate times 10 or 25X10=250).

I think in your case, your audio is taking up all of your bitrate. PCM Audio is huge. Convert it to 128 bkps mp3 or ac3 and go from there.

2000 kbps for XviD is more than enough for even a noisy encode. It's possible your not following the steps properly so that when you save, your bitrate is not set properly. The bitrate option is only available for the second pass. It is not even an option for the first pass.



Xad posted 2006 Mar 10 21:55
I did a few test files and left the audio out so that i can see what the video looks like and i still get pixelly video quality. I set the i-frame to 250 and had interlace selected and stuff - but quality was still the same. I went over the steps again several times and i can't see anything that i've missed. Could it be that its just because of the quality of the video? I mean its not bad quality, every things nice and all as you'd expect - its similar quality to MiniDV quality - even though i'm saying its similar it is slightly different as it was encoded to mpeg to for dvd - but the bitrate was set to max when that was done.

BTW, i tried splitting the file so that no audio exists on the audio file, as in i had an m2v file only (just video) -- but i still get the same pixelly quality.

edit: is there any place i can download .vcf files that contain settings for virtualdub so that i can try those? Does anyone here have their settings save so i can try that without setting all the configs myself just incase i am making a mistake somewhere?



DJRumpy posted 2006 Mar 10 22:08
I would suspect your source quality isn't quite as good as you might think it is. You should examine the same frame in both your source copy (dvd) and the output AVI.

There is no reason that 2000 kbps wouldn't be enough to handle any normal sized AVI. What resolution are you resizing your AVI to?

About the audio: You don't really need to physically seperate your audio. I'm just suggesting you don't use PCM. Most people encode to XviD so that they can easily fit their video's onto smaller media like CD-R. The bitrate that you set when encoding your avi is strictly for the video. It has no bearing on the audio.



Xad posted 2006 Mar 10 22:27
I didn't select a target size instead i selected the target bitrate - which i set to 2000 and then higher - seems to keep coming down though.

I did a test and left the 2pass method for once and played around with single pass - i noticed that if i set the bitrate at 2000 a similar thing happens, however - if instead of setting a target bitrate i use the "target quatitizer" method and say set it to 3 - the bitrate value in the xvid status window is HUGE - like it shows it being converted at around 10,000kbps. Of course the quality turns out to be great, but how come the value is SO high if i set it to quantitizer 3? Its not like i set it at 1 or even 2. In the past when i've converted files, such as direct minidv file conversion to xvid, and i set the target quantitizer to 2 even, the bitrate wasn't even that high....from what i can remember anyway.

Could this be a clue as to why the quality is like it is?



DJRumpy posted 2006 Mar 10 22:34
Your avi's frame size (resolution) is either huge, or your video's quality is noisy, or your video has alot of motion/shakiness (think Blair Witch). What did you size your AVI to?


hoangle posted 2006 Jun 16 16:51
First of all, I have to say this method is the best in converting DVD to XviD even though it might be difficult for newbies. Thanks to DJRumpy

Some opinions:
1. Using DGMPGDec instead of DVD2AVI and replace "mpeg2dec3.dll" with "dgdecode.dll" (in DGMPGDec folder)
2. If users do not have AVISynth, they can demux VOBs in DGIndex to .M2V file and open it in VirtualDubMod (V1.5.10 or later). However, I prefer to use AVISynth :)
3. Using BilinearResize for shrinking and BicubicResize for enlarging. LanczosResize usually slows and sharpens video, so the output video size must be large to keep the quality, otherwise, blockies will appear in faces. (You cannot distinguish Lanczos with Bicubic (or Bilinear when shrinking) after compression :p).
4. Bitrate for 2nd-pass should not less than 60% of full-quality first pass
5. If video is interlaced, you should do deinterlacing before any filter. Smart Deinterlace Filter for VirtualDub is my preference.



trippy posted 2006 Jul 24 18:28
Thanks for the update hoangle. Useful info.


DJRumpy posted 2006 Oct 23 09:40
hoangle, Lanczos is simply more accurate, which when reducing, has the side effect of making the video appear sharper. Normally that might be a problem with a lesser format like CVD or SVCD, but clarity is de