visualizeutilswrite_video_from_images

write_video_from_images

visualize.utils.write_video_from_images(images, out_path, fps=24, images_format='.png', quality=5, codec='mpeg4', auto_sort_paths=True)

Creates a video from a set of images.

Images must be specified as a list of images, a directory with images or a list of directories with images. Uses glob pattern matching if a directory of images is specified (allows for using the “*” as a wildcard).

Note

Globbing is not enabled by default on Windows machines. If running this command on windows, please set the glob argument to False and specify a non-glob type match pattern.

Parameters:
  • images (list | str) – list of images, a directory with images or a list of directories with images

  • out_path (str) – dir where the video will be generated + name of the video

  • fps (int) – frames per second

  • images_format (str) – .png, .pdf, .jpg …

  • quality (int) – quality of the video. Only used with the mpeg4 codec

  • codec (str) – codec to use. Default is mpeg4.

  • auto_sort_paths (bool) – paths to images sorted

Returns:

None. Writes the video to the specified path.