Repository navigation
Releases
hwcodec 0.1.0
First public release.
Added
- AV1 and VP9 encoding behind one interface (
VideoEncoder): hardware encoders NVENC (Windows, Linux; AV1), VA-API (Linux; AV1, VP9), AMD AMF (Windows; AV1) and Quick Sync (Windows; AV1, VP9), software encoders SVT-AV1 and libvpx. - Software decoding of AV1 (dav1d) and VP9 (libvpx) behind
VideoDecoder. - Encoder settings: frame rates up to 120 fps, temporal layers, thread count and maximum frame size; unsupported settings are rejected when the encoder is opened.
- Detection with reasons:
detect_encodersreports for every encoder whether it works and, if not, why, together with device and driver version. - Self-test:
selftest::measure_av1checks that an encoder delivers a usable stream;DEFAULT_PASS_PERCENTis the default threshold. - Fallback:
default_order,open_best_encoder(custom order possible) andopen_software_decoder. - Build: bundled sources by default (Linux, macOS); prebuilt libraries through
LIBVPX_STATIC_DIR,SVTAV1_STATIC_DIR,DAV1D_STATIC_DIRandHWENC_SDK_DIR; system libraries throughHWCODEC_USE_SYSTEM_LIBS=1. On Windows (x86_64-pc-windows-msvc) the libraries are linked prebuilt: from crates.io they come inside the packagehwcodec-prebuilt-x86_64-pc-windows-msvc, without any download; a git checkout downloads the same files from the releasenative-libs-1of this repository and checks them against a SHA-256 fixed in the crate (HWCODEC_NO_DOWNLOAD=1forbids that download). - Colour conversion from BGRA to I420 (
convert::bgra_to_i420). - Colour conversion from I420 to RGBA:
I420Frame::to_rgba, andI420Frame::append_rgba, which writes the picture behind what a buffer already holds (for example a frame header) and so saves a picture-sized allocation and copy. The conversion handles two pixels per chroma sample and takes about a third less time than the per-pixel loop it replaces; the pixels are identical.examples/rgba_speed.rsmeasures it. - Cargo features
nvenc,amf,qsv,vaapi,svt-av1,libvpx,dav1d, all on by default. - Reduced builds: every subset of the cargo features builds, including none. A build without features has no build dependencies (no bindgen, no pkg-config) and needs no libclang, C compiler or native library on any target, which is what a phone build starts from.
TEMPORAL_LAYERS,AV1_TEMPORAL_LAYERS,Av1Options,vp9_threadsandav1_cpu_supportedexist in every build, independent of the features. Android and iOS are compile-checked without features, not tested. - Bundled vendor headers and codec sources; no FFmpeg.
- Examples and tests, including mocked-driver tests.
Known limits
- Tuned for live video (low latency) only; a quality preset is planned for 0.2.
- Decoding is software only; hardware decoding is planned for 0.2.
- macOS has software encoding and decoding only. AMF and Quick Sync exist on Windows only; on Linux, AMD and Intel graphics cards are used through VA-API.
- Tested on real hardware so far: VA-API AV1 encoding on an AMD Radeon RX 9070 XT (Linux, Mesa 26.2.5). Every other hardware path is untested; the README has the table and says how to report results.
- The prebuilt Windows libraries exist for
x86_64-pc-windows-msvconly. Other Windows targets and cross builds need the*_STATIC_DIRvariables.
Changed
- Extracted from the Mumcord
crates/screensharecrate and relicensed underMIT OR Apache-2.0. - Renamed
EncodertoVp9EncoderandDecodertoVp9Decoder.
Prebuilt codec libraries for Windows (1)
Prebuilt codec libraries that the hwcodec crate links on Windows.
This is not a version of hwcodec. Crate versions are the releases named vX.Y.Z.
Who needs this
Developers who build hwcodec on Windows (x86_64-pc-windows-msvc), and they do not have to do anything with it by hand:
- hwcodec from crates.io: the package
hwcodec-prebuilt-x86_64-pc-windows-msvccontains exactly the files of this archive. The release pipeline publishes that package only after comparing it byte for byte with this archive. Nothing is downloaded during the build. This release is the origin of those files and the place to verify them. - hwcodec from a git checkout: the binaries are not kept in git, so hwcodec's build script downloads this archive, checks it against the SHA-256 below (which is fixed in its
build.rs) and links the libraries.
Nobody needs it on Linux or macOS, where the libraries are built from the sources bundled in the crate. The README section "Building on Windows" has the details, including how to forbid the download and use your own libraries.
Contents
hwcodec-native-libs-1-x86_64-pc-windows-msvc.tar.gz: static libraries for x86_64-pc-windows-msvc, built for the dynamic C runtime (/MD), with their headers.
| Folder | Library | Version | Licence |
|---|---|---|---|
libvpx_static |
libvpx | 1.15.2 | BSD-3-Clause, with the patent grant in PATENTS |
svtav1_static |
SVT-AV1 (encoder) | 4.2.0 | BSD-3-Clause-Clear and BSD-2-Clause, with the Alliance for Open Media patent licence in PATENTS.md |
dav1d_static |
dav1d | 1.5.4 | BSD-2-Clause |
hwenc_sdk |
oneVPL dispatcher (libvpl) | 2.17.0 | MIT |
The full licence texts are in the archive under LICENSES/.
How it was built
By the workflow "Windows codec libraries" (.github/workflows/native-libs.yml, script .github/scripts/build-windows-libs.sh) of this repository at commit e16cd4f, from the unmodified sources bundled under sys/, on a GitHub-hosted Windows runner with Visual Studio (MSVC, x64). Run: https://github.com/Mumcord/hwcodec/actions/runs/43601399500
Checksum
SHA-256 of hwcodec-native-libs-1-x86_64-pc-windows-msvc.tar.gz:
adae2a3116c69d05631cc763533f9bbb50ad6ca8e9c75f23cd64e401a941f26d
To verify the package from crates.io: download this archive, check its SHA-256, unpack it and compare it with the prebuilt/ folder of hwcodec-prebuilt-x86_64-pc-windows-msvc.
The files of this release must never be changed or deleted: published versions of hwcodec point at exactly this archive.