You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which version are you using? As you can see in the error, your variable clip is no longer a clip, but a tuple. This is because the .pos(...) is returning a tuple with a (x, y) position. If you want to get the clip positioned, you should use clip = clip.with_position(...), in recent versions the names have been refactored so with_position is more intuitive.
I found a solutionYou will see that the documentation about pos is not clear / may be not updated Envoyé de mon iPhoneLe 15 mars 2025 à 14:52, Implosiv3 ***@***.***> a écrit :
Which version are you using? As you can see in the error, your variable clip is no longer a clip, but a tuple. This is because the .pos(...) is returning a tuple with a (x, y) position. If you want to get the clip positioned, you should use clip = clip.with_position(...), in recent versions the names have been refactored so with_position is more intuitive.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
Implosiv3 left a comment (Zulko/moviepy#2396)
Which version are you using? As you can see in the error, your variable clip is no longer a clip, but a tuple. This is because the .pos(...) is returning a tuple with a (x, y) position. If you want to get the clip positioned, you should use clip = clip.with_position(...), in recent versions the names have been refactored so with_position is more intuitive.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
I have a question regarding this attribute pos in
Impossible to use it and impossible to find "VideoClip.set_pos" details.
I want to put my clip at the center of a bigger frame
pos
A function t->(x,y) where x,y is the position of the clip when it is composed with other clips. See VideoClip.set_pos for more details
i tried this
clip = clip.pos(("center", "center"))
and also
clip = clip.pos((100, 100))
the error :
Traceback (most recent call last):
File "/Code_Diaporama/create_slideshow.py", line 100, in
create_slideshow(
File "/Code_Diaporama/create_slideshow.py", line 75, in create_slideshow
final_video = CompositeVideoClip(clips)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Code_Diaporama/.venv/lib/python3.11/site-packages/moviepy/video/compositing/CompositeVideoClip.py", line 98, in init
self.clips = sorted(self.clips, key=lambda clip: clip.layer_index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Code_Diaporama/.venv/lib/python3.11/site-packages/moviepy/video/compositing/CompositeVideoClip.py", line 98, in
self.clips = sorted(self.clips, key=lambda clip: clip.layer_index)
^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'layer_index'
The text was updated successfully, but these errors were encountered: