feat(webrtc-sys): enable NVENC hardware encoding on Windows#991
feat(webrtc-sys): enable NVENC hardware encoding on Windows#991sionzee wants to merge 1 commit intolivekit:mainfrom
Conversation
The NVIDIA NVENC encoder code already exists in webrtc-sys (h264/h265 encoder impls, cuda_context with Windows LoadLibrary support, NvCodec SDK) but was only compiled on Linux. This enables it on Windows too. Requires CUDA Toolkit headers at build time (set CUDA_HOME or use default install path). At runtime, loads nvcuda.dll from the GPU driver. The VideoEncoderFactory composite pattern automatically tries NVIDIA first, falling back to software encoders if CUDA is unavailable.
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39a211f71a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .file("src/nvidia/NvCodec/NvCodec/NvDecoder/NvDecoder.cpp") | ||
| .file("src/nvidia/NvCodec/NvCodec/NvEncoder/NvEncoder.cpp") | ||
| .file("src/nvidia/NvCodec/NvCodec/NvEncoder/NvEncoderCuda.cpp") |
There was a problem hiding this comment.
Link CUDA/NVCUVID symbols for Windows NVENC build
When cuda.h is found on Windows, this block compiles NvDecoder.cpp/NvEncoder*.cpp and enables USE_NVIDIA_VIDEO_CODEC, but the Windows path never adds equivalent symbol resolution for CUDA/NVDEC (nvcuda/nvcuvid) while the Linux path explicitly wires lazy-load stubs via add_lazy_load_so(..., ["cuda", "nvcuvid"]). In CUDA-enabled Windows builds this can surface as unresolved external symbols for cu*/cuvid* during final linking, so the feature being enabled here may fail to build unless explicit Windows linking or lazy-load shims are added.
Useful? React with 👍 / 👎.
// accidentally opened PR
The NVIDIA NVENC encoder code already exists in webrtc-sys (h264/h265 encoder impls, cuda_context with Windows LoadLibrary support, NvCodec SDK) but was only compiled on Linux. This enables it on Windows too.
Requires CUDA Toolkit headers at build time (set CUDA_HOME or use default install path). At runtime, loads nvcuda.dll from the GPU driver.
The VideoEncoderFactory composite pattern automatically tries NVIDIA first, falling back to software encoders if CUDA is unavailable.