Skip to main content

Module nvenc

Module nvenc 

Source
Expand description

NVIDIA NVENC hardware H.264 encoder loaded via runtime libcuda / libnvidia-encode. NVENC hardware H.264 encoder: CUDA-bound sessions that encode ARGB — or raw NV12 / YUV444 — frames from the X11 host-ARGB and Wayland dmabuf capture paths.

The module dynamically loads libcuda, libnvidia-encode and libEGL at runtime, negotiates the NVENC API version against the installed driver (set-once per process), and stamps every NVENCAPI struct with the exact NV_ENC_*_VER word the negotiated SDK defines, so one binary drives drivers from NVENC 10.0 (~R445) through 13.0. Frames reach the GPU three ways: a zero-copy dmabuf import (EGLImage → CUDA, the mapped plane registered with NVENC in place as pitch-linear memory or as a CUDA array), a pinned host→device upload of packed BGRA / RGBA that the hardware CSC converts, and a raw planar upload. Sessions reconfigure resolution and rate control in place, so a resize or bitrate change costs a few milliseconds instead of a full rebuild.

Structs§

NvencEncoder
A live NVENC H.264 encoder session with its CUDA context and interop resources.