spdl.io.decode_packets_nvdec¶
- decode_packets_nvdec(packets: VideoPackets | ImagePackets | list[ImagePackets], *, device_config: CUDAConfig | None = None, **kwargs) CUDABuffer [source]¶
[Experimental] Decode packets with NVDEC.
Warning
This API is exmperimental. The performance is not probed, and the specification might change.
Note
Unlike FFmpeg-based decoding, nvJPEG returns GPU buffer directly.
Note
For image, only baseline (non-progressive) JPEG formats are supported.
- Parameters:
packets – Packets object.
device_config – The device to use for decoding. See
spdl.io.cuda_config()
.crop_left (int) – Optional: Crop the given number of pixels from each side.
crop_top (int) – Optional: Crop the given number of pixels from each side.
crop_right (int) – Optional: Crop the given number of pixels from each side.
crop_bottom (int) – Optional: Crop the given number of pixels from each side.
width (int) – Optional: Resize the frame. Resizing is done after cropping.
height (int) – Optional: Resize the frame. Resizing is done after cropping.
pix_fmt (str or None) – Optional: Change the format of the pixel. Supported value is
"rgba"
. Default:"rgba"
.
- Returns:
A CUDABuffer object.