# Video to MP3

Extract the audio from a video as MP3, WAV or OGG, in the browser. Nothing is uploaded.

Runs entirely in the browser through WebCodecs and WebAssembly. No upload, no account, no size limit
imposed by a plan, no watermark — because there is no server involved.

Page: https://life2film.com/tools/video-to-mp3/

## What matters

- MP3 uses LAME compiled to WebAssembly, loaded only when MP3 is chosen.
- WAV size is sampleRate x 2 bytes x channels, there is no bitrate to pick.
- Vorbis lands about 30% under its nominal bitrate, being variable-rate.
- Size predictions read the real channel count and sample rate from the file; assuming stereo doubles the estimate for a mono source.
- A bitrate higher than the source was recorded at enlarges the file without improving it.

## From code

```js
// npm i mediabunny @mediabunny/mp3-encoder
import { Input, Output, Conversion, BlobSource, BufferTarget, Mp3OutputFormat, ALL_FORMATS } from 'mediabunny';
import { registerMp3Encoder } from '@mediabunny/mp3-encoder';

registerMp3Encoder();   // LAME compiled to WASM; only needed for MP3 output

export async function extractAudio(file, { bitrate = 192_000, mono = false } = {}) {
  const input = new Input({ source: new BlobSource(file), formats: ALL_FORMATS });
  const output = new Output({ format: new Mp3OutputFormat(), target: new BufferTarget() });

  const conversion = await Conversion.init({
    input,
    output,
    video: { discard: true },                      // leave the picture behind
    audio: { bitrate, ...(mono ? { numberOfChannels: 1 } : {}) },
  });

  if (!conversion.isValid) throw new Error('No audio track, or it cannot be decoded');
  await conversion.execute();

  return new Blob([output.target.buffer], { type: 'audio/mpeg' });
}

const mp3 = await extractAudio(file, { bitrate: 192_000 });
```

## Questions

**Is my video uploaded?**

No. The browser decodes the file and encodes the audio locally, so nothing is sent anywhere. That matters more here than for most conversions: the reason to pull audio out of a video is often that the video is personal (a lecture, an interview, a recording of your own) and it has no business on someone else's server to answer a question your laptop can answer.

**Which format should I choose?**

MP3 if it is going anywhere at all, every device and app plays it, and at 192 kbps it is transparent for speech and close to it for music. WAV if the audio is going into an editor or a transcription tool, since it is uncompressed and loses nothing. OGG (Vorbis) is smaller than MP3 at the same quality but less widely supported outside browsers and Android.

**What bitrate do I need?**

For speech, 96–128 kbps is plenty and halves the file against the default. For music, 192 kbps is the usual sweet spot and 320 is the most MP3 offers. Higher than the source was recorded at gains nothing: converting a 128 kbps podcast to 320 kbps produces a file two and a half times larger that sounds identical.

**Why is my WAV file so large?**

Because it is uncompressed, roughly 10 MB per minute in stereo at 44.1 kHz, regardless of what it contains. That is the point of it: nothing is thrown away. If the size is a problem and the audio is not going into an editor, MP3 is a twentieth of the size and you will not hear the difference.

**Can I convert just part of the video?**

Not on this page, it converts the whole file. Trim the video first with the trimmer, then convert what comes out, or convert everything and cut the audio in whatever you are taking it into.

**Which files work?**

Anything your browser can open: MP4, MOV and WebM video, and most audio files if you are converting between audio formats. Camera-native formats like ProRes, and DRM-protected files, cannot be read by a browser at all.

## Related

- [Trim Video](https://life2film.com/tools/video-trimmer/): Drag the handles to the part you want, preview it, save it. Audio stays in sync.
- [Compress Video](https://life2film.com/tools/video-compressor/): Make a file smaller and see exactly what it cost. No size limit, because there is no server.
- [Convert Video](https://life2film.com/tools/video-converter/): MP4, WebM and MOV in any direction, or pull the audio out as WAV.
- [Video Splitter](https://life2film.com/tools/video-splitter/): Cut a long video into Reels or Shorts that start on a shot change instead of every 30 seconds, ranked by picture quality.
- [BPM Detector](https://life2film.com/tools/bpm-detector/): Find a track’s tempo and the time of every beat, then send the grid to Resolve, Premiere, Final Cut or Audacity as markers.
- [Scene Detector](https://life2film.com/tools/scene-detector/): Find every cut in a video and get the shot list with thumbnails, timecodes and quality scores.

- The engine as a package: https://life2film.com/engine/
- Site overview for agents: https://life2film.com/llms.txt
- Every tool page is available as markdown by appending `.md` to its address, or by requesting it
  with `Accept: text/markdown`.

---
Life2Film — on-device video montage. https://life2film.com/
