PREVIOUS: Compressing the Audio Files NEXT: Adjusting for Quality

Script

Go to the Start menu and open (Gordian Knot icon) Gordian Knot.

Select your language and click the "OK" button.

Click the "Open" button and navigate to the ripping folder.

Open (file icon) decoded.d2v

A preview display window will appear. Minimize it, but do not close it.

Would you like to know more?Error opening the .d2v file
If you get an error that says the file is "not a valid d2v project, avi or avs file", it may be because you did not properly uninstall an older version of the Gordian Knot Rip Pack before installing the latest one.

If you are absolutely sure there are no remnants of an older version on your system, it may be a software conflict. The presence of certain kinds of software can cause DGIndex to produce .d2v files that Gordian Knot can't open. Either find the offending software and uninstall it, or start with a fresh installation of Windows. Then repeat the Decoding stage.

Select the "MKV" radio button.

Click the "Select" button in the Audio A section, and choose (file icon) main.ogg.

If you have a (file icon) commentary.ogg file, the "Select" button it in the Audio B section.

For any additional audio files, add them one at a time in the Files section.

If you are encoding a feature length movie on 1 CD, select

Number CD: "1 CD".

If you are encoding a feature length movie on 2 CDs, select

Number CD: "2 CD".

If you have performed a compression test and determined that 3 CDs are necessary for your feature length movie, select 3 CD.

If you are encoding a series of episodes, select the fraction that will result in about 90 minutes of material per CD. For example, if the episodes are 30 minutes long, select

Number CD: "1/3 CD/DVD".

Select  Audio 1: "vorbis"
If you have a commentary track, select Audio 2: "vorbis" as well.

Create a new text file in the ripping folder, and name it video notes.txt.

Open (.txt icon) video notes.txt and type in the line video size:________, filling in the blank with the Video Size value from Gordian Knot. Save and minimize.

Go to the "Resolution" tab.

In the "Input Resolution" section select

the "PAL" radio button
or
the "NTSC" radio button,

depending on how the DVD is labeled and where it came from.

If the picture shape of the original video is 2.35:1 widescreen, select the "NTSC/PAL anamorphic (16:9)" radio button .
Bring up (.txt icon) video notes.txt and add the line aspect ratio 2.35:1, then save.

If the picture shape of the original video is 16:9 widescreen, select the "NTSC/PAL anamorphic (16:9)" radio button.
Bring up (.txt icon) video notes.txt and add the line aspect ratio 16:9, then save.

If the picture shape of the original video is 4:3 fullscreen, select the "NTSC/PAL non anamorphic (4:3)" radio button.

Select
"16" as the "W-Modul" value.

Select the "Pixel" radio button, and then click the "Auto Crop" button.

Wait for a few moments while Gordian Knot removes the black borders from the picture.

Bring up the preview display window again.

Drag the slider to various points and check to make sure all black borders have been cropped away. (If any remain, manually adjust them in the cropping section, but do not allow the Aspect Error to exceed ±3%.)

