Learn/pure Rust alternativeMediarusty_mp3

Pure Rust Alternative for minimp3

rusty_mp3 is the Rust alternative to minimp3 and the C MP3 encoder path. It decodes and encodes inside remade_ffmpeg_rs with no C library on the hot path.

Signed by Tim Almond·
Painted stack of plain dark discs at dusk, the top disc ringed in warm light beside a small brass horn
What is the pure Rust alternative for minimp3?

rusty_mp3 is the pure Rust alternative for minimp3. It decodes MPEG Layer III and encodes CBR and VBR MP3 inside remade_ffmpeg_rs, with no C library on the hot path.

Related reading

Builder field note

remade_ffmpeg_rs: FFmpeg-Class Media Pipeline in Pure Rust

APIs, composition, and MATA placement for remade_ffmpeg_rs: FFmpeg-Class Media Pipeline in Pure Rust live on the field note.

A pure Rust alternative for minimp3 is the decoder question. minimp3 is the small C decoder teams paste into games, browsers, and firmware. The encoder question beside it is LAME, or FFmpeg's MP3 encoder, which is the same family of native code. rusty_mp3 answers both. It is a complete MPEG-1, MPEG-2, and MPEG-2.5 Layer III decoder and encoder in Rust, with no C and no runtime dependencies.

Calling it a pure Rust alternative for minimp3 twice in the lede is deliberate: pure Rust alternative for minimp3 is the query, and rusty_mp3 is the crate. The crate lives in remade_ffmpeg_rs at crates/rusty_mp3, version 1.0.2 in that tree, and on crates.io as rusty_mp3. A pure Rust alternative for minimp3 means those C sources are not on the link line. The toolkit around the crate is the pure Rust alternative for FFmpeg.

The Rust alternative to the C MP3 path

MP3's patents expired in 2017, so the format is not a license puzzle anymore. The remaining puzzle is the memory-unsafe code that still parses the frames.

What minimp3 and LAME still are

minimp3 is a decoder. LAME is an encoder. Products often ship one of each, plus FFmpeg when they need a third opinion. A wrapper that calls either library has not left C. A pure Rust alternative for minimp3 is rusty_mp3 on the decode path, and the same crate when the product writes a file. The builder map for the engine is remade_ffmpeg_rs. Neighboring audio is the libvorbis alternative and the field note for rusty_opus.

What the crate says it does

The README is the measurement, and this page does not replace it. The decoder passes all 16 ISO Layer III conformance vectors and matches FFmpeg bit for bit on a 678-stream corpus. Encoding covers constant and variable bitrate, mono, stereo, and joint stereo, a psychoacoustic model, and the bit reservoir. On one x86-64 core the README describes decode and encode as many times faster than real time, with decode ahead of FFmpeg. Explicit SIMD is the only unsafe code, each kernel paired with a scalar twin that produces the same samples. The crate is fuzzed. Those sentences are the crate's claims. Pin the version and read them next to the lockfile.

The worker in front of the file

A pure Rust alternative for minimp3 does not fix PHP. It removes one reason to keep a C parser in the same process as an upload.

What the 21 October bug reaches

PHP2Shell lives in the PHP interpreter: CVE-2026-109618 and CVE-2026-109619. A failed or fatal request can leave memory for the next request on the same worker. rusty_mp3 does not patch those releases. Patched PHP is 8.5.12, 8.4.27, 8.3.36, and 8.2.35, for people who still run PHP. A house service does not. That statement is the pure Rust alternative for PHP. mata.network is the cloud on the Rust side of the line.

The frame that sizes a buffer

The cousin that belongs to MP3 is allocation from untrusted input, the same shape as the PHP out-of-memory bug. A frame header is allowed to describe a size. The decoder's job is to refuse a size it will not honor and return an error. A failed allocation stays a failed allocation. AI tools that transcribe or separate a song hit the same shape when the clip length sizes the buffer. NIST SSDF is the document that lets a buyer ask for the memory-safe path by name. The importance of Remade with Rust is the house version of that ask.

Where a builder goes next

Depend on the toolkit if you already demux with remade_ffmpeg_rs. Depend on rusty_mp3 if the product is only MP3. Keep minimp3 and LAME off the build.

Notes already on Learn

Start at remade_ffmpeg_rs and the FFmpeg alternative. Vorbis has its own search page, the libvorbis alternative, plus the 0.1.2 decode note. The band is Media on Vision.

How to adopt the crate

Confirm the symbol that decodes the frame is rusty_mp3. Scan the graph with Deputy. Place the service toward mata.network when it should stay yours. A pure Rust alternative for minimp3 is real when the C decoder and the C encoder are no longer the code that touches the file.

The search pure Rust alternative for minimp3 often arrives from a README that still vendors a single C file. Replacing that file with rusty_mp3 is the whole adoption. Keep the ISO vectors and the 678-stream claim attached to the version you pinned, because those numbers belong to the crate README and move when the corpus moves. A pure Rust alternative for minimp3 also covers the encoder, so a project that linked LAME for the write path can leave both C libraries behind in one dependency. If the upload form in front of that dependency is still PHP, fix the form on the PHP alternative and keep this page for the frames. The same pattern is how the Vorbis and AAC pages are written: name the old library, name the house crate, then name the worker bug that is not this crate's bug. +++

FAQ

Quick answers for builders evaluating this technology.

Does rusty_mp3 replace LAME as well as minimp3?

minimp3 is the decoder people embed. LAME is the encoder they mean. rusty_mp3 covers both directions in one Rust crate. The speed and conformance lines below are the crate's own, against FFmpeg and the ISO vectors.

Where does the crate live?

Inside remade_ffmpeg_rs, at crates/rusty_mp3, version 1.0.2 in that tree. It is also published as rusty_mp3. There is no separate house repository just for MP3.

What conformance does the README claim?

The decoder passes the 16 ISO Layer III vectors and matches FFmpeg bit for bit on a 678-stream corpus. Encoding covers CBR, VBR, joint stereo, and a bit reservoir. This page does not add a new timing run.

How does an MP3 file meet the PHP bug?

rusty_mp3 does not patch PHP2Shell. A download handler that still runs PHP inherits the interpreter. The allocation cousin on this page is a packet that tries to size a buffer the decoder should refuse.

Where should a builder read the pure Rust alternative for minimp3?

Read the FFmpeg alternative for the toolkit, the Vorbis alternative for the neighboring audio crate, and the PHP alternative for the interpreter the house does not ship.