moviepy.video.fx.all.accel_decel¶
-
moviepy.video.fx.all.
accel_decel
(clip, new_duration=None, abruptness=1.0, soonness=1.0)[source]¶ Accelerates and decelerates a clip, useful for GIF making.
- Parameters:
- new_durationfloat
Duration for the new transformed clip. If None, will be that of the current clip.
- abruptnessfloat
Slope shape in the acceleration-deceleration function. It will depend on the value of the parameter:
-1 < abruptness < 0
: speed up, down, up.abruptness == 0
: no effect.abruptness > 0
: speed down, up, down.
- soonnessfloat
For positive abruptness, determines how soon the transformation occurs. Should be a positive number.
- Raises:
- ValueError
When
sooness
argument is lower than 0.
Examples
The following graphs show functions generated by different combinations of arguments, where the value of the slopes represents the speed of the videos generated, being the linear function (in red) a combination that does not produce any transformation.