Log in

View Full Version : Display Aspect Ratio


doal
30th March 2012, 16:46
How can I get Display Aspect Ratio (DAR) in avisynth for some conditional resizing?
I can resize with SAR=float(width/height). But in case of SAR=/=DAR, media player will still need to resize it to DAR (with bicubic? not sure).
I want to Spline64resize to target res in a single step, apply sharpen afterward, and eliminate the need of media player touching the output.

TheSkiller
30th March 2012, 16:54
You can't. AviSynth doesn't provide a clip property for DAR, and therefore it cannot read such flag from a source. You'd have to set it manually.
For example DAR=Float(4/3).

You can find all the supported clip properties here (http://avisynth.org/mediawiki/Clip_properties).

chainik_svp
30th March 2012, 22:24
You can. But only with external tool that knows on what screen video player is running ;)
Check this (http://www.avsforum.com/avs-vb/showthread.php?t=1326189). If you've got some skills you'll be able to do what you want.

doal
30th March 2012, 23:25
or perhaps I could round the SAR to the nearest DAR?
something like:
SAR <=1.6 DAR=4/3
SAR >1.6 and <=1.8 DAR=16/9
SAR >1.8 and <=2.1 DAR=1.85
SAR >2.1 DAR=2.39

I'm not familiar with avisynth conditional format. Would you please check the following?
SAR = float(width/height)
(SAR<=1.6) ? DAR = float(4/3) : last
(SAR>1.6) && (SAR<=1.8) ? DAR = float(16/9) : last
(SAR>1.8) && (SAR<=2.1) ? DAR = float(1.85) : last
(SAR>2.1) ? DAR = float(2.36) : last

gyth
31st March 2012, 01:53
Keep in mind that a clip from a NTSC DVD will likely have dimensions of 720x480 whether it is DAR=4/3 or 16/9

doal
31st March 2012, 05:55
ah, just realized that, stupid me...