PyNvCodec.PyFfmpegDecoder¶
- class PyNvCodec.PyFfmpegDecoder¶
- __init__(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder, input: str, opts: Dict[str, str], gpu_id: int = 0) None ¶
Constructor method.
- Parameters:
input – path to input file
opts – AVDictionary options that will be passed to AVFormat context.
Methods
Codec
(self)Return video codec used in encoded video stream.
ColorRange
(self)Get color range information stored in video file.
ColorSpace
(self)Get color space information stored in video file.
DecodeSingleFrame
(self, frame)Decode single video frame from input file.
DecodeSingleSurface
(self)Decode single video frame from input file and upload to GPU memory.
Format
(self)Return encoded video file pixel format.
Framerate
(self)Return encoded video file framerate.
GetMotionVectors
(self)Return motion vectors of last decoded video frame.
Height
(self)Return encoded video file height in pixels.
Width
(self)Return encoded video file width in pixels.
__init__
(self, input, opts[, gpu_id])Constructor method.
- Codec(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder) PyNvCodec._PyNvCodec.CudaVideoCodec ¶
Return video codec used in encoded video stream.
- ColorRange(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder) PyNvCodec._PyNvCodec.ColorRange ¶
Get color range information stored in video file. Please not that some video containers may not store this information.
- Returns:
color range information
- ColorSpace(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder) PyNvCodec._PyNvCodec.ColorSpace ¶
Get color space information stored in video file. Please not that some video containers may not store this information.
- Returns:
color space information
- DecodeSingleFrame(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder, frame: numpy.ndarray[numpy.uint8]) bool ¶
Decode single video frame from input file.
- Parameters:
frame – decoded video frame
- Returns:
True in case of success, False otherwise
- DecodeSingleSurface(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder) VPF::Surface ¶
Decode single video frame from input file and upload to GPU memory.
- Returns:
Surface allocated in GPU memory. It’s Empty() in case of failure,
non-empty otherwise.
- Format(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder) PyNvCodec._PyNvCodec.PixelFormat ¶
Return encoded video file pixel format.
- Framerate(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder) float ¶
Return encoded video file framerate.
- GetMotionVectors(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder) numpy.ndarray[PyNvCodec._PyNvCodec.MotionVector] ¶
Return motion vectors of last decoded video frame.
- Returns:
numpy array with motion vectors.
- Height(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder) int ¶
Return encoded video file height in pixels.
- Width(self: PyNvCodec._PyNvCodec.PyFfmpegDecoder) int ¶
Return encoded video file width in pixels.