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]#
Finite state ffmpeg -i command option file information parser. Is designed to parse the output fast, in one loop. Iterates line by line of the ffmpeg -i <filename> [-f null -] command output changing the internal state of the parser.
- 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.
- parse()[source]#
Parses the information returned by FFmpeg in stderr executing their binary for a file with
-ioption and returns a dictionary with all data needed by MoviePy.
- parse_data_by_stream_type(stream_type, line)[source]#
Parses data from "Stream ... {stream_type}" line.
- parse_duration(line)[source]#
Parse the duration from the line that outputs the duration of the container.