Extract Audio from MP4 to WEBA — Free Online Tool

Extract audio from an MP4 video and save it as a WEBA file using the Opus codec — a modern, efficient audio format purpose-built for the web. Opus delivers excellent sound quality at low bitrates, making WEBA files significantly smaller than MP3 or AAC while maintaining clarity, ideal for web audio players and WebRTC applications.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

This conversion strips the video stream entirely from the MP4 container and re-encodes the audio into the WEBA format. MP4 files typically carry AAC-encoded audio, which is not natively compatible with the WebM container family that WEBA belongs to. As a result, the audio must be transcoded — decoded from AAC and re-encoded using the Opus codec (libopus). Opus is a highly efficient lossy codec standardized by the IETF, and the WEBA container is essentially an audio-only WebM file. The output is a streamable, web-native audio file with no video data, resulting in a much smaller file than the original MP4.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg program. This is the open-source multimedia framework powering the conversion — the same engine running in your browser via FFmpeg.wasm (WebAssembly).
-i input.mp4 Specifies the input file — your MP4 video, which typically contains an H.264 video stream and an AAC audio stream in an MPEG-4 container.
-vn Disables video output, instructing FFmpeg to ignore the video stream entirely. This is required because WEBA is an audio-only format and the WebM container in this context should carry no video track.
-c:a libopus Sets the audio codec to libopus, which re-encodes the MP4's AAC audio into the Opus format. Opus is the required codec for WEBA and offers superior compression efficiency compared to the source AAC, especially at bitrates below 160k.
-b:a 128k Sets the target audio bitrate to 128 kilobits per second. At this bitrate, Opus produces audio quality that is generally considered transparent for most content types, and the resulting WEBA file will be significantly smaller than the original MP4.
-vn A second instance of the video-disable flag, which is redundant but harmless — it reaffirms that no video stream should be written to the output. You can safely remove this duplicate if running the command manually.
output.weba The output filename with the .weba extension. FFmpeg uses this extension to determine the output container, writing an audio-only WebM file encoded with Opus that is ready for use in web browsers and HTML5 audio players.

Common Use Cases

  • Extract a podcast interview or lecture recorded as an MP4 screen capture and publish it as a lightweight web audio file compatible with modern browsers without plugins
  • Pull the audio track from an MP4 music video to create a WEBA file for embedding on a web page using the HTML5 <audio> element with native browser support
  • Convert MP4 voiceover recordings to WEBA for use in a WebRTC-based communication app, where Opus is the native and preferred codec for low-latency audio
  • Reduce bandwidth consumption on a media-heavy website by serving audio content as WEBA files instead of full MP4 videos or larger MP3 files
  • Extract audio from MP4 gameplay recordings or tutorials and serve them as WEBA files in a browser-based audio player with streaming support
  • Prepare audio assets from MP4 source files for use in a Progressive Web App (PWA) where WebM/WEBA format is preferred for its open, royalty-free nature

Frequently Asked Questions

Because this conversion transcodes from AAC to Opus, there is a generation of lossy re-encoding, which in theory introduces some quality loss. However, Opus is widely considered to outperform AAC at equivalent or even lower bitrates, particularly below 128k. At the default 128k bitrate used by this tool, most listeners will find the Opus output indistinguishable from the source AAC audio. If your original MP4 had very high-quality audio, you can increase the bitrate to 192k or 256k to preserve more fidelity.
WEBA files using the Opus codec are natively supported in Chrome, Firefox, Edge, and Opera. Safari added WebM/Opus support in Safari 15 (released 2021), so modern Safari on macOS and iOS also handles WEBA. If you need broad compatibility including older Safari versions, consider converting to an MP3 or AAC-based format instead. For web projects, pairing a WEBA source with an MP3 fallback in an HTML5 audio element is a common production pattern.
The WEBA container format, as an audio-only WebM variant, does not support chapters, multiple audio tracks, or subtitle tracks — features that MP4 can carry. This tool extracts a single audio stream and discards all other tracks and metadata structures during the conversion. If your MP4 has multiple audio tracks (e.g., different languages), only the default audio track will be included in the WEBA output. For multi-track audio preservation, you would need a container like MKV or a separate extraction step for each track.
The bitrate is controlled by the '-b:a 128k' flag in the command. To reduce file size, lower the value — for example, '-b:a 64k' or '-b:a 96k' works well for speech content because Opus is highly efficient at low bitrates. For music or high-fidelity audio, increase it to '-b:a 192k' or '-b:a 256k'. Unlike MP3, Opus at 96k already delivers quality comparable to MP3 at 128k, so you can often use a lower bitrate without a perceptible difference.
Yes. On Linux or macOS, you can run the following shell one-liner to process an entire folder: 'for f in *.mp4; do ffmpeg -i "$f" -vn -c:a libopus -b:a 128k -vn "${f%.mp4}.weba"; done'. On Windows PowerShell, use: 'Get-ChildItem *.mp4 | ForEach-Object { ffmpeg -i $_.FullName -vn -c:a libopus -b:a 128k -vn ($_.BaseName + ".weba") }'. This is especially useful for files over 1GB, which exceed the browser tool's processing limit.
This is a quirk of how the FFmpeg command was constructed for this tool. The first '-vn' flag, placed before the output filename, tells FFmpeg to exclude the video stream from the output — which is essential since WEBA is an audio-only container. The second '-vn' is redundant in this case because the same instruction has already been given. It causes no errors and does not affect the output, but if you are editing the command manually you can safely remove the duplicate.

Technical Notes

WEBA is not an independently registered MIME type in the traditional sense — it is an audio-only WebM file (.weba) served with the 'audio/webm' MIME type, and browsers treat it as part of the WebM family. The Opus codec inside is defined by RFC 6716 and is royalty-free, which is a key advantage over AAC (used in MP4), which requires licensing. When transcoding from MP4's default AAC audio to Opus, metadata such as title, artist, and album tags from the MP4 are generally not preserved in the WEBA output, as WebM has limited metadata support compared to MP4's extensive iTunes-style atom structure. The '-vn' flag is critical here because without it, FFmpeg would attempt to include the video stream and fail, since WebM does support video (VP8/VP9) but WEBA specifically refers to the audio-only variant. File sizes for WEBA at 128k Opus are typically 20-40% smaller than equivalent MP3 files and comparable to or smaller than AAC at the same bitrate, making WEBA an efficient choice for web delivery where Opus-compatible browsers are the target audience.

Related Tools