skvideo.io
.FFmpegReader
skvideo.io
.FFmpegReader¶skvideo.io.
FFmpegReader
(*args, **kwargs)[source]¶Reads frames using FFmpeg
Using FFmpeg 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
inputdict : dict
outputdict : dict
|
---|---|
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.