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.
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:
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:
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:
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:
(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:
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:
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 @ 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.
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 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
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
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 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)
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
Automatically detect optimizations: Selected
FourCC used: XVID
OutputDebgString debug level: 0x0
Print debug: unchecked
Display Encoding status: Unchecked
Click OK again. You should be returned to the VirtualDub codec picklist.
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 control strenth: 5
Max overflow improvement: 5
Max overflow degradation: 5
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)
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.
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 (v188.8.131.52), 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.
+ Reply to Thread
Results 1 to 30 of 212
Impossible to see the future is. The Dark Side clouds everything...
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:
EDIT: nevermind, found an optionin oggmachine that answered my question
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.
My preference for encoding AC3 to Vorbis is Headac3he it will automatically compensate for offsets, just FYI.
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.Impossible to see the future is. The Dark Side clouds everything...
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.
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.Impossible to see the future is. The Dark Side clouds everything...
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.
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?).
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.
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?
-abs"The purpose of art is not the release of a momentary ejection of adrenaline but rather the gradual, lifelong construction of a state of wonder and serenity." --Glenn Gould
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!
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.
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.
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.Impossible to see the future is. The Dark Side clouds everything...
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.)
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
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:
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.Impossible to see the future is. The Dark Side clouds everything...
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.
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.Impossible to see the future is. The Dark Side clouds everything...
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 materialImpossible to see the future is. The Dark Side clouds everything...
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.
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).
Originally Posted by DJRumpy
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?
Thanks, as always!
-abs"The purpose of art is not the release of a momentary ejection of adrenaline but rather the gradual, lifelong construction of a state of wonder and serenity." --Glenn Gould
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.Impossible to see the future is. The Dark Side clouds everything...
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.
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.
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"The purpose of art is not the release of a momentary ejection of adrenaline but rather the gradual, lifelong construction of a state of wonder and serenity." --Glenn Gould
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.Impossible to see the future is. The Dark Side clouds everything...
Originally Posted by winifreid
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