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. |
|
|
Thread Tools | Search this Thread | Display Modes |
28th December 2002, 03:38 | #1 | Link |
Registered User
Join Date: Oct 2001
Location: france
Posts: 521
|
using filter under conditional argument ( if <condition> then use this_filter
I am wondering if this kind of scripting is possible in avs.
I have seen there is an ? identifier that can do the if but i am wondering if there can be 'filters' (or dll) that could return a boolean depending of the condition on the frame parsed. eg : we know that picfix can have a problem with scene change, introducing color ghosting ( in the best case) and bad macro blocks (in the common case). if we could have something like that... !IsSceneChange(clip) ? source = source.antiblink(...) this function could desactivate the antiblink when it will create trash... esby |
29th December 2002, 10:49 | #2 | Link |
developer wannabe
Join Date: Nov 2001
Location: Brooklyn, NY
Posts: 1,211
|
This sort of thing will require a major overhaul of the scripting language, but believe me such ideas are very much on my mind for the future (v3.0+, I should say, before I scare sh0dan too much ). Heck, just reading Ben's website the other day, I was reminded that even the nonlinear scripting we take for granted was a new (and incompatible) thing not too long ago.
Code:
AVISource "video.avi" dup Trim 2000,2500 swap dup Trim 3000,3500 swap Trim 1000,1500 AlignedSplice AlignedSplice -- vs. -- AVISource("video.avi") Trim(2000,2500) ++ Trim(3000,3500) ++ Trim(1000,1500) |
29th December 2002, 14:07 | #3 | Link |
Registered User
Join Date: Oct 2001
Location: france
Posts: 521
|
I suppose the "Dup - Swap" code is quite old
(at least i hope to have figured out the example correctly), Cause as far i remember using avisynth i never used these function. One reason that make me thinking that too is the missing parenthesis. To be serious, i don't think this kind of structure could be a big problem to code, i have been thinking about it. What we need is : Filters that returns a new structure( array of boolean ) made of boolean values for the clip(true=use the filter, false=dont use) A new kind of function acting like a macro trim() , attached to this new structure, applying or not the filter(clip) passed in parameter, depending of the boolean value of the frame. This could give something like that as syntax: Code:
macroTrim( condition(source) , filter(source) ) condition(source) returning the array of boolean. filter(source) being any filter you might want to use or not on the source. Code:
condition(source).macroTrim( filter(source) ) esby |
29th December 2002, 20:53 | #4 | Link |
Registered User
Join Date: Oct 2001
Location: Brussels
Posts: 358
|
It might already be possible, as a function can already return an array, with this amended syntax (and renaming macroTrim to If )
Code:
If(condition(source),filter(source),source) Maybe better: Code:
If("condition",source,filter(source))
__________________
dividee |
Thread Tools | Search this Thread |
Display Modes | |
|
|