Log in

View Full Version : avisynth read AR ????


erspicu
31st March 2007, 10:40
I write a avisynth, part content like following

w = float (Width)
h = float (Height)
rate = int ((w / h) * 1000)
srate = w / h

( rate >= 1740 && rate <= 1800 )? Eval("""
LanczosResize(480,272)
"""):Eval("""
""")

( rate < 1740 )? Eval("""
new_w = srate * 272
new_w = int (new_w)
new_w = new_w - (new_w%4)
LanczosResize(new_w,272)
add_w = (480 - new_w)/ 2
AddBorders(add_w,0,add_w,0)
"""):Eval("""
""")

( rate > 1800 )? Eval("""
new_h = 480 / srate
new_h = int (new_h)
new_h = new_h - (new_h%4)
LanczosResize(480,new_h)
add_h = (272 - new_h)/ 2
AddBorders(0,add_h,0,add_h)
"""):Eval("""
""")

this can auto add boarder to make a right size aspect.
but some movies files like vob .mpg(mpeg2),it has it specially
AR (720x480 by pixel , it's 3:2 ,but in fact it's 4:3 or 16:9).

so my avisynth script is lost right aspect.

is there any possiable to get movie correct AR info?

avisynth Clip Properties seems no AR info .....

Alain2
3rd April 2007, 21:15
but some movies files like vob .mpg(mpeg2),it has it specially
AR (720x480 by pixel , it's 3:2 ,but in fact it's 4:3 or 16:9).
Not exactely...
Have a look here (http://www.mir.com/DMG/aspect.html)

zambelli
5th April 2007, 04:03
Not exactely...
Have a look here (http://www.mir.com/DMG/aspect.html)
I believe Avisynth supports VideoInfoHeader2, so in the case of DirectShowSource() it shouldn't be a problem to extract PAR information - if the upstream decoder supports it, of course. I haven't checked Avisynth beta development, but it sounds like something that would be pretty easy to add to Avisynth.