@@ -8,51 +8,24 @@ license = "MIT OR Apache-2.0"
88version = " 0.0.4"
99edition = " 2024"
1010rust-version.workspace = true
11- # Not publishable to crates.io until `moq-vaapi` (the `vaapi` feature's dep) is
12- # published; it's an in-workspace path dependency for now. Flip back then.
13- publish = false
1411
1512keywords = [" quic" , " http3" , " webtransport" , " media" , " video" ]
1613categories = [" multimedia" , " multimedia::video" , " multimedia::encoding" ]
1714
1815[lib ]
1916doctest = false
2017
21- [features ]
22- # NVIDIA NVENC hardware encoder (Linux). Off by default; enable for a build that
23- # should use NVENC where present. Everything is dlopen'd at runtime: cudarc loads
24- # CUDA, and nvidia-video-codec-sdk's `dynamic-loading` (a fork feature, see the
25- # root [patch.crates-io]) loads libnvidia-encode. So an nvenc-enabled binary still
26- # links on a GPU-less builder and still starts on machines without the NVIDIA
27- # driver, falling back to software (see backend::open). `cuda-12020` pins the CUDA
28- # API version so the build needs no CUDA toolkit.
29- nvenc = [" dep:nvidia-video-codec-sdk" , " nvidia-video-codec-sdk/dynamic-loading" , " cudarc/fallback-dynamic-loading" , " cudarc/cuda-12020" ]
30- # Intel/AMD VAAPI hardware encoder (Linux). Off by default; enable for a build
31- # that should use VAAPI where present. The `moq-vaapi` crate (moq-dev/vaapi) builds
32- # against its own vendored libva headers and dlopen's libva at runtime, so a
33- # vaapi-enabled binary builds without system libva-dev, links on a libva-less
34- # builder, and still loads on machines without libva, falling back to software
35- # (see backend::open).
36- vaapi = [" dep:moq-vaapi" ]
37-
3818[dependencies ]
3919anyhow = " 1"
4020bytes = " 1"
41- cudarc = { version = " 0.19" , optional = true , default-features = false , features = [" driver" ] }
4221# Catalog types (VideoConfig / VideoCodec) the decode consumer reads.
4322hang = { workspace = true }
4423moq-mux = { workspace = true }
4524moq-net = { workspace = true }
46- # VAAPI H.264 encoder, gated behind the `vaapi` feature + a linux cfg. Listed here
47- # (not under a target table) so the feature can reference it on any host; the code
48- # that uses it is `cfg(target_os = "linux")` and it only builds when `vaapi` is
49- # enabled (which only happens on Linux, where libva headers exist).
50- moq-vaapi = { workspace = true , optional = true }
51- # NVENC backend, gated behind the `nvenc` feature + a linux cfg. Listed here
52- # (not under a target table) so the feature can reference it on any host; the
53- # code that uses it is `cfg(target_os = "linux")`.
54- nvidia-video-codec-sdk = { version = " 0.4" , optional = true }
5525# Vendored, statically-linked software H.264 fallback (no system dependency).
26+ # Always compiled in: hardware encoders (VideoToolbox / Media Foundation /
27+ # NVENC / VAAPI) are preferred, but openh264 is the fallback when none is usable
28+ # (GPU-less box, or a resolution a hardware encoder rejects).
5629openh264 = " 0.9.3"
5730thiserror = " 2"
5831tokio = { workspace = true , features = [" rt" , " macros" , " sync" , " time" ] }
@@ -61,6 +34,26 @@ tracing = "0.1"
6134yuv = " 0.8.14"
6235
6336[target .'cfg(target_os="linux")' .dependencies ]
37+ # NVENC hardware encoder, always-on for Linux. Everything is dlopen'd at runtime:
38+ # cudarc loads CUDA, and nvidia-video-codec-sdk's `dynamic-loading` (a fork
39+ # feature, see the root [patch.crates-io]) loads libnvidia-encode. So the binary
40+ # links on a GPU-less builder and still starts on machines without the NVIDIA
41+ # driver, falling back to the next encoder (see backend::open). `cuda-12020` pins
42+ # the CUDA API version so the build needs no CUDA toolkit.
43+ cudarc = { version = " 0.19" , default-features = false , features = [" driver" , " fallback-dynamic-loading" , " cuda-12020" ] }
44+ # Probe for the NVIDIA driver libraries before calling cudarc / the NVENC SDK,
45+ # which panic (process-abort under release `panic = "abort"`) if their library is
46+ # absent. Lets a GPU-less host fall back to the next encoder instead of crashing.
47+ libloading = " 0.8"
48+ # Intel/AMD VAAPI hardware encoder, always-on for Linux. Builds against its own
49+ # vendored libva headers and dlopen's libva at runtime, so it builds without
50+ # system libva-dev and still loads on machines without libva, falling back to the
51+ # next encoder (see backend::open).
52+ moq-vaapi = { workspace = true }
53+ # default-features off so the crate's `cuda-version-from-build-system` default
54+ # stays off: we pin the CUDA version via our own cudarc dep (cuda-12020) instead,
55+ # so the build needs no CUDA toolkit.
56+ nvidia-video-codec-sdk = { version = " 0.4" , default-features = false , features = [" dynamic-loading" ] }
6457# Native V4L2 webcam capture (replaces nokhwa). `v4l` streams MMAP buffers;
6558# MJPEG cameras are decoded with the pure-Rust `zune-jpeg` (no libjpeg/IJG).
6659v4l = " 0.14"
0 commit comments