Convert DVD-movies to AC3 DivX using Gordian Knot
Following this guide you can convert your DVD-movies to DivX-format using the Gordian Knot -package. Gordian Knot contains everything needed in the process, and the whole package is built on the principle of optimizing the picture quality in the space given.
The Beginning
To start you need:
·Gordian Knot RipPack and System Pack
·DVD-ROM -drive and an original DVD-movie
·atleast 10GB of free harddisk space
·lots of time
If you haven't previously installed Gordian Knot on your system, install it now. First install the RipPack, then the System Pack. Take your time when installing the System Pack -- it will take a while, as the installer launches child install processes.
You should also install the DivX 5 Pro codec when you install the System Pack, unless you have it already. Unfortunately the advertisement component contains some spyware components, so you should bear that in mind when installing. You can get rid of the Gator-components by purchasing a DivX 5 -license.
When the installation is done, run VirtualDub and NanDub once from Start Menu, Gordian Knot, Apps to automatically update the settings.
Launch the Gordian Knot -frontend and do not close it before the whole encoding process is done. If you do, you'll lose your ripping settings.
First choose a free slot from the profile list at the bottom right corner of the screen and name it using the Rename-button, if you wish to. It's a good idea to name the profile according to the movie you're encoding.
Ripping the DVD to harddisk
Then open the Ripping-tab and launch the DVD Decrypter by clicking the button.
After launching DVD Decrypter press the I-button on your keyboard to make sure you are in the Ifo-mode. Choose the Program Chain (PGC) containing the movie. It can usually be identified by its length -- it should be close to the length mentioned on the cover sleeve of the movie. DVD Decrypter tries to choose the correct PGC automatically. From the bottom right of the screen you can see how much disk space the movie files (VOBs) require. When you have selected the correct chain click the big DVD -> Harddisk -button. The speed of the transfer depends on the speed of your drive. It can take up to 30 minutes, or even more. When the movie has been copied, close DVD Decrypter.
Creating an DVD2AVI project
Return to the Gordian Knot -window and launch DVD2AVI on the same Ripping-page you left from. In DVD2AVI choose File, Open, and browse to the directory you copied the VOB files to. Select the first VOB-file (eg. VTS_05_1.VOB) and click OK.
DVD2AVI will automatically add the rest of the VOB-files to the processing list, and it should look something like the one to the right.
Determining the video type
What follows is probably the most demanding phase of the process. Hit F5, which will launch a DVD-preview. Let it run for a while, and write down the following information from the Statistics-window: Aspect Ratio, Frame Rate, Video Type ja Frame Type.
If the Frame Rate is 25.00 fps, you are dealing with a PAL -movie. Most of the region 2 and region 4 movies are in PAL format. Look at the Frame Type. If it is Interlaced, take a close look at the preview video. If you can see black horizontal lines on the picture, select Video, Field Operation, Swap Field Order. If the black lines remain, switch the Field Operation to None. Write down deinterlace on your piece of paper.
If the Frame Rate is 20.00, you are also dealing with a PAL movie, but you have the Forced FILM -option enabled. Disable it by setting the Video, Field Operation to None. The Frame Rate should now be 25.00.
Dealing with NTSC -movies is a bit more complicated. If the Frame Rate is 29.970 fps, let the preview run for a couple of minutes, and then look at the Frame Type-field. If it shows FILM or FILM with a probability of 95% or higher, set Video, Field Operation to Forced FILM. If the Frame Rate is 23.976 fps, you already have Forced FILM selected. If the Frame Type is NTSC or FILM with a probability of less than 95%, set the Video, Field Operation to None. The video must go through inverse telecine (IVTC) later on. Write down IVTC on your piece of paper.
Extracting the audio-track
Next we will choose the audio track. After the ripping process DVD Decrypter created a text file in the Video_ts folder of your destination directory, and named it according to the VOB files (eg.VTS_05 - Stream Information.txt). Open this file with eg. Notepad. It contains lines like:
0x20 - Subtitle - English / LBA: 127 / ...
0x21 - Subtitle / LBA: 1559 / ...
0x22 - Subtitle - Suomi / ...
0x23 - Subtitle - Svenska / ...
0x80 - Audio - AC3 / 6ch / 48kHz / DRC / English / ...
0x81 - Audio - AC3 / 2ch / 48kHz / DRC / English / ...
0xE0 - Video - MPEG-2 / 720x576 (PAL) / 16:9 / ...
We're only interested in the Audio-lines. They are in the same order as the audio track selections in DVD2AVI. Because we want to preserve the Dolby Digital (AC3) encoding, we'll use the first audio track (0x80) which is Track 1. Se we choose Audio, Track Number, Track 1.
Make sure that the Audio, Dolby Digital, Demux is selected, and Dolby Surround Downmix is NOT selected.
Check also that Video, Color Space -selection is set to YUV 4:2:2. If you wish to encode just a part of the movie, you can select a range using the [ and ] buttons.
Saving the DVD2AVI-project
After setting all the options, choose File, Save Project and give an appropriate name to the file. If you have enough hard disk space, I recommend saving the project to the same folder with the VOB-files, so it will be easier to find later on. A two-hour movie has an Dolby Digital audio track that takes up around 400MB of space. Wait for the process to finish, and close DVD2AVI. Do not remove the VOB files yet! They are still needed.
Return to Gordian Knot and open the Bitrate-tab. Push the Open-button at the bottom left corner of the window, and choose the .D2V-project file you created with DVD2AVI. the software will automatically read the frame speed (FPS) and frame-count from the D2V-file.
Setting the closing credits point
A preview-window will also be opened. Using the slider at the bottom of the screen find the position where the closing credits begin and click the Set Credits Start-button. Now the Gordian Knot can use a low bitrate for the credits, which saves space for the movie itself. After this enable the View, Resized -setting.
Extracting the subtitles
You can skip this part if you do not want selectable subtitles.
Open the Subtitles-tab and click Configure, which is located below the Vobsub Step 1 -heading. Click Open... and set Ifo and Vobs as the file type, browse to the folder you ripped the VOB files to using DVD Decrypter and open the IFO-file (eg. VTS_05_0.IFO). Then choose the directory you want to save the subtitles to. By default all the subtitle languages are selected. If you want to remove some, select them and use the <-- -button to remove them. Next hit OK and wait until the subtitles are ripped. The subtitles will be saved to two files -- VTS_05_0.sub and VTS_05_0.idx. The IDX file contains the time indexes for the subtitles, as well as other details about them. The SUB-file contains the actual subtitles. Use Winrar to compress the SUB-file to RAR-format, and name the archive VTS_05_0.RAR. Do not remove the original SUB-file yet. We will need it later. You can now close Vobsub.
Choosing the number of CDs
Go back to the Bitrate-screen and choose Divx 5 under the Codec-section, and set the prefered CD size and number of discs you want to use. In the example case the CD size is 700MB and it will be divided on two discs, so the total size is 1400MB.
At the Audio A-spot you tell Gordian Knot the size of the AC3-soundtrack. Click Select, and choose the .AC3 file from the directory you saved the DVD2AVI project to.
Check the Calculate Frame-Overhead selection and select 1x ac3.
Click the Add-button below the Files-heading, and choose the subtitle files you created earlier on (VTS_05_0.idx and VTS_05_0.rar). Now Gordian Knot knows exactly how much space the DivX video can use (CD-size (1400MB) minus audio track size minus subtitle size minus overhead = video size).
Cropping the video
Go to the Resolution-tab and click Auto Crop. Go to the preview window, that was opened earlier on, and make sure that the automatic crop looks alright. If it does, set Smart Crop All. Otherwise leave the Crop to disable.
Set the Input Resolution (PAL or NTSC) and Input Pixel Aspect Ratio (anamorphic 16:9 or non-anamorphic 4:3) to match what you wrote down in the DVD2AVI-stage. Check again that the preview looks OK.
Adjusting the final resolution
Use the slider at the bottom of the screen to set the final resolution for the DivX -video. Keep an eye on the Bits/(Pixel*Frame) value. The value tells you how many bits the encoder can use per a pixel. According to Doom9's estimations the value should be around 0.17 for a one CD video and around 0.25 for a two CD video. If you have to drop the resolution considerably to reach the desired value, you should consider increasing the number of CDs and/or the size of the discs.
As you adjust the resolution, the Aspect Error value shows you the amount of distortion from the original picture. A distortion of 3 percent or less is acceptable.
Setting initial compression settings
Go to the preview window and choose File, Save & Encode. Set the Resize Filter to Neutral Bicubic.
Do we need IVTC or deinterlace?
If you wrote down IVTC in the DVD2AVI-phase, set Inverse Telecine under the Field Operations (the selection is only visible on NTSC-material). If you wrote down deinterlace (ie. the source material was interlaced PAL), choose Separate Fields (fast). Otherwise leave the selection to None.
You can enable a Noise Filter, if the source video has alot of noise, but usually it's best not to use a filter, since it blurs the picture somewhat.
You can skip the Subtitles (VobSub), because subtitles will be read from a separate file.
Testing compressibility
Next we'll verify that the settings are correct by doing a test run. Under the Compressibility Check choose Use, and set it to 5%, and click Now. Gordian Knot will test how well the source material compresses. After the test run is complete, you can see the result at the bottom of the Gordian Knot -window next to the Compressibility Test-text. The percentage (61.9%) shows the correlation between the estimated (0.205) and actual (0.331) Bits/Pixel -ratio. You should aim at 50-60%. There's really not much point going above that. If necessary, adjust the number and/or the size of the discs, and the resolution, to reach a good correlation.
Further compression settings
Return to the Save .avs window and choose Both (enc. credits separately). Gordian Knot will encode the closing credits separately at a low bitrate, and join it after the actual movie. Click Save & Encode to continue. Save the frameserver (avs)-files to a directory of your choosing. It's still a good idea to use the directory you ripped the movie to.
In the next window you adjust the encoding settings. At the top you can see the size of the movie (1433600 KB), video (1052175 KB) and sound (372202 KB), as well as the overhead of subtitles etc. (6417 KB).
If you installed the DivX Pro -codec check the Use Pro Features -box, and choose bi-directional enc, gmc and set psychovisual enh.: to light. With the psychovisual enhancement DivX will try and enhance the image quality by removing information the human eye doesn't notice.
Choose Delete Intermediate Files to save space in the encoding. Make sure that the files in Frame Server: and Frame Server Credits:-fields are the ones you saved saved earlier (avs-files). Also set the folder in AVI OutputFile if you don't want to use the default folder.
Open the Audio 1-tab. Make sure that the audio source is correct (the AC3-file) and set the radio button to Just Mux.
Starting the encoding. Time to wait.
Return to the DivX 5-tab and click Add Job To Encoding Queue. Gordian Knot asks if you'd wish to begin the encoding now. If you want to, you can add several movies to the queue by just repeating the steps you've done above. But usually you start the compression right away.
When the Gordian Knot is encoding the movie, all you need to do is wait. Do not close Gordian Knot, or any other window that opens during the encoding process. You can use the computer for other tasks, of course, while the video is compressing. It will take several hours for the process to finish. The faster your computer is, the faster the process will be.
After the encoding is done, you can remove the VOB and IFO files, as well as the DVD2AVI project file and the AC3 file.
Splitting the video
If you made a multi disc version of the movie, you have to split the video and subtitles. Launch Nandub from Start, Programs, Gordian Knot, Apps. Choose File, Open videofile... and open the DivX file created by Gordian Knot. Use the slider at the bottom of the screen to verify that you are viewing the correct file.
Choose Video, Direct stream copy, because we don't want to re-encode the file.
Hit CTRL+left cursor or click the button shown to the right to move the cursor to the beginning of the video.
Hit Home or click the button shown to the right to set the selection start.
Now hit CTRL+Shift+J or choose Edit, Go to last keyframe.... Set the value to 698 Mb and click OK. This makes the cursor to move to the next keyframe after the given position. If you're not using 700MB discs, set the value to CD size minus 2MB (eg. for 650MB discs 648MB).
After clicking OK write down the time index next to the Frame-counter (0:55:53.160). You need it to split the subtitles.
Saving the first CD
Hit End or click the button shown to the right. Now you have the first CD of the movie selected. Choose File, Save as AVI..., make a new folder and name the file Name_of_the_Movie-cd1.avi. When Nandub is done with saving, press Delete-key on the keyboard to remove the selection. Now the first remaining frame should be active. Hit Home or use the button shown earlier to set the selection start again.
If you are making a three-CD video, repeat the process described above. That is Go to last keyframe.., End, write down the time code, Save as AVI..., Name_of_the_movie-cd2.avi, Delete, and Home.
Finally hit CTRL+right cursor or use the button described to the right to move the cursor to the end of the video. Hit End or the button shown earlier to select the remaining video. Save this again to hard disk and name the file Name_of_the_movie-cd2.avi (or cd3, if you're creating a three-cd movie).
After this you can delete the large AVI file, if you wish.
Splitting the subtitles
If you ripped the subtitles, you need to split them also. Return to Gordian Knot and go to the Subtitles-tab. Click Cutter.
Click Open... and open the subtitle file you created earlier (VTS_05_0.SUB). Write the end timecode for the first CD to the End -field (0 55 53 160). Click Save As.. and browse to the folder where you stored the cut video file segments. Name the file Name_of_the_movie-cd1.
If you are making a three-CD video, feed the end timecode for cd1 to the Start-field and the end timecode for cd2 to the End-field. Then click Save As.. and name the file Name_of_the_movie-cd2.
Click Open again and choose the original subtitle file VTS_05_0.sub. Enter the end timecode for the previous cd to the Start-field and leave the End-field to the default value. Save the last part of the subtitles as Name_of_the_movie-cd2 (or cd3).
Compress the SUB-files you just split using Winrar, and name them as Name_of_the_movie-cd1.RAR etc. and remove the .SUB-files. Now you should have the following files in the directory:
Name_of_the_Movie-cd1.AVI
Name_of_the_Movie-cd1.IDX
Name_of_the_Movie-cd1.RAR
Name_of_the_Movie-cd2.AVI
Name_of_the_Movie-cd2.IDX
Name_of_the_Movie-cd2.RAR
... and possibly the files for the third CD.
Checking the end result
Open the Name_of_the_Movie-cd1.AVI by double-clicking it. An icon like the one shown to the right should appear in the System Tray next to the clock.
Click the right mouse button over the icon to select the subtitle language of your choosing. If the end result looks good, you can finish up by burning the files on CD. There's nothing special to it -- just burn files for each CD to the same folder on CD.
And remember Share, don’t Steal.