Before we start, theres some basics that you need to understand.
Cropping is removing the black borders from your rip as spud describes:
It is vital to crop off all black borders when encoding for many reasons. Firstly, and most importantly, encoding with them present wastes a chunk of video data on the useless black space that isn't needed with MPEG4. By leaving the borders on a rip and encoding, you can not achieve maximum quality that you could achieve, as xvid is unable to determine between picture and the surrounding black space, allocating the bits to represent the useless part of the picture. Secondly, and with the first at the front of your mind, the borders serve no purpose other than to reduce the quality of the encode in MPEG4. They are present in MPEG2 purely to maintain aspect ratio, but this data is stored within the container head with MPEG4. They are there on DVDs to maintain an AR, but this is not needed with xvid codecs which will resize and render necessary borders on the fly. You should therefore crop out every single black pixel surrounding the frame, to ensure your bits are allocated where they are needed
How to avoid
You should always remove the black borders that surround the video when ripping a movie. To do so, they must be cropped off right up to the picture's edge.
Interlacing is best described as your DVD is made up many more frames per second than you think. Say you have a PAL DVD youd think it has 25 fps but actually it has 50 & if you ripped it without de-interlacing you will end up with what can only be described as a comb effect in your picture.
Bad/Lack of proper De-interlacing.
What is Interlacing?
A video display technique in which the electron beam refreshes (updates) all odd-numbered scan lines in one sweep of the screen and all even-numbered scan lines in the next. Interlacing takes advantage of both the screen phosphor's ability to maintain an image for a short time before fading and the human eye's tendency to average subtle differences in light intensity. By refreshing alternate lines, interlacing halves the number of lines to update in one screen sweep.
Basically its a trick that doesn't show up on tvs to display an image by quickly flashing images on the screen. However, with more sophisticated viewing devices on PCs, this means interlaced sources are terrible to watch (see the following examples), or more accurately unwatchable. You *must* always apply a deinterlacing filter when ripping to avoid this symptom in interlaced sources. Otherwise the following examples are what is shown when watching:
So we are going to do a very basic rip with gordian knot whilst cropping & deinterlacing to get the best results.
Start gordian knot up & you begin with this screen:
Step 1 is for copying your DVD to your hard drive into a folder which you can do with DVD Decrypter yourself, but dont forget to set it to decrypt in File mode. I'm not gonna explain this bit as theres hundreds of guides for DVD Decrypter online & its a very easy to use program.
Click Step 2 Prepare the vobs.
DGIndex will start up & you will see this screen (Yours Will Be Blank):
1: This is the slider to move quickly through your video.
2: These 2 buttons move your video forwards & backwards 1 frame at a time.
3: This is where you can select an end point for your video.
In the above picture you can see that the film actually finished there. The reason for this is because there was some extras in the same vob file as the film so you scroll to near the end, move forward 1 frame at a time & when youre done, click the end point button to cut off the remainder of the vob.
Now click file, open & select your film vobs from your folder.
Click ok & you're back at a blank window again.
Press F5 & your film will start to play & a box will appear with info on the right hand side like these:
The circled information is the important bit.
I've used 2 examples here.
Note the Aspect Ratio, Frame Rate (Fps) & Video Type.
The most important bit of information that is displayed here is the video type. 99/100 times you will simply be saving your project & deinterlacing with GK itself (not DGIndex). The recomendation as explained to me is as long as it doesnt report Film 90%+ everything is good. As you can see in the first example, I had one that was Film99% so we use DGIndex to deinterlace.
For this particular type of film the requirement is as follows:
Click: video, field operation & tick forced film.
For anything else & remember the above is very rare, dont change the default.
For the second example & carrying on with the first we do the same thing next for both which is save project:
Now another box will pop up. This is saving your project.d2v. Watch the timer counting down in the status window, like in the following:
Notice that Forced Film on the first example has reduced the FPS from 29.97 to 23.976. All NTSC films must be reduced to 23.976 to be properly deinterlaced & if yours is 29.97 & youve not needed to force film, we will do it in GK shortly.
Once its counted down to 0:00:00 Thats DGIndex finished with. If it hasnt closed itself & popped up a video window in GK, then close it manually & move to the bitrate screen in GK.
Click open & load your d2v file & up will pop a video window & if its in your way at all, just minimize it, dont close it.
Now I'm going to use the second example, the PAL non forced film DVD as an example as this still needs to be cropped & deinterlaced.
Loaded into GK it looked like this:
As you can see, a bad AR & big black borders so we need to set the options on the Resolutions tab:
From the info window in DGIndex we know its PAL Input Resolution & that its 4:3 not 16:9 so I changed that.
To remove the black borders, first click Auto crop. Now scroll through the video & look to see if its removed everything that needs to be removed. If not, highlight pixel & use the 4 boxes to continue to crop. Once you are done click smart crop all.
You should now have something that looks like this:
Now look at the aspect ratio & you will know if you need to slightly resize the video.
This DVD is 1.85 as its stated on the DVD case but GK has shaped it to 1.73, so to reshape it is quite simple.
EDIT: If your DVD is Anamorphic, go to the options tab & untick the Follow ITU-R button.
If its not Anamorphic or this doesnt correct it for you then go back to the resolutions screen.
Click the other box & gradually very slowly by 0.01 at a time change the value here until you get something close to what your size should be. In the above example I've managed to adjust it to 1.82
In output resolution you can increase & decrease the resolution with the up/down arrows between the WidthxHeight numbers. I increased mine to 704x384. If The H-Zoom or W-Zoom go into the red, you should really reduce the size to the next one down although I had a 102% zoom on this & left it alone.
Well one thing you should write about more is cropping properly for the correct resolution and A/R.
You suggest using the smart auto crop, which is fine, but I think you should mention the 'proper' resolutions, IE '720', '704', '672', '512', etc.
And sometimes, GKNot's A/R "error" is incorrect; well not that its wrong, just that the intended A/R of the DVD may include black bars, which with XVID avi's should be cropped out.
In GKnot, while you are cropping, watch the AVS preview in motion... if it decodes smoothly/fast then the resolution you are cropping to is 'more better'. In almost all circumstances you can get it 100% right (GKnot may say 0.01% error or something)
Now find a nice clear point in your film & scroll forward 10 screens 1 at a time & look for this:
Here you can see a pppii sequence:
Hmmm, You need to rehost these pics spud
If your film is interlaced then we must deinterlace it but before we do, theres 1 more thing left.
Go to Bitrate screen:
Set your container to AVI.
Set your codec to XviD.
Decide how big you want your file to be. Default is 700mb although its becoming more regular to do a 744mb 1cd or 1488 2cd rip now. Adjust this with the up/down arrows in the bottom right hand box first then tell it how big youve chosen in the 1CD= box.
Now add your audio stream in Audio A. DGIndex stripped all your audio streams into your vob folder when it created you D2V so if youre not sure which to add, simply go into your folder & play them to hear which is which.
Once added, set the type of audio it is (AC3, CBR MP3 or VBR MP3) in the Audio 1 box in the interleaving & AVI overhead section.
Now we're ready to start.
Go to your video window & click save & encode & up pops another window.
Noise filters are for removing grain. Default is set at none.
Sharpness is default Lanczos sharp.
Field Operations is where you deinterlace & you need to answer the following questions to decide what to set this as:
1. Did you force film? If yes set as none.
2. Is your film 29.97 NTSC & Interlaced? If yes use Inverse Telecine.
3. For everything else I suggest Field Deinterlace No Blend.
When you use Inverse Telecine on your 29.97 film, this is what changes your fps to 23.976
Feel free to preview the filtered rip by clicking the preview button & judging whether you might like to try a different deinterlace option or sharpness etc.
Now go to compressibility test, tick use 5% & click now. Wait a few minutes & this is going to give you a guide as to how good quality your rip will come out. the lower the percentage, the less likely your rip will come out nice. A guide would be to aim for 80%. If your percentage is low, maybe you should increase the size you're going to make the rip, reduce your resolution or reduce your AC3 audio to a VBR MP3.
Always run another compressibility test after youve changed any settings.
To modify your audio to MP3 from AC3 is straightforward.
Click the Encoder button top right & click add.
Up pops another window.
First tick the Average bitrate box.
Next untick the Finally Mux box.
Now click Add job to encoding Queue (No Video!)
Now you will see this
Click yes & up will come the following.
Wait for besweet to encode your audio & then go back to the Bitrate screen.
In Audio A add your MP3 & in Audio 1 change this to VBR MP3.
After the compressibility test is done, its displayed here.
Happy? Now click save & encode & save your sample.AVS & you come to the penultimate screen.
Highlight Multipass at the top.
If you're using inverse telecine the IVTC in AVS-> box will be available to tick so tick it.
Click first pass & make sure its sets as 2 pass first pass.
Edit: I've just added some advanced XviD settings to the bottom of the guide but if you're unsure then don't change anything & leave as they are.
Now click 2nd pass & be sure its set as 2 pass 2nd pass. The IVTC checkbox highlighted again just for clarity.
Now go to audio 1 tab & select Just Mux.
Go back to XviD tab & select Add job to Encoding Queue
Now up pops your final screen.
Click start encoding & that should be it. Go to bed, wake up in the morning & you should have a rip ready to watch.
EDIT: If you get the error 'could not find stats file' & youve set everything right in the first pass & second pass then you need to go to the options tab & click Delete Registry Keys button.
I have a friend in New Zealand whos gone & bought for me the NZ only DVD release of Kung Fu Vampire Killers. He ripped it with AGK as hes very new to ripping & unfortunately it didnt crop right. So I guided him for a couple of hours via msn & screenshots how to use GK. Hes got everything right that I can see but when it came to hit start encode he got an instant error 'could not find stats file.' I instantly remembered getting that error myself so made him go back & check he'd set his first pass as first pass & not as 2nd pass. He proved to me with screenshots that hes got this right but hes still getting the error. Anybody able to give any suggestions as to what else it could be & how to resolve this problem?
Clear your registry settings, i think the tab is called "Settings" there will be two boxes for clearing/restoring default settings.
You need to do that for your codec settings, the problem is there's a duff entry for your stats pass. its happened to me before, and that's always fixed it.
its big buttons under options on the gknot gui, but that in turn cleans out registry settings for you.
I think the tab is either "options" or "settings". iirc two buttons are at the top left of the screen. At the bottom right there's your default settings for 1st/2nd passes.
Just 1 more thing. GK will remember your settings if you close it & after youve ripped. If you come to do a different DVD & want to clear all your previous settings, click reset button which is bottom right on any tab.
I'm pretty sure thats covered all the basics & as I stated, this is a beginners guide. There is far more to Gordian Knot than this but find your feet first then start asking questions.
Thanks to Spud, Lux, Rogue & Vae for their help in guiding me to understand enough to be able to make this guide & Grind for extra input.MORE ADVANCED SETTINGS FOR EXPERIENCED USERS ONLY!
Setting Up Your XviD Codec:
Go to the Options tab & you will see XviD Default Codec Settings with buttons for first pass & second pass.
I'm going to use Two pass Second Pass as the example & when you click it this is what you see:Note:
It is essential that you set both first & second passes exactly the same or you will get error messages!
The highlighted sections are the only parts that we are going to use as the rest are unimportant at this stage.
Change Profile@Level to Unrestricted & click the more box beside it & up pops the following:
First change 'Quantization type' to 'MPEG Custom'.
This is the most important selection of options & I recommend you to set yours exactly like this.
Quarter Pixel, Global Motion Compensation & Packed Bitstream are what will make your rip not work on standalones so be sure to untick these boxes.
Max Consecutive BVOPs is to set how many BVOP frames you want together in your encode.
Quantisizer Ratio & Quantisizer Offset handles the size of your pixels & this has worked out to be the best setting for me & was suggested to me by Lux.
The Level & Aspect Ratio tabs are unimportant so we dont need to change anything in those.
Edit:If your rip comes out oversized this is likely to be caused by you having a low compression ratio & can be fixed by changing the values above. They are set to a quant of 3.6 ( 2 x 1.3 + 1) which is for quality & by following the information in the quote below you can reduce the quality & thus remove the oversizing.
Thanks to elchupacabra for pointing that out.
-Max Consecutive BVOPs: Here you can limit the number of B-frames in a row. Recommended settings are 0 for off, 1 for DivX 5 compatibility, 2 for best effect and 3 for intensive use.
-Quantizer ratio: Multiplying the (average) quantizer of the surrounding non-B-frames with this value will give you the Quantizer of the B-frame. So if the two adjacent frames have quantizers of 2 and 4, the average quantizer will be 3. Multipying this with a quantizer ratio of 1.50 will give you a B-frame with a quantizer of 4.5.
-Quantizer offset: Take the result of the calculation above and then add this value. With a quantizer offset of 2.00 you will end up with a quantizer of 6.5.
As a rule of thumb, upping the latter two values will give you lower quality B-frames.
If you want to change your CQM (Custom Quantisizer Matrix), click 'Edit Matrix' Button & up pops this:
Simply click Load Matrix & navigate to where it is stored & click OK.
Save Matrix button is for if you're clever enough to have designed your own.
After you've made these changes click OK until you return to the first screen again.
Clicking Calc button brings up this screen (You don't need to click this when using GK as GK will ignore these settings, but if you are encoding outside of it then this may be useful) :
Here you can set your desired filesize. 758000 is virtually 744MB
Setting your film length, framerate & Audio type automatically sets the bitrate for the rip & this works perfectly in VirtualDub.
Click OK & go back to first window again.
Change the box next to 'Quality Preset' to 'user defined' & click the 'more' box beside it & up pops this screen:
Set your settings to those above. If you have a slow PC you might want to tick the Turbo button as it does what it says at the cost of a negligable amount of quality.
Maximum I-Frame interval is what allows you to be able to fast forward through your finished rip. Without I-Frames (Sequencing Frames) that wont work.
Set it to 250 if your rip is 25FPS, 240 for 23.976FPS or 300 for 29.97FPS.
Now click the Quantization tab.
Not much to do here. Just tick the 'Trellis Quantization' box & thats you all setup. Click OK on all windows until you come out of XviD setting.
To Come: Basics on how to apply filtering & AVS script modifying.