IMPORTANT: Make sure the source width and height are each divisible by 4. (This is really only necessary for the 1 CD script below, but it won't cause a problem with 2 CD script.) Increase the relevant cropping value(s) if necessary.

From the "View" menu on the preview display window, select "Resized".

Check the picture. Is it squashed or stretched? If so, the aspect ratio may be wrong.

In some cases, (especially with cheap DVDs) a movie with a 16:9 or 2.35:1 widescreen picture will actually have a 4:3 aspect ratio on the disc. If this is true of your DVD, select  the "NTSC/PAL non anamorphic (4:3)" radio button  to get the proper picture shape. Also, bring up (.txt icon) video notes.txt and delete the aspect ratio line.

Repeatedly click the ">" single frame advance button on the preview display window. Look for a pattern in the appearance of frames with interlacing artifacts. These frames will appear during scenes with a lot of motion on the screen.

Is the pattern "3 normal, 2 interlaced", or are they all interlaced? If there is a pattern, follow the instructions in the blue sections. If they are all interlaced, follow the instructions in the green sections. If every frame looks normal, ignore the colored sections altogether.

Would you like to know more?Other Interlacing Patterns
In very rare cases, a pattern other than the two mentioned above can appear. One rare pattern, (caused by a 2:2 25FPS PAL conversion to 30FPS NTSC) can result in 2 normal frames followed by 4 interlaced frames. If this is this case with your DVD, use the following line in your script where you would usually insert what appears in the blue or green sections below:

Telecide (order=1,guide=3)

Any other odd interlacing patterns may require further research or even a trip to the doom9 forums to fix.

Minimize the preview display window and go back to the main program.

If the video is telecined,

Make sure "23.976" FPS is selected in the Frames section, and continue.

If  the "NTSC/PAL anamorphic (16:9)" radio button  is currently selected, change it to "1:1"  instead. This will distort the picture, but we will adjust for it at a later stage.

Would you like to know more?Anamorphic Encoding
If you have just selected "1:1", it is because your DVD was anamorphically encoded. In order to present more visual detail, manufacturers basically squeeze a rectangular picture into a square shape on the DVD, and then allow the DVD player to "un-squeeze" it during playback.

Later, during the Muxing stage, we will use the Matroska container to tag the file with a playback aspect ratio. The video inside the container will still be distorted, but the container will instruct the media player to display it in the right proportions during playback. This explains why an intelligent media player must be used for playback: if you use Windows Media Player it will present the original, squeezed video.

Click now if you would like to know even more about anamorphic encoding and aspect ratios.

If you are using 1 CD or encoding a series of episodes, move the resolution slider until the Bits/(Pixel*Frame) value is as close to 0.200 as possible. It can be slightly higher or lower, as long as it is close.

If you are using 2 CDs, move the resolution slider until the Bits/(Pixel*Frame) value is as close to 0.250 as possible. It can be slightly higher or lower, as long as it is close.

If you are returning to this stage after having done a compression test, and you have determined that you need 3 CDs, use a Bits/(Pixel*Frame) value of 0.300.

Would you like to know more?Resolution
The larger the picture is, the bigger the first pass file will be, and the harder it will be to compress.

Compressibility
If you are here after having followed the instructions in the purple sections of the Quality stage, remember to set the Bits/(Pixel*Frame) value as specified above before moving the slider again to effect the recommended change. If this is your second or third resolution adjustment, remember to make the changes cumulative.

Bring up the preview display window.

Click the "Save & Encode" button.

Click the "Edit" button.

Create another new (.txt icon) text file in the ripping folder, and open it.

Would you like to know more?Scripts and filters
Below you will find an AVS script to paste into the text file. This is where personal preferences really come into play. There are so many filters, settings, and combinations available that no one can say which the "best" for all movies are. The scripts below are very nice, but you should still try experimenting. You may discover software and methods that are even better.

For a repository of filters, click now.

If you are using 1 CD or encoding a series of episodes, paste in the following:

Import("C:\PROGRA~1\GORDIA~1\AVISYN~1\Hybridfupp.avsi")
Import("C:\PROGRA~1\GORDIA~1\AVISYN~1\Ylevels.avsi")
LoadPlugin("C:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\decomb.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\Deen.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\Masktools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\msharpen.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\MVTools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\UnFilter.dll")
mpeg2source("
DRIVE:\PATH\decoded.d2v")
#
crop(
CROPPING VALUES)
YlevelsS(0,1.2,255,0,255)
Tweak(sat=1.2)
HybridFuPP(
RESIZING VALUES)

Would you like to know more?Ylevels
This AviSynth script makes the picture brighter. The gamma value in the script above is 1.2, but you can increase that number if you want a brighter picture, or decrease it for a darker picture. Try values between 1.0 and 4.0 until the picture looks good to you.

Tweak
We're using one aspect of the built-in Tweak filter to increase the saturation. This offsets the "bleaching" effect of the Ylevels filter and brings the color back.

HybridFuPP
HybridFuPP is a flexible AviSynth script that enables both resizing, and filtering. Distinct filters are applied to different parts of the picture. The main idea is to strongly filter the less visible parts and to lightly filter the more visible parts. HybridFuPP makes these decisions by detecting edges, motion, dark and light areas within the picture.

If you want more control over what HybridFuPP does, see the ReadMe file for parameter settings. HybridFuPP has a number of presets which can be placed after the resizing values in the script like so:
HybridFuPP(448,320,preset="low").
If your source is somewhat noisy, try using preset="medium", and if you are encoding animated material, try preset="anime".

At lower settings, HybridFuPP increases compressibility even more, so you may want to use it for fitting very long movies (longer than 2 hours and 45 minutes) onto 2 CDs instead of 3 if space is more important than quality.

If you are using 2 or more CDs, paste in the following:

Import("C:\PROGRA~1\GORDIA~1\AVISYN~1\Ylevels.avsi")
LoadPlugin("C:\PROGRA~1\GORDIA~1\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\decomb.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\Masktools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\UnDot.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\Deen.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AVISYN~1\asharp.dll")
mpeg2source("
DRIVE:\PATH\decoded.d2v")
#
crop(
CROPPING VALUES)
BicubicResize(
RESIZING VALUES,0,0.5)
YlevelsS(0,1.2,255,0,255)
Tweak(sat=1.2)
Undot()
Deen("a3d",1,3,5)
asharp(1,2)

Would you like to know more?2 CD script
This script works well on source material that is very high quality. You may want to use it instead of the 1 CD script if you're encoding a movie that is shorter than 1 hour and 45 minutes and is of exceptionally high quality.

BicubicResize (Neutral)
This resizing filter doesn't sharpen very much, since that will be taken care of by asharp.

Ylevels
This AviSynth script makes the picture brighter. The gamma value in the script above is 1.2, but you can increase that number if you want a brighter picture, or decrease it for a darker picture. Try values between 1.0 and 4.0 until the picture looks good to you.

Tweak
We're using one aspect of the built-in Tweak filter to increase the saturation. This offsets the "bleaching" effect of the Ylevels filter and brings the color back.

UnDot
UnDot is a filter that removes mosquito noise from films, and generally cleans the source video.

Deen
Deen is a denoiser/smoother, and isn't always necessary.

asharp
Asharp is an adaptive sharpening filter, and even if you think your source is already pretty sharp, it can definitely help.

Replace the red text with the SOURCE path from Gordian Knot.

Replace the green text with the CROPPING values from Gordian Knot.

Replace the blue text with the RESIZING values from Gordian Knot.

If the video is telecined,

replace the # symbol with the line Telecide(order=1,guide=1).Decimate()

If the video is interlaced,

replace the # symbol with the line FieldDeinterlace()

If the video is neither interlaced nor telecined, you can leave the # symbol in.

Save the file in Notepad, close it, and rename it (.avs icon) script.avs

If you are encoding a series of episodes, follow the instructions in the brown section.

If you are encoding a feature-length movie, ignore the brown section.

Copy (.avs icon) script.avs and paste it into the second episode folder.

Open this duplicate (.avs icon) script.avs with Notepad.

Edit the SOURCE path so it points to the second episode. The other settings should remain the same. Save the file and close it.

Repeat this process until there is a unique script file in the ripping folder of each and every episode.

The example ripping folder now contains a "script.avs" file and a "video size.txt" file.

Close Gordian Knot and proceed to the next stage.

PREVIOUS: Compressing the Audio Files NEXT: Adjusting for Quality.
Validate the XHTML.
Validate the CSS.
Google Chrome
Use OpenDNS
Stop Spam Harvesters, Join Project Honey Pot