moviepy.video.compositing.CompositeVideoClip.CompositeVideoClip#

class moviepy.video.compositing.CompositeVideoClip.CompositeVideoClip(clips, size=None, bg_color=None, use_bgclip=False, is_mask=False)[source]#

A VideoClip made of other videoclips displayed together. This is the base class for most compositions.

Parameters:
  • size -- The size (width, height) of the final clip.

  • clips --

    A list of videoclips.

    Clips with a higher layer attribute will be displayed on top of other clips in a lower layer. If two or more clips share the same layer, then the one appearing latest in clips will be displayed on top (i.e. it has the higher layer).

    For each clip:

    • The attribute pos determines where the clip is placed.

      See VideoClip.set_pos

    • The mask of the clip determines which parts are visible.

    Finally, if all the clips in the list have their duration attribute set, then the duration of the composite video clip is computed automatically

  • bg_color -- Color for the unmasked and unfilled regions. Set to None for these regions to be transparent (will be slower).

  • use_bgclip -- Set to True if the first clip in the list should be used as the 'background' on which all other clips are blitted. That first clip must have the same size as the final clip. If it has no transparency, the final clip will have no mask.

  • clip. (The clip with the highest FPS will be the FPS of the composite)

close()[source]#

Closes the instance, releasing all the resources.

frame_function(t)[source]#

The clips playing at time t are blitted over one another.

playing_clips(t=0)[source]#

Returns a list of the clips in the composite clips that are actually playing at the given time t.