Assuming you have 23.976 animu.??
- Code: Select all
Selectevery(28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
fadeloop(8,20)
function fadeloop(clip c, int fade, int n)
{
Assert(n >= 0 && fade >= 1) #preventing infinite loop, or so I hope
dissolve(c.trim(0,-(n+fade)),c.trim(n+fade,0),fade)
on = round(last.framerate)-(fade/2)
n = n+on
return (n >= c.framecount) ? last : fadeloop(last,fade,n)
}
AviSynth to the rescue, recursion is fun.
Ok, let's comment what we have there. Selectevery should be called before the recursion function, with a matching number of frames and 0s (ie, that's 28 0s there)?
This example is based on 8 frames long fades and about 1 second long scenes at 23.976.
Basically, you should match the selectevery with the parameters you call fadeloop (ie, 28 comes from fade+n)?
As for fadeloop, you should always call n with a starting value of round(last.framerate)-(fade/2)? It's 20 in this specific case => round(23.976)-(8/2) = 24-4 = 20. Of course, this could be automated, but I would need a way to know it's the first iteration of the loop, and I didn't bother thinking of a way, so for the time being, just bear with it, or have avisynth do the math for you (copy the on line outside of the loop and call fadeloop with that)? So basically, for lazier peeps:
- Code: Select all
Selectevery(28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
fade = 8
on = round(last.framerate)-(fade/2)
fadeloop(fade,on)
function fadeloop(clip c, int fade, int n)
{
Assert(n >= 0 && fade >= 1) #preventing infinite loop, or so I hope
dissolve(c.trim(0,-(n+fade)),c.trim(n+fade,0),fade)
on = round(last.framerate)-(fade/2)
n = n+on
return (n >= c.framecount) ? last : fadeloop(last,fade,n)
}
Fuck AFX, we have AviSynth!
Also, this
might fuck up with fade of an odd value, so for the sake of not having me to :eff: more, try to only use even values.