Log in

View Full Version : How do i calculate correct crop for aspect ratio


Bodman
7th August 2003, 00:15
Hi Gang, Not sure if this should be in here, or AVIsynth forum or somewhere else.

Im converting svcd to dvdr (arrgh i hear u cry) but this is what im after.

SVCD is 480 x 480 (sometimes x 576), so width is 480 and height is something like 332 of picture and 2 lots of black borders (top and bottom) of 74 which = 480.

I normally frameserv with avisynth to CCE with something like this script

loadplugin("c:\windows\system32\MPEG2Dec.dll")
mpeg2source("I:\1.d2v")
crop(0,X,480,Y)
BicubicResize(720,480)
ResampleAudio(44100)

I need to calculate the X & Y

the crop command would typically look something like this

crop(0,74,480,332) but what i need to do is be able to work out the X & Y above but leave enough of the black borders so when this is resised to 720 x 480 the aspect is correct.

Is there a way to work this out

TIA

//Bodman

Bodman
7th August 2003, 23:44
Thanks, I know I can do that, but what im after is a way to work out the amount of borders to leave so the aspect is correct.

//Bodman

wmansir
8th August 2003, 04:44
I'm not sure you have to crop anything off, but I don't do DVD-R so I'm not sure. I mean, unless your doing an anamorphic encode.

Both a non-anamophic DVD and SVCD image are resized to fit your (4:3) screen (without adding any boarders as far as I know), so I don't think you have to clip any from the SVCD when resizing.

Now if you want to go from SVCD to anamorphic DVD you should chop 60 lines from the top and bottom (so your image is 480x360), resize to 720x480, and be sure to click the anamophic (16:9 AR) flag when encoding. Although, I doubt you'll get any better image quality from this. But like I said, I don't have a DVD-R (or WS TV) so I don't know.