1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
[]
= "rivet-codec"
= true
= true
= "LICENSE.md"
= "README.md"
= true
= true
= "GPU video decode/encode dispatch (NVDEC/NVENC, AMF, QSV) plus colorspace, tonemap, audio, and probe for the rivet transcoder. Imported as `codec`."
[]
= "codec"
[]
# Default: legacy per-codec stack (openh264 / libde265 / libvpx /
# rav1d / libmpeg2 / libxvidcore / prores / nvdec / vulkan_video).
# No ffmpeg build prerequisites. Everything ships from cargo.
= []
# `ffmpeg`: activates the ffmpeg-next primary decoder. Brings the
# full libavcodec catalogue (H.264 / H.265 / VP8 / VP9 / AV1 / MPEG-2 /
# MPEG-4 / ProRes / …) + Vulkan / NVDEC / D3D11 / VAAPI hwaccel
# through one trait-dispatched `FfmpegDecoder`. When enabled, this
# becomes the PRIMARY path — legacy per-codec modules are still
# compiled as fallback but only engage when FfmpegDecoder errors or
# the uniform-plane detector fires.
#
# Build prerequisites (enable ONLY when these are set up):
# 1. FFmpeg ≥7.0 development libraries (headers + .lib / .dylib /
# .so). On Windows bootstrap via `vendor/ffmpeg/fetch.sh` and
# set `FFMPEG_DIR=$(pwd)/vendor/ffmpeg/ffmpeg-<ver>-full_build-shared`.
# 2. LLVM / libclang (bindgen dep). On Windows install via winget
# `LLVM.LLVM` (admin) or download https://github.com/llvm/llvm-project/releases
# and set `LIBCLANG_PATH=C:\Program Files\LLVM\bin`.
# 3. Runtime DLLs on PATH. Add `$FFMPEG_DIR/bin` before running
# tests / transcode_one.
#
# Invocation:
# cargo build --workspace --features codec/ffmpeg
= ["dep:ffmpeg-next"]
# PLATFORM NOTE for the three `shiguredo_*` GPU features below (`nvidia`,
# `amd`, `qsv`): they bindgen the vendor SDK headers at build time (needs
# libclang — set LIBCLANG_PATH). They compile on **Linux** (the production /
# Docker target, `rust:1.86-bookworm`), where clang gives the SDK's
# non-negative C enums the `unsigned int` (→ `u32`) underlying type that the
# crate source expects. They do **NOT** compile on a **Windows MSVC** host:
# the MSVC ABI makes C enums `int` (→ `i32`), producing E0308 mismatches
# inside the shiguredo crates (proven via `_Static_assert((enum E)-1 > 0)` —
# fails on `--target=*-windows-msvc`, passes on `--target=*-linux-gnu`). So
# build these features on Linux / in Docker; on a Windows dev box use the
# `ffmpeg` feature or leave them off. With every feature off, the hardware
# paths compile to construction-erroring stubs and the dispatcher just skips
# that tier.
# `qsv`: Intel QSV AV1 encode via our own hand-rolled oneVPL FFI (`encode/qsv.rs`,
# 8-bit NV12 + 10-bit P010). dlopens libvpl.so.2 / libvpl.dll — no build-time
# link, no bindgen, no header, so it builds on **both Windows MSVC and Linux**.
# Intel Arc / Meteor Lake+.
# cargo build --features qsv (Windows or Linux)
= []
# `nvidia`: NVENC AV1 encode + NVDEC decode via our own hand-rolled
# `nvEncodeAPI` / CUVID FFI (`encode/nvenc.rs`, `decode/nvdec.rs`). dlopens the
# NVIDIA runtime at load time — no build-time CUDA link, no bindgen, no header,
# so unlike the shiguredo crates it builds on **both Windows MSVC and Linux**.
# NVENC AV1 needs Ada+; NVDEC decodes H.264/HEVC/AV1/VP8/VP9/MPEG-2/MPEG-4 +
# 10-bit P016.
# cargo build --features nvidia (Windows or Linux)
= []
# `amd`: AMF AV1 encoder via our own hand-rolled AMF FFI (`encode/amf.rs`).
# dlopens amfrt64.dll / libamfrt64.so.1 — no build-time link, no bindgen, no
# header, so it builds on **both Windows MSVC and Linux**. AMD RDNA3+.
# cargo build --features amd (Windows or Linux)
= []
[]
= true
= true
= true
= true
= true
# mp4 crate is still needed by the container demuxer side; the codec
# crate no longer pulls any CPU codec deps as of 2026-05-08.
= true
# Audio codecs (Squad-24, Phase 2 audio expansion):
# - minimp3 (MIT) — MP3 decode wrapper around the minimp3 C library
# - lewton (MIT/Apache-2.0) — pure-Rust Vorbis decoder
# - audiopus (ISC) — high-level binding to libopus (BSD); for Opus encode
# - rubato (MIT) — sample-rate conversion for 44.1 → 48 kHz upsample
= "0.5"
= "0.10"
= "0.3.0-rc.0"
= "0.15"
# FFmpeg via ffmpeg-next (2026-04-19 migration):
# - ffmpeg-next (WTFPL-ish — see crate; binds to LGPL-2.1+ FFmpeg)
# brings the full libavcodec decoder catalogue + Vulkan hwaccel
# under one trait-dispatched Decoder. Per the 2026-04-19 user
# directive (memory feedback_ffmpeg_next_migration.md), this is
# the primary decode path; per-codec modules here (openh264 / rav1d
# / libde265 / libvpx / libmpeg2 / libxvidcore / prores / nvdec /
# vulkan_video) are retained as fallback and marked deprecated.
#
# Build requirements: FFmpeg dev libs (headers + .lib + .dll) must be
# on the system. On Windows, bootstrap via `vendor/ffmpeg/fetch.sh` +
# set FFMPEG_DIR. On Linux, install libav*-dev packages. On macOS,
# `brew install ffmpeg pkg-config`.
#
# Feature gate `static` OFF — dynamic linking keeps our source
# licensable separately from LGPL/GPL-licensed FFmpeg.
= { = "7.1", = true, = false, = ["codec", "format", "software-scaling", "software-resampling"] }
# Intel QSV is hand-rolled dlopen oneVPL FFI in-tree (encode/qsv.rs) — no
# external crate, builds on Windows + Linux. The shiguredo_vpl dep was retired
# (Windows MSVC); runtime still needs libvpl + the iHD VA-API driver on Linux.
# NVIDIA NVENC/NVDEC are hand-rolled dlopen FFI in-tree (encode/nvenc.rs,
# decode/nvdec.rs) — no external crate, builds on Windows + Linux. The
# shiguredo_nvcodec dep was retired (it doesn't compile on Windows MSVC).
# AMD AMF is hand-rolled dlopen FFI in-tree (encode/amf.rs) — no external crate,
# builds on Windows + Linux. The shiguredo_amf dep was retired (Windows MSVC).
# NVML (NVIDIA Management Library) wrapper. Used by the Phase 2
# (2026-05-07) richer worker_load surface to read per-GPU utilisation,
# encoder/decoder ASIC busy %, VRAM usage, and temperature on every
# 5 s load tick. NVML loads `libnvidia-ml.so` / `nvml.dll` lazily —
# init failure (no NVIDIA driver installed, hostless dev box) returns
# an Err that the caller folds to "all zeroes" without taking down
# the worker. Same dlopen-shaped runtime contract as the rest of the
# NVIDIA-tier code in this crate.
= { = true }
[]
= { = "../container", = "rivet-container" }
= { = true }
= { = true }
[[]]
= "colorspace"
= false
[[]]
= "colorspace_601_to_709"
= false
[[]]
= "scale"
= false
[[]]
= "bilinear"
= false
[[]]
= "nvdec_decode"
= false
[[]]
= "downsample_444_to_420"
= false
[]
# `streaming_api_landed` is the post-merge gate flag for the
# streaming-migration #55 QA decoder regression tests
# (`tests/streaming_decoder_equality.rs`). Tests are compile-
# excluded on this branch; flipped on at integration time via
# `RUSTFLAGS="--cfg streaming_api_landed"`. Registering the cfg
# here silences the rust 1.80+ `unexpected_cfgs` warning.
= { = "warn", = ['cfg(streaming_api_landed)'] }