Extract Audio from MPEG to WEBA — Free Online Tool
Extract audio from MPEG video files and convert it to WEBA format, encoding the audio stream with the Opus codec for efficient, high-quality web playback. This is ideal for pulling audio from legacy MPEG-1/MPEG-2 broadcasts or DVD-compatible video and delivering it as a modern, bandwidth-efficient WebM audio file.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MPEG file here
or click to browse
Free — no uploads, no signups. Your files never leave your browser.
Settings
Note: Browser-based encoding uses approximate quality targets. For precise CRF compression, copy the FFmpeg command above and run it on your desktop.
Estimated output:
Conversion Complete!
DownloadHow It Works
MPEG files typically carry MP2 (MPEG Audio Layer II) audio — a legacy codec common in broadcast television and DVD video that is not natively supported by modern web browsers. During this conversion, FFmpeg discards the video stream entirely and re-encodes only the audio: the MP2 audio is decoded and then re-encoded using the Opus codec (libopus) at 128k bitrate, wrapped in a WEBA container (the audio-only variant of the WebM format). Opus is a modern, royalty-free codec standardized by the IETF that delivers significantly better audio quality per bit than MP2, making the output smaller and better suited for web streaming while maintaining perceptually transparent quality at typical bitrates.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary, the open-source multimedia processing engine that handles demuxing the MPEG container, decoding the MP2 audio, and encoding the output as Opus in a WEBA container. |
-i input.mpeg
|
Specifies the input MPEG file. FFmpeg will demux the MPEG program or transport stream, making the contained video (MPEG-1 or MPEG-2) and audio (typically MP2) streams available for processing. |
-vn
|
Disables video output, ensuring no video stream is passed to the output file. This is essential here because WEBA is an audio-only container and cannot hold a video stream; this flag discards the MPEG-1/MPEG-2 video data entirely. |
-c:a libopus
|
Selects the libopus encoder for the audio stream, re-encoding the decoded MP2 audio into the Opus format. Opus is the default and only recommended codec for WEBA files, offering far better compression efficiency than the MP2 audio sourced from the MPEG input. |
-b:a 128k
|
Sets the Opus audio output bitrate to 128 kilobits per second. At this bitrate, Opus delivers perceptually transparent quality for most stereo content — notably better than MP2 at the same or even higher bitrates, making this a high-quality yet compact output. |
-vn
|
A second instance of the video-disable flag, included as a WEBA container-level special flag to unconditionally suppress any video stream in the output. While redundant with the earlier '-vn', it guarantees a valid audio-only WEBA file regardless of how FFmpeg interprets the input stream mapping. |
output.weba
|
The output filename with the .weba extension, which signals FFmpeg to use the WebM muxer in audio-only mode. The resulting file is a valid WEBA container holding a single Opus-encoded audio stream, ready for use in web audio players or <audio> HTML elements. |
Common Use Cases
- Extract speech or commentary from archived MPEG broadcast recordings for use in a podcast or audio documentary
- Pull the audio track from a legacy MPEG-1 or MPEG-2 video to embed as a <audio> element in a web page, where WEBA/Opus is natively supported in Chrome and Firefox
- Convert MP2-encoded audio from DVD-compatible MPEG files into the more efficient Opus format to reduce storage size for a media archive
- Extract a music track from an old MPEG video file captured from a broadcast or satellite source for personal listening or analysis
- Prepare audio from MPEG training or educational videos for use in a WebRTC-based e-learning platform that natively handles Opus streams
- Strip and re-encode audio from MPEG video captures for use in a Progressive Web App (PWA) that targets Opus-capable browsers
Frequently Asked Questions
Yes, some quality loss is technically possible since both MP2 and Opus are lossy codecs and the audio is being decoded from MP2 then re-encoded to Opus — a generation-loss scenario. However, in practice at 128k bitrate, Opus is substantially more efficient than MP2 and can produce perceptually comparable or even better-sounding output than the original MP2 track (which is often encoded at 192k or lower in broadcast MPEG files). For archival purposes where perfect fidelity matters, consider increasing the output bitrate to 192k or 256k.
The WEBA (WebM audio) container only supports Opus and Vorbis codecs — it does not accept MP2 streams. Stream copying would require a container that natively supports MP2, such as MKA or MP3. Since the goal is a valid WEBA file for web use, re-encoding to Opus is mandatory, not optional.
WEBA/Opus has excellent support in Chromium-based browsers (Chrome, Edge, Opera) and Firefox across desktop and Android. Safari added Opus support in version 16 (2022), so modern Safari on macOS and iOS should handle it. For maximum compatibility across all devices including older Safari versions, consider outputting MP3 or AAC instead. WEBA is the best choice when targeting a known-modern browser environment.
Replace the '-b:a 128k' value with your desired bitrate. For example, use '-b:a 192k' for higher quality or '-b:a 96k' for a smaller file. The Opus codec performs exceptionally well at lower bitrates — 96k Opus often sounds better than 192k MP2 — so 128k is a sensible default. The maximum supported option in this tool is 320k, and the minimum is 64k.
The command shown processes a single file, but you can adapt it for batch processing in a shell. On Linux or macOS, use: for f in *.mpeg; do ffmpeg -i "$f" -vn -c:a libopus -b:a 128k "${f%.mpeg}.weba"; done. On Windows Command Prompt: for %f in (*.mpeg) do ffmpeg -i "%f" -vn -c:a libopus -b:a 128k "%~nf.weba". This is especially useful for processing large collections of broadcast MPEG archives.
MPEG files rarely carry rich metadata, and any ID3 or system stream metadata present may not transfer cleanly because the WEBA/WebM container uses a different metadata scheme (Matroska-style tags). FFmpeg will attempt to map compatible tags, but broadcast-originated MPEG files often carry no user-facing metadata at all. If you need specific tags in the output, add them manually with FFmpeg's '-metadata title="My Title"' flag appended to the command.
Technical Notes
MPEG program streams and transport streams (.mpeg, .mpg, .ts) typically encode audio as MP2 (MPEG Audio Layer II), a codec designed for broadcast use in the 1990s. MP2 is not supported natively by any major web browser, which makes MPEG files unsuitable for direct web embedding. The Opus codec used in the WEBA output is a significant technical leap: it is based on SILK and CELT algorithms, supports 8–510 kbps, handles variable bitrate efficiently, and is optimized for both music and speech. One technical consideration is channel mapping: if the source MPEG has a mono or stereo MP2 track (standard for most broadcasts), Opus handles these cleanly. If a 5.1 surround MP2 track is present (less common but possible in DVD-compatible MPEG-2 files), Opus will encode all channels but the WEBA container has limited multi-channel metadata support compared to Matroska MKA. The '-vn' flag appears twice in the resolved command — once as a special container flag for WEBA and once passed explicitly — this is harmless redundancy but ensures the video stream is unconditionally excluded regardless of input stream detection. File size will typically decrease significantly: a 100MB MPEG file with a 192k MP2 audio track might produce a WEBA file of only a few megabytes, since audio data is a small fraction of a video file's total size.