moviepy.video.fx.Rotate#
- class moviepy.video.fx.Rotate.Rotate(angle: float, unit: str = 'deg', resample: str = 'bicubic', expand: bool = True, center: tuple = None, translate: tuple = None, bg_color: tuple = None)[source]#
Rotates the specified clip by
angledegrees (or radians) anticlockwise If the angle is not a multiple of 90 (degrees) orcenter,translate, andbg_colorare notNone, there will be black borders. You can make them transparent with:>>> new_clip = clip.with_mask().rotate(72)
- Parameters:
clip (VideoClip)
clip. (A video)
angle (float)
rotation. (Either a value or a function angle(t) representing the angle of)
unit (str, optional)
radians). (Unit of parameter angle (either "deg" for degrees or "rad" for)
resample (str, optional)
"nearest" (An optional resampling filter. One of)
"bilinear"
"bicubic". (or)
expand (bool, optional)
true (If)
the (expands the output image to make it large enough to hold)
omitted (entire rotated image. If false or)
same (make the output image the)
image. (size as the input)
translate (tuple, optional)
2-tuple). (An optional post-rotate translation (a)
center (tuple, optional)
corner. (Optional center of rotation (a 2-tuple). Origin is the upper left)
bg_color (tuple, optional)
if (An optional color for area outside the rotated image. Only has effect)
true. (expand is)
- copy()#
Return a shallow copy of an Effect.
You must always copy an
Effectbefore applying, because some of them will modify their own attributes when applied. For example, setting a previously unset property by using target clip property.If we was to use the original effect, calling the same effect multiple times could lead to different properties, and different results for equivalent clips.
By using copy, we ensure we can use the same effect object multiple times while maintaining the same behavior/result.
In a way, copy makes the effect himself being kind of idempotent.