Skip to content

Releases

hwcodec 0.1.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 00:28
56e44ea

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_encoders reports for every encoder whether it works and, if not, why, together with device and driver version.
  • Self-test: selftest::measure_av1 checks that an encoder delivers a usable stream; DEFAULT_PASS_PERCENT is the default threshold.
  • Fallback: default_order, open_best_encoder (custom order possible) and open_software_decoder.
  • Build: bundled sources by default (Linux, macOS); prebuilt libraries through LIBVPX_STATIC_DIR, SVTAV1_STATIC_DIR, DAV1D_STATIC_DIR and HWENC_SDK_DIR; system libraries through HWCODEC_USE_SYSTEM_LIBS=1. On Windows (x86_64-pc-windows-msvc) the libraries are linked prebuilt: from crates.io they come inside the package hwcodec-prebuilt-x86_64-pc-windows-msvc, without any download; a git checkout downloads the same files from the release native-libs-1 of this repository and checks them against a SHA-256 fixed in the crate (HWCODEC_NO_DOWNLOAD=1 forbids that download).
  • Colour conversion from BGRA to I420 (convert::bgra_to_i420).
  • Colour conversion from I420 to RGBA: I420Frame::to_rgba, and I420Frame::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.rs measures 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_threads and av1_cpu_supported exist 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-msvc only. Other Windows targets and cross builds need the *_STATIC_DIR variables.

Changed

  • Extracted from the Mumcord crates/screenshare crate and relicensed under MIT OR Apache-2.0.
  • Renamed Encoder to Vp9Encoder and Decoder to Vp9Decoder.

Prebuilt codec libraries for Windows (1)

Choose a tag to compare

@github-actions github-actions released this 14 Nov 13:51

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-msvc contains 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.