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 > Capturing and Editing Video > Avisynth Usage

Thread Tools Search this Thread Display Modes
Old 28th December 2002, 03:38   #1  |  Link
Registered User
esby's Avatar
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 is offline   Reply With Quote
Old 29th December 2002, 10:49   #2  |  Link
Richard Berg
developer wannabe
Richard Berg's Avatar
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.

AVISource "video.avi"
Trim 2000,2500
Trim 3000,3500
Trim 1000,1500

-- vs. --

Trim(2000,2500) ++ Trim(3000,3500) ++ Trim(1000,1500)
Richard Berg is offline   Reply With Quote
Old 29th December 2002, 14:07   #3  |  Link
Registered User
esby's Avatar
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:
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.
Of course we could use optionnal syntax like :
condition(source).macroTrim( filter(source) )
but maybe i'm going to far in the future ...

esby is offline   Reply With Quote
Old 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 )
But there is one big problem: the whole array would need to be evaluated before frameserving can start and it might take a while...

Maybe better:
In a way similar to Animate, the If filter would evaluate the condition for each frame. The condition function would return a single bool, and take as argument the source clip (second argument of If) and the frame number. The syntax could be extended to allow for condition functions with more parameters.
dividee is offline   Reply With Quote
Old 29th December 2002, 22:23   #5  |  Link
WarpEnterprises's Avatar
Join Date: Apr 2002
Location: Austria
Posts: 830
Is this functionally more than playing with Layer to switch between two clips?
(Of course it would not calc both layers)

The way dividee described it would indeed be a big jump forward...
WarpEnterprises is offline   Reply With Quote

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 21:44.

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