moviepy.video.VideoClip.UpdatedVideoClip#

class moviepy.video.VideoClip.UpdatedVideoClip(world, is_mask=False, duration=None)[source]#

Class of clips whose frame_function requires some objects to be updated. Particularly practical in science where some algorithm needs to make some steps before a new frame can be generated.

UpdatedVideoClips have the following frame_function:

def frame_function(t):
    while self.world.clip_t < t:
        world.update() # updates, and increases world.clip_t
    return world.to_frame()
Parameters:
  • world – An object with the following attributes: - world.clip_t: the clip’s time corresponding to the world’s state. - world.update() : update the world’s state, (including increasing world.clip_t of one time step). - world.to_frame() : renders a frame depending on the world’s state.

  • is_mask – True if the clip is a WxH mask with values in 0-1

  • duration – Duration of the clip, in seconds