Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th June 2013, 02:29   #1  |  Link
aegisofrime
Registered User
 
Join Date: Apr 2009
Posts: 478
Need some help with Avisynth syntax

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:
Code:
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!
aegisofrime is offline   Reply With Quote
Old 17th June 2013, 23:28   #2  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
You can try it, even I dont test. ^^'

Code:
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.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite

Last edited by Overdrive80; 20th June 2013 at 16:37.
Overdrive80 is offline   Reply With Quote
Old 18th June 2013, 08:37   #3  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by Overdrive80 View Post
Code:
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.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 20th June 2013, 16:36   #4  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 673
Quote:
Originally Posted by Gavino View Post
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. ^^'
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Radeon RX580 8GB DDR5 + ADATA SX8200 Pro 1 TB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.