Extract Audio from MPG to WEBA — Free Online Tool
Extract audio from MPG video files and convert it to WEBA format, re-encoding the MP2 or MP3 audio stream as Opus inside a WebM container. The result is a compact, web-optimized audio file ideal for modern browsers, with Opus delivering better quality than MP2 at comparable or lower bitrates.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MPG 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
MPG files typically carry MP2 (MPEG-1 Audio Layer II) audio — the legacy broadcast standard used in VCD and DVD production. Since WEBA requires either Opus or Vorbis audio inside a WebM container, the MP2 audio stream cannot be simply copied; it must be fully decoded and re-encoded using the libopus encoder. The video stream is discarded entirely using the -vn flag, so FFmpeg never decodes or processes the video, keeping conversion fast and CPU usage low. The output is a .weba file at 128k bitrate by default — a format natively supported by Chromium-based browsers and Firefox, optimized for streaming and low-latency web playback.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg command-line tool. In the browser version of this tool, the same logic runs via FFmpeg.wasm compiled to WebAssembly, so no installation is needed and no files leave your device. |
-i input.mpg
|
Specifies the input MPG file. FFmpeg reads the MPEG-1 or MPEG-2 program stream, identifying the multiplexed video (typically mpeg2video) and audio (typically MP2) streams inside. |
-vn
|
Disables video output, telling FFmpeg to ignore the MPEG video stream entirely. This means the mpeg2video (or mpeg1video) track is never decoded, significantly speeding up the audio extraction process. |
-c:a libopus
|
Sets the audio encoder to libopus, the reference Opus encoder. Since MP2 audio from the MPG source cannot be stream-copied into a WebM container, this encoder fully re-encodes the audio into Opus — the native codec of the WEBA format. |
-b:a 128k
|
Sets the target audio bitrate to 128 kilobits per second for the Opus encoder. At this bitrate, Opus delivers quality that typically equals or exceeds the original MP2 audio in the MPG source, making it a solid default for both speech and moderate-quality music content. |
-vn
|
A second instance of the video-disable flag placed before the output filename, acting as an explicit guard to ensure no video stream is written to the WEBA container. WEBA is audio-only by specification, so this prevents any accidental video stream inclusion. |
output.weba
|
Specifies the output filename with the .weba extension. FFmpeg uses this extension to identify the target as a WebM-based audio-only container, which is the correct enclosure format for Opus-encoded audio intended for web playback. |
Common Use Cases
- Extracting the audio commentary or narration from an archived broadcast MPG recording to use on a modern web page without requiring a video player
- Pulling music or sound effects from a VCD-era MPG file for use in a web-based interactive project where Opus is the preferred codec
- Converting MPG training or instructional videos into audio-only WEBA files for a learning management system that streams audio directly in the browser
- Archiving the audio track from MPEG-2 broadcast captures in a smaller, more efficient Opus-encoded file for long-term web-accessible storage
- Extracting dialogue or interviews recorded in MPG format for transcription workflows where only the audio is needed and file size matters
- Preparing audio from legacy MPG media for use in a WebRTC or web audio application that natively handles Opus-encoded streams
Frequently Asked Questions
Yes — this is a lossy-to-lossy conversion. The original MP2 audio in the MPG file is decoded to raw PCM and then re-encoded as Opus, which introduces a second generation of lossy compression. That said, Opus is a significantly more modern and efficient codec than MP2; at 128k, Opus typically sounds better than MP2 at 192k. For critical listening purposes, using a higher WEBA bitrate like 192k or 256k will minimize any perceptible quality degradation from the transcode.
The WEBA format is a restricted version of the WebM container and only supports Opus or Vorbis audio. MPG files use MP2 (or occasionally MP3 or AAC) audio, none of which are valid inside a WebM container. There is no way to stream-copy the audio from MPG to WEBA — a full decode and re-encode to Opus is always required for this conversion.
MPG files from VCD sources typically carry MP2 audio at 128k or 192k, while DVD and broadcast MPG files often use 192k to 384k MP2. Opus at 128k is generally considered transparent or near-transparent for most content, making it a reasonable default. However, if your source MPG has high-bitrate MP2 audio with complex stereo content like orchestral music, bumping the WEBA output to 192k or 256k is advisable to preserve fidelity through the transcode.
WEBA files, being WebM containers with Opus audio, are natively supported in Chrome, Chromium, Firefox, Edge, and Opera. Safari added WebM and Opus support starting in Safari 14.1 on macOS and iOS 15. The format is not natively supported in older versions of Safari or in Windows Media Player. For maximum compatibility across all devices and players, MP3 remains broader, but for web delivery specifically, Opus/WEBA offers excellent support in modern environments.
Replace the value after -b:a in the command. For example, to encode at 192k instead of the default 128k, use: ffmpeg -i input.mpg -vn -c:a libopus -b:a 192k -vn output.weba. Supported values for Opus are typically 64k, 96k, 128k, 192k, 256k, and 320k. For voice-only content extracted from MPG recordings, 64k or 96k Opus is often sufficient. For music, 128k to 192k is a good target range.
Yes. On Linux or macOS, you can use a shell loop: for f in *.mpg; do ffmpeg -i "$f" -vn -c:a libopus -b:a 128k -vn "${f%.mpg}.weba"; done. On Windows Command Prompt, use: for %f in (*.mpg) do ffmpeg -i "%f" -vn -c:a libopus -b:a 128k -vn "%~nf.weba". Each file is processed sequentially, and since the video is discarded early with -vn, batch processing is relatively fast even for large MPG archives.
Technical Notes
MPG is a multiplexed container format rooted in the MPEG-1 and MPEG-2 standards, and its audio stream is almost universally MP2 (MPEG-1 Audio Layer II) in VCD and broadcast contexts, with some MPEG-2 program streams carrying MP3 or AAC. None of these codecs are compatible with the WebM/WEBA container, so FFmpeg must perform a full audio transcode to libopus. The -vn flag appears twice in the resolved command — once before the codec flags to prevent video stream selection, and once before the output filename as a safety measure — this is redundant but harmless. ID3-style metadata tags embedded in the MPG container (such as title or artist fields, which are rare in broadcast MPG files) are not automatically carried over to the WEBA output, as WebM uses its own metadata scheme; you may need to add -metadata title="..." explicitly if preservation matters. WEBA files are not supported by all media players outside the browser context — VLC and FFmpeg itself handle them fine, but Windows Explorer, macOS QuickTime, and many mobile players may not recognize the extension. The libopus encoder in FFmpeg supports variable bitrate (VBR) mode by default, which can result in slightly smaller files than the nominal -b:a value suggests when encoding quieter content like spoken dialogue extracted from MPG recordings.