PDA

View Full Version : Scriptclip/Frameevaluate 1-frame lag making me crazy


Mug Funky
27th September 2004, 20:01
i've noticed that avisynth's conditional filtering comes with a 1 frame lag that seems impossible to defeat.

does anyone have an idea how to overcome this? and if there is no workaround, is it something that could be changed in the next release of avisynth?

it's not a terribly big deal, but i've got a couple of possibly useful scripts that rely on conditional filtering but are not useful if they are working on the wrong frames. in particular i've made a field-blend killer but i don't know if it works properly yet because i can only see it de-blending the frame after the blend...

stickboy
28th September 2004, 04:23
I don't use ScriptClip/FrameEvaluate much... can you post a sample script that clearly demonstrates the problem?

Didée
28th September 2004, 09:07
I revise my former statement
don't break your head too much over Restore24
to the opposite: dive deep into it.

I've really no clue what I'm doing right that you're doing wrong. (Eventually it's just luck.) But Restore24 definetly does work on the right frames. :Phew:


[edit]

I notice your're first assigning your global variables in/through a conditional statement, and then using those values in a second, _independant_ statement.

Compare that to the core function of Restore24:
function Calculate( clip clip )
{
c99=scriptclip(out, "Evaluate()")
c30=FrameEvaluate(c99, "global IsBlend_c = (btest_c<(btest_p1)&&(btest_c<(btest_n1))")
c10=FrameEvaluate(c30, "global btest_n1 = AverageLuma(edge_n1)") #
c1=FrameEvaluate(c10, "ShiftBackValues") #
return(c1)
}
Here, all conditional expressions are referencing each other, in the usual "backwards" style. In particular, the FrameEvaluate's (where I gather the basic metrics) are referencing the final ScriptClip (where the metrics are used).

This way, it works.

Mug Funky
28th September 2004, 12:22
cheers, didee. i'll try rearranging things :)

so it's to do with the direction things are parsed? hmm... i'm going to have to learn to think backwards :)