View Single Post
Old 18th May 2002, 02:06   #6  |  Link
gerti67
Reloaded!
 
gerti67's Avatar
 
Join Date: Dec 2001
Location: The Matrix
Posts: 824
Q62: My converted DivX/AVI files show up wrong (stretched/squeezed) on TV. What's wrong with the AVI2SVCD feature?
A:
The resizing with the AVI2SVCD feature may sometimes be not correct when converting DivX/AVI files due to the huge amount of AVI codecs around. Here is a way to correctly resize those AVIs manually in case DVD2SVCD fails in doing so.

A common DivX/AVI display size for example is 640x272 pixels. To resize this DivX/AVI correctly to SVCD you have to resize it to 480 x 576 pixels for PAL and 480 x 480 pixels for NTSC but you have to take into consideration the different pixel aspect ratios of a PC monitor and a PAL/NTSC TV. Monitor pixels have a pixel aspect ratio of 1:1 (y:x) but TV pixels are not square! The TV pixel aspect ratio for PAL is 54:59 and 11:10 for NTSC.

To keep it simple use the following formulas to calculate the correct resizing parameters for your DivX/AVI to show up correctly on your TV and to keep the correct aspect ratio.

For example your DivX/AVI has a display size of 640 x 272 pixels (Pixels_X x Pixels_Y).

1) For NTSC TV sets:

Calculated height = ((720 / Pixels_X) x Pixels_Y) / (11 / 10)
e.g. ((720 / 640) x 272) / (11 / 10) = 278,18
So the correct "Resize" statement in the AviSynth script would be for example:
...
SimpleResize(480,278)
...

If you want to make a anamorphic SVCD instead of a letterboxed SVCD then you have to correct your calculated height with the factor of (4 / 3) = 1.33
e.g. 278,18 x (4 / 3) = 370,66
So the correct "Resize" statement in the AviSynth script would be for example:
...
SimpleResize(480,370)
...

Note: You should always round up/down to even numbers - this might not be absolutely correct but this little aspect ratio error is usually not visible. And it is better if they can be divided by 4 or even better by 16 to let some CPU MMX optimizations kick in.

Then you have to add borders on top and bottom to fill up to 480 pixels.

Correct borders = (480 - Calculated height) / 2
e.g. (480 - 278) / 2 = 101 when doing a letterboxed SVCD
So the correct "AddBorders" statement in the AviSynth script would be for example:
...
SimpleResize(480,278)
AddBorders(0,101,0,101)
...

2) For PAL TV sets:

Calculated height = ((720 / Pixels_X) x Pixels_Y) / (54 / 59)
e.g. ((720 / 640) x 272) / (54 / 59) = 334,33
So the correct "Resize" statement in the AviSynth script would be for example:
...
SimpleResize(480,334)
...

If you want to make a anamorphic SVCD instead of a letterboxed SVCD then you have to correct your calculated height with the factor of (4 / 3) = 1.33
e.g. 334,33 x (4 / 3) = 445,77
So the correct "Resize" statement in the AviSynth script would be for example:
...
SimpleResize(480,446)
...

Note: You should always round up/down to even numbers - this might not be absolutely correct but this little aspect ratio error is usually not visible. And it is better if they can be divided by 4 or even better by 16 to let some MMX optimizations kick in.

Then you have to add borders on top and bottom to fill up to 576 pixels.

Correct borders = (576 - Calculated height) / 2
e.g. (576 - 334) / 2 = 121 when doing a letterboxed SVCD
So the correct "AddBorders" statement in the AviSynth script would be for example:
...
SimpleResize(480,334)
AddBorders(0,121,0,121)
...

So all you have to do is:
- to know the exact display size of your source DivX/AVI file (Mediaplayer/Properties/Details)
- calculate the correct height values for your destination TV standard
- tick the "Edit as part of Video encoding" option in "Frameserver" tab
- start the conversion and wait for the AviSynth script window to show up
- manually edit the AviSynth script like described above
- continue the conversion by hitting the "OK" button

This procedure does not apply to DV AVI sources - they will show up correctly with the AVI2SVCD option.

Q63: I don't like the (big) black borders. How can I make my 2.35:1 (1.85:1) movie look like a 1.85:1 (4:3) movie?
A:
You can actually do that in DVD2SVCD by editing the AviSynth script manually. Start your conversion with DVD2SVCD as usual but make sure you have ticked the "Edit when dvd2avi is done" option in "Frameserver" tab before you hit the "Go!" button.

