moviepy.video.io.ImageSequenceClip.ImageSequenceClip#

class moviepy.video.io.ImageSequenceClip.ImageSequenceClip(sequence, fps=None, durations=None, with_mask=True, is_mask=False, load_images=False)[source]#

A VideoClip made from a series of images.

Parameters:
  • sequence --

    Can be one of these:

    • The name of a folder (containing only pictures). The pictures will be considered in alphanumerical order.

    • A list of names of image files. In this case you can choose to load the pictures in memory pictures

    • A list of Numpy arrays representing images.

  • fps -- Number of picture frames to read per second. Instead, you can provide the duration of each image with durations (see below)

  • durations -- List of the duration of each picture.

  • with_mask -- Should the alpha layer of PNG images be considered as a mask ?

  • is_mask -- Will this sequence of pictures be used as an animated mask.

  • load_images -- Specify that all images should be loaded into the RAM. This is only interesting if you have a small number of images that will be used more than once.

frame_function(t)[source]#

Retrieves the frame corresponding to the given time t.

Depending on whether the frames are loaded from files or provided as an in-memory sequence, this function either reads the frame from disk or accesses it directly from the sequence.

Parameters:

(float) (t) -- is to be retrieved.

Returns:

numpy.ndarray -- is True, the alpha channel of the image is returned as a float array normalized to the range [0, 1]. Otherwise, the RGB channels of the image are returned.

Return type:

The image frame at the specified time. If is_mask