API Reference >> skvideo.io.LibAVReader
Fork me on GitHub

skvideo.io.LibAVReader

class skvideo.io.LibAVReader(*args, **kwargs)[source]

Reads frames using Libav Using libav as a backend, this class provides sane initializations meant to handle the default case well.

Methods

close()
getShape() Returns a tuple (T, M, N, C)
nextFrame() Yields frames using a generator
__init__(*args, **kwargs)[source]

Initializes FFmpeg in reading mode with the given parameters

During initialization, additional parameters about the video file are parsed using skvideo.io.ffprobe. Then FFmpeg is launched as a subprocess. Parameters passed into inputdict are parsed and used to set as internal variables about the video. If the parameter, such as “Height” is not found in the inputdict, it is found through scanning the file’s header information. If not in the header, ffprobe is used to decode the file to determine the information. In the case that the information is not supplied and connot be inferred from the input file, a ValueError exception is thrown.

Parameters:

filename : string

Video file path

inputdict : dict

Input dictionary parameters, i.e. how to interpret the input file.

outputdict : dict

Output dictionary parameters, i.e. how to encode the data when sending back to the python process.

Returns:

none :

getShape()

Returns a tuple (T, M, N, C)

Returns the video shape in number of frames, height, width, and channels per pixel.

nextFrame()

Yields frames using a generator

Returns T ndarrays of size (M, N, C), where T is number of frames, M is height, N is width, and C is number of channels per pixel.