When the DVD2AVI processing is done a little window with the AviSynth script will appear. Edit and change it like this:

1) To convert a PAL 2.35:1 (1.85:1) anamorphic DVD to a SVCD that looks like a 1.85:1 (4:3) DVD, make your script look like this:
...
Crop(90,0,540,576) <= insert this line
SimpleResize(480,576) <= this line depends on the resize method used
AddBorders(0,72,0,72) <= delete this line if present
...

2) To convert a NTSC 2.35:1 (1.85:1) anamorphic DVD to a SVCD that looks like a 1.85:1 (4:3) DVD, make your script look like this:
...
Crop(90,0,540,480) <= insert this line
SimpleResize(480,480) <= this line depends on the resize method used
AddBorders(0,60,0,60) <= delete this line if present
...

3) To convert a PAL 2.35:1 (1.85:1) letterboxed DVD to a SVCD that looks like a 1.85:1 (4:3) DVD, make your script look like this:
...
Crop(90,72,540,432) <= insert this line
SimpleResize(480,576) <= this line depends on the resize method used
AddBorders(0,72,0,72) <= delete this line if present
...

4) To convert a NTSC 2.35:1 (1.85:1) letterboxed DVD to a SVCD that looks like a 1.85:1 (4:3) DVD, make your script look like this:
...
Crop(90,60,540,360) <= insert this line
SimpleResize(480,480) <= this line depends on the resize method used
AddBorders(0,60,0,60) <= delete this line if present
...

Then hit the "OK" button of the AviSynth script window and the conversion process will continue as usual but you will end up with a 2.35:1 (1.85:1) movie converted to 1.85:1 (4:3) looking movie.

But be aware, with method 3) and 4) the source gets stretched vertically too (from 432/360 pixels height to 576/480 pixels height) so it is recommended to use the BicubicResize method because the SimpleResize method is not really good in stretching up and the BilinearResize also but still better than the SimpleResize. All in all you also loose some picture information from the sides of the original source and because of the upscaling the picture quality will slightly suffer.

If you want to create a anamorphic SVCD instead of a letterboxed SVCD from your anamorphic DVD sources then use method 3) and 4) instead of method 1) and 2) with your sources. But be aware picture quality will dramatically decrease in this case.

Q64: How can I avoid encoding the TV overscan area and therefore save some bitrate that would be wasted because my TV is not able to show this area?
A:
Nearly all TV sets are not capable of showing all the encoded information of a DVD/SVCD. In fact they usually can't show a 16 pixels edge around the whole movie so it is not necessary to encode this information so the bitrate is better be used on other parts.

1) For anamorphic (16:9) PAL DVD source change your AviSynth script to look like this:
...
Crop(24,0,672,576) <= insert this line
SimpleResize(448,432) <= this line depends on the resize method used
AddBorders(16,72,16,72) <= add this line if not present
...

2) For anamorphic (16:9) NTSC DVD source change your AviSynth script to look like this:
...
Crop(24,0,672,480) <= insert this line
SimpleResize(448,360) <= this line depends on the resize method used
AddBorders(16,60,16,60) <= add this line if not present
...

3) For 4:3 (letterboxed) PAL DVD source change your AviSynth script to look like this:
...
Crop(24,16,672,544) <= insert this line
SimpleResize(448,544) <= this line depends on the resize method used
AddBorders(16,16,16,16) <= add this line if not present
...

4) For 4:3 (letterboxed) NTSC DVD source change your AviSynth script to look like this:
...
Crop(24,16,672,448) <= insert this line
SimpleResize(448,448) <= this line depends on the resize method used
AddBorders(16,16,16,16) <= add this line if not present
...

Note: With anamorphic (16:9) DVD sources it is not necessary to crop 16 pixels from the top and the bottom because usually there's already some black borders with a 2.35:1 movie and with a 1.85:1 movie it is not good either because due to the anamorphic format you will loose some picture information if you have a 4:3 TV set and your standalone DVD player does the letterboxing.

Also, be aware that you will have some black borders on the left and the right when using a software DVD player - so this method should only be used if you just watch your SVCDs on your TV set.

Last edited by gerti67; 21st July 2002 at 16:14.
gerti67 is offline