rff-codec-webp
The WebP codec adapter for remade_ffmpeg_rs, backed by our own
pure-Rust rusty_webp (a
performance/feature fork of image-rs/image-webp 0.2.4).
- Decode VP8 (lossy), VP8L (lossless), and animated WebP (all frames, millisecond pts). Still lossy images without alpha decode straight to their native YUV 4:2:0 planes — video pipelines skip the RGB round-trip, and the output is bit-exact with FFmpeg's webp decoder.
- Encode lossless (VP8L) with LZ77 backward references, color cache, and per-tile predictor selection.
- MIT/Apache-2.0 backing crate; WebP is royalty-free.
Measured vs FFmpeg 8.1.2 (pinned CPU time, ABBA-interleaved, real-content corpus, decoded output verified bit-exact): lossy decode 1.24–1.29× faster, lossless decode ~2.15× faster, lossless encode 1.6–2.8× faster than libwebp's default effort at +4–13% size on photos (and up to 39% smaller on screen content). FFmpeg's native decoder errors on animated WebP; this crate decodes every frame. Lossy encoding is not implemented yet.
Usage
use CodecRegistry;
use ;
Part of Remade With Rust
This crate is one layer of
remade_ffmpeg_rs — a
ground-up, permissively-licensed Rust rebuild of FFmpeg: a drop-in
ffmpeg/ffprobe CLI on pure-Rust codecs, with no copyleft. Most users want
the remade-ffmpeg engine facade or the
rff-cli binaries rather than this crate
directly.
Also check out our sister project
FFAI — media for an AI-first
world — and the rest of
github.com/remade-with-rust, including
the standalone codec crates
rusty_h264,
rusty_vp9,
rusty_mp3,
rusty_aac,
rusty-opus,
rusty_vorbis, and the
rusty-av1-toolkit forks.
About Mata Network
Mata Network builds sovereign, self-hostable infrastructure. Remade With Rust is our open-source home for the permissively-licensed building blocks that work depends on.
License
Apache-2.0. See the workspace LICENSE.