Log in

View Full Version : Calculating borders


marnix88
12th July 2006, 00:14
Hello, I have a problem with calculating borders (AVI to DVD).

Below is a calculation I use with a NTSC DVD and it always works fine.

DVD Size = 720 x 480
AVI Size = 624 x 256
720 - 624 = 96
256 + 96 = 352
480 - 352 = 128
128 / 2 = 64

AVISource("C:\testclip.avi")
LanczosResize(720,352)
AddBorders(0,64,0,64)



I thought that with a PAL DVD you only have to make the borders 'bigger', but that doesn't work. Everything looks squeezed.

DVD Size = 720 x 576
AVI Size = 624 x 256
720 - 624 = 96
256 + 96 = 352
576 - 352 = 224
224 / 2 = 112

AVISource("C:\testclip.avi")
LanczosResize(720,352)
AddBorders(0,112,0,112)


DVD2SVCD gives me the following numbers and they are correct.

BicubicResize(720,428,0.0,0.6)
AddBorders(0,74,0,74)

How does DVD2SVCD calculate these borders?

I understand the part below, but where is the '428' coming from?

576 - 428 = 148
148 / 2 = 74

Wilbert
12th July 2006, 10:20
DVD Size = 720 x 576; DAR 16/9
AVI Size = 624 x 256, PAR 1:1

The aspect ratio of the avi is 624/256 = 2.4375. The dvd is played back at 720*16/9 x 576, thus 1024 x 576. Removing the black borders gives: 1024 x (576-2*h), and this has to be equal to 2.4375. Thus

1024 / (576-2*h) = 2.4375

or

h = (576 - 1024/2.4375)/2 = 78

and the new height:

576 - 2*h = 420

Script:

BicubicResize(720,420,0.0,0.6)
AddBorders(0,78,0,78)

I think the results differ a bit from DVD2SVCD because it assumed ITU resizing and we didn't, but i'm not sure about that.

marnix88
12th July 2006, 15:10
Thanks for the explanation :)

Inc
12th July 2006, 15:54
I remember that Mediainfolib Thread ...

The dvd is played back at 720*16/9 x 576, thus 1024 x 576 On SW players yes, at Hardware DVD SAPs->TV Playback not.

Wilbert
12th July 2006, 20:11
I thought i said "we didn't assume ITU resizing" :) I didn't want to make it more complicated as it is.