spdl.io.streaming_load_video_nvdec¶
- streaming_load_video_nvdec(src: str | Path | bytes | object, device_config: CUDAConfig, *, num_frames: int, post_processing_params: dict[str, int] | None = None) Iterator[list[CUDABuffer]] [source]¶
Load video from source chunk by chunk using NVDEC.
See also
streaming_nvdec_decoding
: Demonstrates how to decode a long video using NVDEC.
- Parameters:
src – The source URI. Passed to
Demuxer
.device_config – The CUDA device config. See
NvDecDecoder
for details.num_frames – The maximum number of frames yielded at a time.
post_processing_params – The post processing parameters passed to
NvDecDecoder.init
.
- Yields:
List of at most
num_frames
CUDA buffers. Each CUDA buffer contain a frame in NV12 format. The shape is(height + height // 2, width)
. The bottom one-third contains interleaved UV plane, and the top part contains the Y plane.Use
nv12_to_rgb()
ornv12_to_bgr()
to convert to RGB frames.