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, start_frame=0)[source]

Load a video through the use of a generator.

Parameters:
fnamestring

Video file name, e.g. bickbuckbunny.mp4

heightint

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

widthint

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

num_framesint

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_greybool

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

inputdictdict

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

outputdictdict

Output dictionary parameters, i.e. how to encode the data between backend and python.

backendstring

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

verbosityint

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

start_frameint

Skip the first start_frame frames before reading (issue #166). Uses FFmpeg’s fast keyframe seek; the first frame returned may snap to the nearest keyframe at or before the requested position.

Returns:
vid_gengenerator

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

plugin_argskeywords

Passed to the given plugin.