poisondeathray
5th March 2020, 17:54
Can someone give some Animate() examples for vapoursynth? Maybe something to do with core.std.FrameEval ?
http://www.vapoursynth.com/doc/functions/frameeval.html
e.g avisynth Animate overlay position (x,y) between frame range (t0,t1)
red = blankclip(color=color_red)
green = blankclip(width=320, height=240, color=color_lime)
Animate(0,120, "MoveOverlay",red,green,0,0, red,green,320,240)
function MoveOverlay(clip bg, clip fg, int x, int y)
{
Overlay(bg, fg, x, y)
}
How would I do something similar in vapoursynth ?
I'm guessing you have to define a wrapper function.
How would you structure it so ,the variables are easily changed/controllable? Such as over what frame range, x,y position
Also how would you change the "keyframe" interpolation from linear to something else ?
I think I'm having problems structuring the def, including control over the frame range
import havsfunc as haf
import functools
red = core.std.BlankClip(color=[255, 0, 0])
green = core.std.BlankClip(width=320, height=240, color=[0, 255, 0])
def MoveOverlay(red, green, x, y):
return haf.Overlay(red, green, x, y)
ani = core.std.FrameEval(red, functools.partial(MoveOverlay(red,green 320,240), clip=red))
ani.set_output()
Thanks
http://www.vapoursynth.com/doc/functions/frameeval.html
e.g avisynth Animate overlay position (x,y) between frame range (t0,t1)
red = blankclip(color=color_red)
green = blankclip(width=320, height=240, color=color_lime)
Animate(0,120, "MoveOverlay",red,green,0,0, red,green,320,240)
function MoveOverlay(clip bg, clip fg, int x, int y)
{
Overlay(bg, fg, x, y)
}
How would I do something similar in vapoursynth ?
I'm guessing you have to define a wrapper function.
How would you structure it so ,the variables are easily changed/controllable? Such as over what frame range, x,y position
Also how would you change the "keyframe" interpolation from linear to something else ?
I think I'm having problems structuring the def, including control over the frame range
import havsfunc as haf
import functools
red = core.std.BlankClip(color=[255, 0, 0])
green = core.std.BlankClip(width=320, height=240, color=[0, 255, 0])
def MoveOverlay(red, green, x, y):
return haf.Overlay(red, green, x, y)
ani = core.std.FrameEval(red, functools.partial(MoveOverlay(red,green 320,240), clip=red))
ani.set_output()
Thanks