Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.35k stars 1.55k forks source link

is clip.rotate(degree, center=True) not available? #1918

Open tianyinhuang opened 1 year ago

tianyinhuang commented 1 year ago

I want to make a short video that is a round image round.png rotating around its' own center.

import moviepy.editor as mp

duration = 10 img_file="round.png" img_clip=mp.ImageClip(img_file).rotate(lambda t: float(t*3), center=True).set_duration(duration) img_clip.write_videofile("rotating_video.mp4", fps=24)

Traceback (most recent call last): File "c:\rotating test3.py", line 7, in img_clip=mp.ImageClip(img_file).rotate(lambda t: float(t*3), center=True).set_duration(duration) TypeError: rotate() got an unexpected keyword argument 'center'

When i use help(clip.rotate) it shows: rotate(angle, unit='deg', resample='bicubic', expand=True), indeed no center argument which is different than the manual: moviepy.video.fx.all.rotate(clip, angle, unit='deg', resample='bicubic', expand=True, center=None, translate=None, bg_color=None)

What's problem and how to do the correction pls? --> Movipy up-to-date, python 3.9.7

keikoro commented 1 year ago

@tianyinhuang Please always include the full specs we ask for in our issue templates, including the exact MoviePy version, platform used etc.

I'd also ask you to reformat your issue so code samples and error logs are code-formatted, to make things easier to read. You can use the <> button of the web UI to do that, or manually enclose blocks of code in backticks ``` (three on the line before, three on the line after).