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

skvideo.io.vreader

skvideo.io.vreader(fname, height=0, width=0, num_frames=0, as_grey=False, inputdict=None, outputdict=None, backend='ffmpeg', verbosity=0)[source]

Load a video through the use of a generator.

Parameters:

fname : string

Video file name, e.g. bickbuckbunny.mp4

height : int

Set the source video height used for decoding. Useful for raw inputs when video header does not exist.

width : int

Set the source video width used for decoding. Useful for raw inputs when video header does not exist.

num_frames : int

Only read the first num_frames number of frames from video. Setting num_frames to small numbers can significantly speed up video loading times.

as_grey : bool

If true, only load the luminance channel of the input video.

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 between backend and python.

backend : string

Program to use for handling video data. Only ‘ffmpeg’ and ‘libav’ are supported at this time.

verbosity : int

Setting to 0 (default) disables all debugging output. Setting to 1 enables all debugging output. Useful to see if the backend is behaving properly.

Returns:

vid_gen : generator

returns ndarrays, shape (M, N, C) where M is frame height, N is frame width, and C is number of channels per pixel

—————- :

plugin_args : keywords

Passed to the given plugin.