Skip to content

Pos and See VideoClip.set_pos for more details #2396

@nippotam

Description

@nippotam

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestions regarding functionality, usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions