image2mpeg

typhon.utils.image2mpeg(glob, outfile, framerate=12, resolution='1920x1080')[source]

Combine image files to a video using ffmpeg.

Notes

The function is tested for ffmpeg versions 2.8.6 and 3.2.2.

Parameters:
  • glob (str) – Glob pattern for input files.

  • outfile (str) – Path to output file. The file fileformat is determined by the extension.

  • framerate (int or str) – Number of frames per second.

  • resolution (str or tuple) – Video resolution given in width and height ("WxH" or (W, H)).

Raises:

Exception – The function raises an exception if the underlying ffmpeg process returns a non-zero exit code.

Example

>>> image2mpeg('foo_*.png', 'foo.mp4')