View Full Version : How come Animate() isn't working?
AviUser
19th April 2009, 19:48
Hello,
How come this isn't working:
vid.Animate(start_frame = 0, end_frame = 150, filtername = "Tweak", bright = 1.00, bright = 0.00)
It gives me error:
Invalid Arguments to function "Animate"
Thanks.
Gavino
19th April 2009, 20:09
Animate does not support named arguments for the filter you are animating, you have to use positional parameters. This makes it a bit awkward with a filter like Tweak which has lots of arguments.
Since bright comes positionally after hue and sat, you need to add in the missing default values (0.0 and 1.0) for those parameters:
vid.Animate(0, 150, "Tweak", 0.0, 1.0, 1.00, 0.0, 1.0, 0.00)
A neater alternative in these cases is to define your own 'wrapper' function to supply the missing arguments and animate that instead.
function MyTweak(clip c, float bright) {
Tweak(c, bright=bright)
}
vid.Animate(0, 150, "MyTweak", 1.00, 0.00)
AviUser
19th April 2009, 20:38
:thanks:
Okay, I tried to do this:
function MyTweak(clip c, float brightness)
{
Tweak(c, bright = brightness)
}
vid = ImageSource("file.jpg").BicubicResize(320, 280).ConvertToYUY2()
return vid.Animate(0, 150, "MyTweak", 1.00, 0.00)
But, the video didn't change at all. It was just the same image without any change.
Gavino
19th April 2009, 21:09
Ah, that's because in Tweak, the bright parameter is additive (range -255.0 to +255.0), not a multiplier. So varying from 1.00 to 0.00 is probably too small a change to be visible. Sorry I didn't spot that earlier. You probably want something like
return vid.Animate(0, 150, "MyTweak", 0.0, -255.0)
AviUser
20th April 2009, 18:11
Okay, thanks!
(sorry late response)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.