Log in

View Full Version : Conditional Resize?


niltz
18th October 2007, 02:59
Is there a way to have a general avs script that I can use for multiple files, and it only resizes the video if the video is greater than a certain size?

Basically I want to take a bunch of videos and resize them to be no larger than 320x240, however if the video is already smaller than that then I don't want to upscale the video and would rather leave it at its already smaller size.

Also, can I do something similar with FPS? Anything that has a higher FPS than say 24 I want to make 24 FPS, but if it is 23FPS then I want to leave it at that.

I noticed there is a ConditionalFilter, perhaps that would come in handy but I am really new to AviSynth and don't know where to start.

I hope that makes sense.

IanB
18th October 2007, 03:52
(width() > 320) || (height > 240) ? Last.xxxResize(320, 240) : Last

Leak
18th October 2007, 09:44
Basically I want to take a bunch of videos and resize them to be no larger than 320x240, however if the video is already smaller than that then I don't want to upscale the video and would rather leave it at its already smaller size.
While AviSynth surely is the right tool for resizing the bigger clips it will always decompress the files you open with it which means you'd have to re-compress the smaller files anyway, which will surely harm quality further.

So unless you want to concatenate all your input files into one single resulting video you might need something else to decide which files to resize and which to keep.

Also, when concatenating videos you'd have to pad the smaller files to 320x240 anyway as the resulting video has to have the same framesize throughout.