Extract Audio from MPG to OGA — Free Online Tool

Extract audio from MPG video files and save it as OGA (Ogg Audio) using the Vorbis codec — a fully open, patent-free format ideal for archiving MPEG-1/2 broadcast and DVD audio. The conversion strips the MPEG video stream entirely and re-encodes the MP2 or MP3 audio track into high-quality Vorbis, running entirely in your browser with no upload required.

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

MPG files store video using MPEG-1 or MPEG-2 video codecs alongside audio encoded typically in MP2 (MPEG Audio Layer II), occasionally MP3 or AAC. During this conversion, FFmpeg discards the video stream entirely using the -vn flag and re-encodes only the audio track from its original MP2 format into Vorbis, which is the default and most widely supported codec for the OGA container. Vorbis is a lossy codec like MP2, but it is significantly more efficient — meaning it achieves comparable or better perceived audio quality at lower bitrates. The OGA container is simply an Ogg file that holds audio-only streams, and it supports rich metadata tagging. Because MP2 and Vorbis are not the same codec family, a full re-encode of the audio is always required — there is no stream-copy shortcut for this conversion.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg tool — in this browser-based implementation, it runs as FFmpeg.wasm compiled to WebAssembly, so no installation is required and no files leave your machine.
-i input.mpg Specifies the input file — an MPG container holding MPEG-1 or MPEG-2 video alongside an audio track (typically MP2). FFmpeg will demux both streams before processing.
-vn Disables video output entirely — this is the key flag that makes this an audio extraction rather than a video conversion. The MPEG-1/2 video stream from the MPG is read but immediately discarded, so it is never written to the OGA output.
-c:a libvorbis Re-encodes the audio using the libvorbis encoder, producing an Ogg Vorbis audio stream. This is necessary because the source MP2 codec from the MPG is not natively supported in the OGA container — a full transcode to Vorbis is required.
-q:a 4 Sets the Vorbis variable bitrate quality to level 4 on a 0–10 scale, targeting approximately 128–160 kbps. This balances file size and audio fidelity well for typical MPG source material including broadcast audio and DVD stereo tracks.
output.oga Defines the output filename with the .oga extension, which signals to both FFmpeg and downstream media players that this Ogg container holds audio-only content — specifically the Vorbis stream extracted and re-encoded from the source MPG.

Common Use Cases

  • Extracting the audio commentary or narration track from a DVD-sourced MPG file for use in an open-source media project that requires patent-free formats
  • Archiving audio from broadcast MPEG-2 recordings (such as TV captures) into a smaller, more storage-efficient Vorbis/OGA file without keeping the video
  • Pulling the audio from a VCD-format MPG to create a standalone music or spoken-word file playable in open-source media players like VLC or Audacious
  • Converting the MP2 audio stream from legacy MPEG-1 video files into modern Vorbis for compatibility with web-based HTML5 audio players that support Ogg
  • Stripping and re-encoding MPG audio tracks from digitized home video archives into OGA for long-term storage on Linux-based NAS systems where open formats are preferred
  • Extracting lecture or conference recordings stored as MPG to share the audio-only OGA version with users on bandwidth-limited or open-source-focused platforms

Frequently Asked Questions

Yes, some quality degradation occurs because this is a lossy-to-lossy transcode — the MP2 audio in the MPG file is decoded to raw PCM and then re-encoded as Vorbis. Each generation of lossy encoding introduces artifacts. However, Vorbis at quality level 4 (the default, roughly 128–160 kbps variable bitrate) is generally considered to sound better than MP2 at typical broadcast bitrates of 128–192 kbps, so the perceptible difference is often minimal, especially for speech or standard stereo music content.
Both .ogg and .oga use the same underlying Ogg container format, but .oga was introduced by the Xiph.Org Foundation specifically to denote Ogg files containing audio-only streams (typically Vorbis or FLAC), distinguishing them from .ogg files that might contain video (Theora) or other content types. Using .oga makes it immediately clear to media players and file managers that the file contains no video, and it is the technically correct extension for this audio-only output.
Yes — OGA supports the FLAC codec for lossless audio storage. To use it, you would modify the FFmpeg command to replace '-c:a libvorbis -q:a 4' with '-c:a flac'. However, keep in mind that the source audio in an MPG file is already lossy MP2, so using FLAC will losslessly preserve the MP2 decode output rather than recover the original uncompressed audio — the quality ceiling is still set by the original MP2 encoding. FLAC output will also be significantly larger than Vorbis.
The -q:a flag controls Vorbis quality on a scale from 0 (lowest, ~64 kbps) to 10 (highest, ~500 kbps), with 4 being the default (approximately 128–160 kbps variable bitrate). To increase quality, raise the value — for example, '-q:a 6' targets around 192–224 kbps and is a good choice for music extracted from higher-quality MPEG-2 sources. For speech-only content from VCD-quality MPG files, '-q:a 2' or '-q:a 3' is often sufficient and produces much smaller files.
MPG files have very limited metadata support by design — the MPEG-1/2 container does not carry ID3-style tags or chapter markers. OGA (via the Ogg container) supports rich Vorbis Comment metadata and chapters, but since the source MPG has no metadata to extract, the output OGA file will typically be empty of tags. You would need to add metadata separately using a tool like FFmpeg's -metadata flag or a dedicated tag editor such as EasyTag after conversion.
Yes — on Linux or macOS, you can loop over files in a directory using a shell one-liner: 'for f in *.mpg; do ffmpeg -i "$f" -vn -c:a libvorbis -q:a 4 "${f%.mpg}.oga"; done'. On Windows Command Prompt, use: 'for %f in (*.mpg) do ffmpeg -i "%f" -vn -c:a libvorbis -q:a 4 "%~nf.oga"'. This is particularly useful for large batches of digitized broadcast recordings or DVD rips that exceed the 1GB browser limit.

Technical Notes

MPG is a rigid, broadcast-oriented container that typically carries MP2 audio (MPEG Audio Layer II) at fixed bitrates of 128–384 kbps, a codec that dates to the early 1990s and lacks the psychoacoustic sophistication of modern encoders. Vorbis, by contrast, uses variable bitrate encoding with a more advanced perceptual model, making it more efficient for the same perceived quality. The OGA container wraps the Vorbis stream in Ogg pages with granule-position seeking support, meaning the output file is fully seekable even without an index. One notable limitation: MPG files from some broadcast or VCD sources may contain multiple audio streams or dual-mono channels, but FFmpeg will by default select only the first audio stream for extraction — use '-map 0:a:1' to select alternate tracks if needed. The Vorbis encoder (libvorbis) handles stereo natively but does not support more than 2 channels in standard configurations without additional flags. Finally, MPG files with MPEG-1 Layer II audio at non-standard sample rates (such as 22050 Hz from some VCD sources) will be handled automatically by FFmpeg during the Vorbis re-encode, with sample rate conversion applied transparently.

Related Tools