moviepy.video.fx.all.rotate¶
-
moviepy.video.fx.all.
rotate
(clip, angle, unit='deg', resample='bicubic', expand=True, center=None, translate=None, bg_color=None)[source]¶ Rotates the specified clip by
angle
degrees (or radians) anticlockwise If the angle is not a multiple of 90 (degrees) orcenter
,translate
, andbg_color
are notNone
, the packagepillow
must be installed, and there will be black borders. You can make them transparent with:>>> new_clip = clip.add_mask().rotate(72)
- Parameters:
- clipVideoClip
A video clip.
- anglefloat
Either a value or a function angle(t) representing the angle of rotation.
- unitstr, optional
Unit of parameter angle (either “deg” for degrees or “rad” for radians).
- resamplestr, optional
An optional resampling filter. One of “nearest”, “bilinear”, or “bicubic”.
- expandbool, optional
If true, expands the output image to make it large enough to hold the entire rotated image. If false or omitted, make the output image the same size as the input image.
- translatetuple, optional
An optional post-rotate translation (a 2-tuple).
- centertuple, optional
Optional center of rotation (a 2-tuple). Origin is the upper left corner.
- bg_colortuple, optional
An optional color for area outside the rotated image. Only has effect if
expand
is true.