Log in

View Full Version : Need some help with Avisynth syntax


aegisofrime
15th June 2013, 02:29
Hi there!

I have some videos that I want to batch encode, and I want to come up with a bunch of if else conditionals to help me with this.

Some of the videos have small little black bars at the side. I want to crop these out and resize back to 720x480.

This is what I need in Pseudocode:

If(Autocrop Crop suggestion > 0)
{
Autocrop(mode=0)
Spline36Resize(720,480)
}
else
if(1280x720 > Resolution > 720x480)
{
#Some videos have non standard resolutions, so I want to resize them to 720,480 for the sake of standardization
Spline36Resize(720,480)
}
#The rest of the processing chain such as denoising continues from here.


Any tips on how I can achieve this? Thanks!

Overdrive80
17th June 2013, 23:28
You can try it, even I dont test. ^^'

Autocrop_value=video.Autocrop()
vertical_res=video.height()

video = (Autocrop_value > 0) ? video.Autocrop(mode=0).Spline36Resize(720,480) :\
((vertical_res < 720) && (vertical_res > 480)) ? video.Spline36Resize(720,480) : video

EDIT: Edited code, thanks Gavino.

Gavino
18th June 2013, 08:37
video = ... : nop
You need to replace nop here by video.
In the case where no action is required, your code sets video to nop (ie integer 0) instead of leaving it unchanged.

Overdrive80
20th June 2013, 16:36
You need to replace nop here by video.
In the case where no action is required, your code sets video to nop (ie integer 0) instead of leaving it unchanged.

True, I should be indicated parameter video as return. ^^'