#ffi #codec #image #avif #av1

sys libavif-sys

Unsafe wrapper around libavif, the image codec

10 releases (breaking)

new 0.11.0 Oct 25, 2021
0.10.0 May 4, 2021
0.8.0 Sep 28, 2020
0.6.0 Jul 28, 2020
0.4.2 Mar 17, 2020

#80 in Images

Download history 16/week @ 2021-07-04 15/week @ 2021-07-11 15/week @ 2021-07-18 21/week @ 2021-07-25 31/week @ 2021-08-01 19/week @ 2021-08-08 28/week @ 2021-08-15 25/week @ 2021-08-22 16/week @ 2021-08-29 15/week @ 2021-09-05 19/week @ 2021-09-12 52/week @ 2021-09-19 22/week @ 2021-09-26 12/week @ 2021-10-03 19/week @ 2021-10-10 7/week @ 2021-10-17

97 downloads per month
Used in 4 crates (2 directly)

BSD-2-Clause

6.5MB
133K SLoC

C 85K SLoC // 0.1% comments Assembly 16K SLoC // 0.0% comments C++ 16K SLoC // 0.1% comments GNU Style Assembly 12K SLoC // 0.1% comments Rust 2K SLoC // 0.0% comments Python 1K SLoC // 0.5% comments Perl 579 SLoC // 0.1% comments Shell 311 SLoC // 0.2% comments CoffeeScript 141 SLoC // 0.2% comments JavaScript 7 SLoC

libavif-sys

crates.io Documentation BSD-2-Clause licensed Rustc Version 1.44+ CI

AVIF is an image codec based on the next-generation open, royalty-free video coding format AV1.

AVIF gets compression ratios considerably better than JPEG for similar quality levels.

This crate wraps the Alliance for Open Media's libavif into an unsafe rust crate.

Minimal safe wrappers are provided by libavif and a image-compatible libavif-image.

Codec Features

This crate, by default, uses codec-dav1d for decoding and codec-rav1e for encoding, because they have the best (speed) performance. You can disable those features and instead use codec-aom.

Compiling

  • cmake is required for compiling the crate.
  • dav1d requires ninja/meson and nasm
  • rav1e is implemented in Rust and has no other dependencies (though note that libavif itself uses it via rav1e's C-API).

Platform support

This crate is tested on Linux, MacOS, and Windows.

License

This crate is released under the BSD-2-Clause license. The dependant C-libraries are released under similarly permissive licenses. Patent licenses are also provided.

Dependencies