View Full Version : different script lines used according to source resolution


travolter
8th August 2014, 16:01
Hi!! probably this is basic avisynth.. but I dont know how to start.



I need a script that automatically use:

finesharp() if source is >1280x720
or
awarpsharp() if source is </=1280x720

How can I write these "conditions" in avisynth to create scripts like that? Use different script lines according to source image dimensions-.

Thnks

wonkey_monkey
8th August 2014, 16:27
Your first problem - if one is being pedantic - is that your pseudocode suggests you're trying to make a single comparison on two variables at the same time. What if the resolution is 1440x640?

For the actual problem, you want the ternary operator (?):


sharpened = source.width>1280 ? source.finesharp : source.awarpsharp


...or something along those lines.

travolter
8th August 2014, 17:43
@davidhorman, thanks for the help!! I got the idea. Also as you point is better to check source width rather than w&h