Encode DVD video to Blu-ray compliant H.264 with MeGUIViewing Page 2 of 4 -- Go To

Creating an AviSynth script

Before you can encode your video, you will need to create an AviSynth script for it. Select AVS Script Creator from the Tools menu.

If you followed our guide for extracting content from a DVD, you may already have a D2V file from DGIndex. If so, simply drag that to the Video Input field in the Script Creator. Alternatively, you may have a MKV file instead or even just the DVDs original VOB files. You can also drag those to the Video Input field.

1. Video Input

If your source is a DVD VOB file or MKV, you will be asked how you want to open it. Select the File Indexer option.

In the File Indexer, select any audio streams you wish to keep. If your source is an image file you will also need to click the ... button to select a location to save the index file. Otherwise you can ignore this option. Finally, click the Queue button and wait for indexing to complete. After it finishes, you will be returned to the Script Creator.

2. Source Type

When you get back to the Script Creator window, go to the Filters tab. MeGUI needs to know if your video is progressive, interlaced, or telecined. If you don't know the answer to that, click the Analyse button and most of the time MeGUI can figure it out for you.

When MeGUI finishes analyzing your video, it should automatically set the Source Type. If it sets Source Type to either Progressive or Interlaced, leave it that way and make sure Deinterlace is unchecked. If it sets Source Type to Film, once again leave it at that setting, but also check Deinterlace and make sure TIVTC is selected. If it says anything else, most of the time you should set it to Film and once again turn on Deinterlacing and select TIVTC. If you're not sure, you can read AfterDawn's IVTC guide for more information.

3. Crop and Resize

Now go back to the I/O tab and click the AutoCrop button. You won't actually be cropping borders off the image. You need it to be full DVD resolution (720x480 or 720x576). Instead you just need to find out if there are borders on the left and right. Ideally there will be, and each one will be 8 pixels wide. If the AutoCrop settings on the left and right are both 0, that means the image may be slightly distorted when encoded for Blu-ray.

If the margins (on the left and right) are 0 you have 2 choices. You can ignore it and assume it will look fine. I recommend this approach. Or you can uncheck Clever anamorphic encoding, check Resize, and set the horizontal resolution to 704, leaving the vertical resolution at either 480 or 576. This will mean more work for what negligible gain, but it's your choice.

If you choose to resize, you will also need to go back to the Filters tab and select a Resize Filter. Generally speaking, the best choices are Lanczos4, Lanczos, Spline36, or Spline16.

4. Aspect Ratio

If you aren't resizing, you should check the Input DAR setting on the I/O tab. Depending on the resolution of your video, and whether it is widescreen (16:9) or full frame (4:3), this should be set to 16:9 NTSC, 16:9 PAL, 4:3 NTSC, or 4:3 PAL.

5. Manual script editing

If you are resizing, the last step is to visit the Script tab where you will have to manually edit your script. Don't worry, it's easy. This tab is basically just a text editor (like Notepad) where you can manually tweak an AviSynth script. First you will need to add aspect ratio information above the first line. If you are in North America and you are working with a widescreen video, add the following lines:

global MeGUI_darx = 175

global MeGUI_dary = 96

If you are in North America and your video is full frame, add the following 2 lines:

global MeGUI_darx = 67

global MeGUI_dary = 49

For widescreen movies outside of North America, the lines would be:

global MeGUI_darx = 31

global MeGUI_dary = 17

Or for full frame they would be:

global MeGUI_darx = 93

global MeGUI_dary = 68

Finally, you need to add 8 pixel wide borders to the sides. Immediately after the Resize line, add the following:

AddBorders(8, 0, -8, 0)

6. Save and Close

Now your script is complete. Click the Save button.

table of contents

  1. 1. Introduction
  2. 2. Create AviSynth script
  3. 3. Chapters and Bitrate
  4. 4. Encoder Settings
Written by: Rich "vurbal" Fiscus
Last updated: 20 June 2011