rff-codec-mp3
The MP3 codec for remade_ffmpeg_rs.
It registers mp3 for decoding and encoding in the engine's codec registry,
backed by the pure-Rust rusty_mp3 codec.
No C, no FFI, and no unsafe code in this crate.
- Decoding of MPEG-1, MPEG-2 and MPEG-2.5 Layer III. It passes all 16 ISO conformance vectors and matches FFmpeg bit for bit on a 678-stream corpus.
- Encoding at CBR or VBR, mono, stereo or joint stereo, configured with the
usual FFmpeg options:
-b:a 192kfor a bitrate,-q:a 0–9for VBR quality. - Input formats: interleaved
s16andf32frames are encoded directly, without intermediate copies. Decoded frames are interleavedf32.
Most applications use this crate through the
remade-ffmpeg engine or the rff
command-line tools rather than directly.
Usage
use CodecRegistry;
use ;
The decoder and encoder implement the engine's Decoder and Encoder traits,
including FFmpeg's Again / Eof drain protocol.
Robustness
- Packet bytes are treated as hostile; frame sync, parsing and decoding are done
by
rusty_mp3, whose decoder is fuzzed and conformance-tested. - A frame's sample count is checked against its buffer: a frame that claims more samples than it carries is clamped to what it holds, and a frame with no sample buffer is rejected.
- This crate is
#![forbid(unsafe_code)], has its own fuzz targets, and is covered by the same hardening audit as the codec (threat model, audit). - Report vulnerabilities privately; see
SECURITY.md.
Compatibility
Version 1.x of this crate depends on rusty_mp3 1.x. Its public API is the
register function plus the re-export of rusty_mp3.
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. See also
FFAI, media for an AI-first world.
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.
Hardening status
Tier critical-path · Audited 2026-10-04 (deep) · v1.0.0 gates 13/15 · Full checklist
██████████████████░░ 91% · 30 Completed · 0 Scheduled · 3 Incomplete · 22 N/A
| Phase | ✅ Completed | 🗓 Scheduled | ⬜ Incomplete | · N/A |
|---|---|---|---|---|
| 0 — Threat modeling | 2 | 0 | 0 | 0 |
| 1 — Toolchain | 3 | 0 | 1 | 0 |
| 2 — Supply chain | 8 | 0 | 0 | 0 |
| 3 — Code level | 6 | 0 | 0 | 1 |
| 4 — Static analysis | 1 | 0 | 0 | 0 |
| 5 — Dynamic analysis | 3 | 0 | 0 | 0 |
| 6 — Fuzzing and properties | 3 | 0 | 1 | 0 |
| 7 — Formal verification | 0 | 0 | 0 | 1 |
| 8 — Build and binary | 0 | 0 | 0 | 2 |
| 9 — Runtime privilege | 0 | 0 | 0 | 1 |
| 10 — Cryptography | 0 | 0 | 0 | 3 |
| 11 — CI/CD, release, and operations | 4 | 0 | 1 | 0 |
| 12 — Compliance controls | 0 | 0 | 0 | 14 |
| Total | 30 | 0 | 3 | 22 |
Architect — Tim Almond — accountable for this unit's security design; rendered