rave-nvcodec 0.3.0

RAVE NVDEC/NVENC hardware codec wrappers.
Documentation
rave-nvcodec-0.3.0 has been yanked.

Crates.io docs.rs License: MIT

rave-nvcodec

NVDEC/NVENC hardware codec wrappers for RAVE.

rave-nvcodec implements GPU decode and encode stages over NVIDIA Video Codec SDK APIs with CUDA-device-pointer based frame flow.

Scope

  • NVDEC decode wrapper (NvDecoder) implementing FrameDecoder
  • NVENC encode wrapper (NvEncoder) implementing FrameEncoder
  • Encoder configuration (NvEncConfig)
  • Raw FFI bindings for CUDA Video Codec SDK (sys module)

Public API Highlights

  • NvDecoder::new(ctx, source, codec)
  • NvEncoder::new(cuda_context, sink, config)
  • NvEncConfig for resolution/fps/bitrate/GOP/B-frame/pitch settings

Typical Usage

use std::sync::Arc;

use rave_core::codec_traits::{BitstreamSink, BitstreamSource};
use rave_core::context::GpuContext;
use rave_core::error::Result;
use rave_core::ffi_types::cudaVideoCodec;
use rave_nvcodec::nvdec::NvDecoder;

fn make_decoder(ctx: Arc<GpuContext>, source: Box<dyn BitstreamSource>) -> Result<NvDecoder> {
    NvDecoder::new(ctx, source, cudaVideoCodec::HEVC)
}

Runtime Requirements

  • NVIDIA driver libraries (libcuda, libnvcuvid, libnvidia-encode)
  • Compatible CUDA toolkit + Video Codec SDK runtime
  • Linux/WSL link search paths must include locations for NVIDIA driver libs

Notes

  • Decode output and encode input are GPU-resident NV12 frames.
  • Encode path caches resource registration by device pointer to avoid per-frame registration overhead.
  • This crate performs FFI-heavy work; all unsafe boundaries are isolated in codec modules and sys.