What Happens When You Click Convert: MP4 to MP3, Explained (Beginner-Friendly)

2026-08-20

You click one button, wait a few seconds, and a hundreds-of-MB mp4 video turns into a few-MB mp3 audio file.

Ever wonder what actually happens behind that click? Does the page really do "magic" inside your browser?

Today we break the whole process down in the most down-to-earth way possible, and throw in a few real pitfalls we hit while building the tools.beer converter.

1. The short answer

When you click "Convert", the page runs, inside your own browser (tools.beer's web app uses FFmpeg.wasm, the browser build of ffmpeg), and does this: it opens the mp4 "parcel", pulls out the audio track, and re-folds it into the small "music box" that is an mp3. The whole time, the file never leaves your computer.

2. A plain-life analogy: unbox the parcel, keep the audio

Think of an mp4 file as a shipping parcel (the container), taped shut with two things inside:

  • a pack of pictures (the video stream)
  • a pack of sound (the audio stream, usually already folded tightly with a method called AAC)

"mp4 to mp3" is simply this:

  1. Open the parcel (demux) — cut the tape and see the two packs;
  2. Take only the sound pack (extract the audio) — leave the picture pack behind;
  3. Unfold and re-fold that pack (decode + re-encode) — you don't want AAC's fold, so you re-fold it the MP3 way;
  4. Put it into a music-only box (mux into mp3).

In one line: open box -> grab sound -> re-fold -> new box. The picture is discarded; you keep only the sound.

3. The step-by-step pipeline

Pick mp4your fileDemuxtake audioDecode AACdecodeEncode MP3encodeMux mp3muxDownload/ previewBlue = container (open/box) Red = codec (unfold/fold) Video stream is dropped after demuxDecode -> encode is the heaviest CPU part, run off the main thread so the page stays responsive

This diagram maps exactly onto the pipeline from How FFmpeg works: except this time you deliberately drop the video and keep only the audio, in a different codec.

4. Why the output is mp3 (or m4a), not something else

Our converter supports both common choices:

  • mp3: the most compatible option — any device, any player. Most people converting mp4 to mp3 want exactly this "opens everywhere" result.
  • m4a: if you don't want to change the quality (the original audio is already lossy AAC), you can just "swap the box" — put AAC into the M4A container, with almost no size change.

The real pitfall we hit (important): AAC cannot be saved as a raw .aac file. A raw AAC stream carries no duration metadata, and when the source sample rate is non-standard, a player misreads the sample-rate index and plays it at half speed with double length (this is a documented FFmpeg issue, ticket trac #5448). So we always mux AAC into an M4A container, killing the problem at the root. We covered this specifically in Container vs codec.

One more honest note: the audio inside a video is already lossy AAC, and re-encoding it to lossy MP3 means "lossy to lossy", with a tiny bit of generation loss. For casual listening or podcast素材 it is inaudible; but if you are an audiophile wanting "lossless archiving", this path was never the right one — see Lossless vs lossy.

5. This is really a recap of the whole series

If you have read the earlier pieces, this one conversion ties them all together:

  • Demux -> decode -> encode -> mux is the pipeline from the FFmpeg how-it-works article;
  • having to re-encode (to MP3) is the "re-encode" case from Re-encode vs stream copy — because the target codec differs from the source, the decode -> encode stages cannot be skipped, so this step is relatively slow;
  • the result is lossy mp3, matching the Lossless vs lossy article;
  • it all runs in the browser via the WebAssembly engine from FFmpeg.wasm.

One practical walkthrough, and the whole series's theory gets reviewed.

6. Web vs desktop: how we choose

tools.beer ships two paths, each for its own job:

  • Web (FFmpeg.wasm): no install, works instantly, file never leaves your device, great for small files on the go. The cost: browser memory limits and no hardware acceleration, so large files are slow or won't fit.
  • Desktop (Tauri calling native ffmpeg): local, private, handles huge files, and uses multi-core and hardware acceleration. For example, our "video to mp4" on desktop uses a real libx264 re-encode, fast and stable.

Want to try it now? You can turn an MP4 into an MP3 right in your browser.

Summary

  • One "Convert" click = demux (open box) -> take audio -> decode AAC -> encode MP3 -> mux mp3 -> download; the video stream is discarded;
  • Output mp3 (most compatible) or m4a (AAC in a new container); AAC must go in an M4A container or it may play at half speed;
  • This is a re-encode (codec change), not a stream copy, so it is relatively slow;
  • The conversion runs locally in your browser — nothing is uploaded;
  • For huge files or speed, use the desktop native ffmpeg.

Further reading

Want to try it now? Convert an MP4 to MP3 in your browser.

References (authoritative sources)

FFmpeg official site
FFmpeg trac #5448: raw AAC sample-rate misread causes half-speed playback
FFmpeg.wasm official docs
Wikipedia: container format / audio codec

Written by the tools.beer team, based on real pitfalls we hit building the browser-side FFmpeg.wasm and desktop-side native ffmpeg converters. Last updated 2026-08-20.