Skip to content

File nvdec_decoder.hpp

FileList > plugins > semantic_python > nvdec_decoder.hpp

Go to the source code of this file

NVDEC hardware H.265 decoder for the semantic_python plugin. More...

  • #include "nv12_to_rgb.cuh"
  • #include <cstdint>
  • #include <cuda.h>
  • #include <cuda_runtime.h>
  • #include <NvDecoder/NvDecoder.h>
  • #include <stdexcept>
  • #include <string>

Namespaces

Type Name
namespace ILLIXR
RAC_ERRNO_MSG.

Classes

Type Name
class nvdec_decoder

Detailed Description

Wraps the NVIDIA Video Codec SDK NvDecoder sample class. Decoded NV12 frames are converted to packed RGB uint8 on the GPU via nv12_to_rgb.cu, then copied to a pre-allocated pinned host buffer. The pinned buffer is exposed to Python as a zero-copy numpy array via a pybind11 capsule.

Output: shape (height, width, 3), dtype uint8, channel order RGB.

Supports SDK 12.x and 13.x. AV1 decode is conditionally compiled when NVDEC_HAS_AV1 is defined (requires Ada Lovelace or newer GPU).

NvDecoder's parser buffers pictures internally for reordering (see ulMaxDisplayDelay in the SDK's NvDecoder.cpp), so the picture returned by a given decode() call is not necessarily the picture submitted by that same call. decode() threads the caller's frame number through as the NVDEC picture timestamp so the caller can recover which picture was actually returned.

Thread safety: not thread-safe. All calls must come from the same thread (the switchboard decode callback thread).


The documentation for this class was generated from the following file /home/friedel/devel/ILLIXR/illixr_release/ILLIXR/plugins/semantic_python/nvdec_decoder.hpp