export_video

menpo.io.export_video(images, file_path, overwrite=False, fps=30, **kwargs)[source]

Exports a given list of images as a video. Ensure that all the images have the same shape, otherwise you might get unexpected results from the ffmpeg writer. The file_path argument is a Path representing the path to save the video to. At this time, it is not possible to export videos directly to a file buffer.

Due to the mix of string and file types, an explicit overwrite argument is used which is False by default.

Note that exporting of GIF images is also supported.

Parameters
  • images (list of Image) – The images to export as a video.

  • file_path (Path) – The Path to save the video at. File buffers are not supported, unlike other exporting formats.

  • overwrite (bool, optional) – Whether or not to overwrite a file if it already exists.

  • fps (int, optional) – The number of frames per second.

  • **kwargs (dict, optional) – Extra parameters that are passed through directly to the exporter. Please see the documentation in the menpo.io.output.video package for information about the supported arguments.

Raises
  • ValueError – File already exists and overwrite != True

  • ValueError – The input is a buffer and not a valid Path

  • ValueError – The provided extension does not match to an existing exporter type (the output type is not supported).