@@ -24,10 +24,24 @@ doctest = false
2424# driver, falling back to software (see backend::open). `cuda-12020` pins the CUDA
2525# API version so the build needs no CUDA toolkit.
2626nvenc = [" dep:nvidia-video-codec-sdk" , " nvidia-video-codec-sdk/dynamic-loading" , " cudarc/fallback-dynamic-loading" , " cudarc/cuda-12020" ]
27+ # Intel/AMD VAAPI hardware encoder (Linux). Off by default; enable for a build
28+ # that should use VAAPI where present. Everything is dlopen'd at runtime:
29+ # discord/cros-codecs's `vaapi_dlopen` resolves libva through the cros-libva
30+ # `dlopen` feature (a fork feature, see the root [patch.crates-io]). So a
31+ # vaapi-enabled binary still links on a libva-less builder and still loads on
32+ # machines without libva, falling back to software (see backend::open). The
33+ # build still needs libva *headers* for bindgen (provided by the nix devShell).
34+ vaapi = [" dep:cros-codecs" ]
2735
2836[dependencies ]
2937anyhow = " 1"
3038bytes = " 1"
39+ # VAAPI H.264 encoder + zero-copy dmabuf import, gated behind `vaapi` + a linux
40+ # cfg. discord's fork is the maintained one: cros-libva 0.0.13 so it builds
41+ # against libva >= 2.23 (published cros-codecs pins the broken 0.0.12), plus a
42+ # hardened H.264 encoder (packed SPS/PPS + slice headers, frame_num, rate
43+ # control). `vaapi_dlopen` loads libva at runtime.
44+ cros-codecs = { git = " https://github.com/discord/cros-codecs.git" , branch = " discord-0.0.5" , optional = true , default-features = false , features = [" vaapi_dlopen" ] }
3145cudarc = { version = " 0.19" , optional = true , default-features = false , features = [" driver" ] }
3246moq-mux = { workspace = true }
3347moq-net = { workspace = true }
0 commit comments