moviepy.video.io.ffmpeg_reader.FFMPEG_VideoReader#

class moviepy.video.io.ffmpeg_reader.FFMPEG_VideoReader(filename, decode_file=True, print_infos=False, bufsize=None, pixel_format='rgb24', check_duration=True, target_resolution=None, resize_algo='bicubic', fps_source='fps')[source]#

Class for video byte-level reading with ffmpeg.

close(delete_lastread=True)[source]#

Closes the reader terminating the process, if is still open.

get_frame(t)[source]#

Read a file video frame at time t.

Note for coders: getting an arbitrary frame in the video with ffmpeg can be painfully slow if some decoding has to be done. This function tries to avoid fetching arbitrary frames whenever possible, by moving between adjacent frames.

get_frame_number(t)[source]#

Helper method to return the frame number at time t

initialize(start_time=0)[source]#

Opens the file, creates the pipe.

Sets self.pos to the appropriate value (1 if start_time == 0 because it pre-reads the first frame).

property lastread#

Alias of self.last_read for backwards compatibility with MoviePy 1.x.

read_frame()[source]#

Reads the next frame from the file. Note that upon (re)initialization, the first frame will already have been read and stored in self.last_read.

skip_frames(n=1)[source]#

Reads and throws away n frames