@@ -15,17 +15,55 @@ categories = ["multimedia", "multimedia::video", "multimedia::encoding"]
1515[lib ]
1616doctest = false
1717
18+ [features ]
19+ # NVIDIA NVENC hardware encoder (Linux only). Off by default; release builds
20+ # for Linux enable it. cudarc loads CUDA dynamically (no build-time CUDA), and
21+ # the NVENC API lives in the driver, so this is not a build dependency.
22+ nvenc = [" dep:nvidia-video-codec-sdk" , " cudarc/dynamic-loading" , " cudarc/cuda-12020" ]
23+ # Intel/AMD VAAPI hardware encoder (Linux only). Off by default; release builds
24+ # for Linux enable it. Links libva (stable soname); pairs with a V4L2 dmabuf
25+ # capture for a fully zero-copy path.
26+ vaapi = [" dep:cros-codecs" ]
27+
1828[dependencies ]
1929anyhow = " 1"
2030bytes = " 1"
21- # H.264 encode plus webcam capture (libavdevice). One system dependency
22- # covers both, and unlike a pure-Rust encoder it exposes the platform
23- # hardware encoders (h264_videotoolbox / h264_nvenc / h264_vaapi) we want
24- # for real-time capture. The `device` feature pulls in libavdevice for
25- # avfoundation / v4l2 / dshow camera input.
26- ffmpeg-next = { version = " 8" , features = [" device" ] }
31+ # VAAPI H.264 encoder + dmabuf import. Gated behind `vaapi` + a linux cfg; pinned
32+ # (pre-1.0 churns). Pulls libva (cros-libva) when the feature is on.
33+ cros-codecs = { version = " =0.0.6" , optional = true , default-features = false , features = [" vaapi" ] }
34+ cudarc = { version = " 0.16" , optional = true , default-features = false , features = [" driver" ] }
2735moq-mux = { workspace = true }
2836moq-net = { workspace = true }
37+ # Pure-Rust webcam capture (avfoundation / v4l2 / msmf), decoding MJPEG/YUYV to
38+ # RGBA. Platform input backends are enabled per-target below.
39+ nokhwa = { version = " 0.10.11" , default-features = false , features = [" decoding" ] }
40+ # NVENC backend, gated behind the `nvenc` feature + a linux cfg. Listed here
41+ # (not under a target table) so the feature can reference it on any host; the
42+ # code that uses it is `cfg(target_os = "linux")`.
43+ nvidia-video-codec-sdk = { version = " 0.4" , optional = true }
44+ # Vendored, statically-linked software H.264 fallback (no system dependency).
45+ openh264 = " 0.9.3"
2946thiserror = " 2"
3047tokio = { workspace = true , features = [" rt" , " macros" ] }
3148tracing = " 0.1"
49+ # RGBA -> I420 color conversion (replaces ffmpeg swscale).
50+ yuv = " 0.8.14"
51+
52+ [target .'cfg(target_os="linux")' .dependencies ]
53+ nokhwa = { version = " 0.10.11" , features = [" input-v4l" ] }
54+
55+ [target .'cfg(target_os="macos")' .dependencies ]
56+ block2 = " 0.6.2"
57+ dispatch2 = " 0.3.1"
58+ nokhwa = { version = " 0.10.11" , features = [" input-avfoundation" ] }
59+ objc2 = " 0.6.4"
60+ objc2-av-foundation = " 0.3.2"
61+ objc2-core-foundation = " 0.3.2"
62+ objc2-core-media = " 0.3.2"
63+ objc2-core-video = " 0.3.2"
64+ objc2-foundation = " 0.3.2"
65+ objc2-screen-capture-kit = " 0.3.2"
66+ objc2-video-toolbox = " 0.3.2"
67+
68+ [target .'cfg(target_os="windows")' .dependencies ]
69+ nokhwa = { version = " 0.10.11" , features = [" input-msmf" ] }
0 commit comments