moviepy.video.io.ffmpeg_writer.ffmpeg_write_image#

moviepy.video.io.ffmpeg_writer.ffmpeg_write_image(filename, image, logfile=False, pixel_format=None)[source]#

Writes an image (HxWx3 or HxWx4 numpy array) to a file, using ffmpeg.

Parameters:
  • filename (str) -- Path to the output file.

  • image (np.ndarray) -- Numpy array with the image data.

  • logfile (bool, optional) -- Writes the ffmpeg output inside a logging file (True) or not (False).

  • pixel_format (str, optional) -- Pixel format for ffmpeg. If not defined, it will be discovered checking if the image data contains an alpha channel ("rgba") or not ("rgb24").