moviepy.video.io.ffmpeg_reader.FFmpegInfosParser#

class moviepy.video.io.ffmpeg_reader.FFmpegInfosParser(infos, filename, fps_source='fps', check_duration=True, decode_file=False)[source]#

An (hopefully) robuste ffmpeg -i command option file information parser. Is designed to parse the output by extracting the different blocks of informations, based on the indentation, in order to create an easy to handle block tree

Parameters:
  • filename -- Name of the file parsed, only used to raise accurate error messages.

  • infos -- Information returned by FFmpeg.

  • fps_source -- Indicates what source data will be preferably used to retrieve fps data.

  • check_duration -- Enable or disable the parsing of the duration of the file. Useful to skip the duration check, for example, for images.

  • decode_file -- Indicates if the whole file has been decoded. The duration parsing strategy will differ depending on this argument.

class InfoBlock(block_line, indent_level=0)[source]#

Represents a block of output from ffmpeg, which can be an input file, stream, chapter or metadata.

add_child(child)[source]#

Adds a child to the current block.

exception ParseDimensionError[source]#

Error raised when we cannot find dimensions in a video stream

exception ParseDurationError[source]#

Error raised when we cannot find duration in a video stream

parse()[source]#

Parses the information returned by FFmpeg in stderr executing their binary for a file with -i option and returns a dictionary with all data needed by MoviePy.