Extract Audio from MPEG to FLAC — Free Online Tool

Extract lossless audio from MPEG video files by converting the MP2 or MP3 audio track to FLAC — a lossless format that preserves every bit of audio data without further quality degradation. Ideal for archiving audio from legacy MPEG-1 or MPEG-2 sources while discarding the video stream entirely.

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

MPEG files (.mpeg, .mpg) typically carry audio encoded in MP2 (MPEG-1 Audio Layer II) or occasionally MP3 or AAC, muxed together with MPEG-1 or MPEG-2 video. This tool strips the video stream completely using the -vn flag, then re-encodes the audio track into FLAC — a lossless codec. Because the source audio in MPEG files is already lossy (MP2 or MP3), the FLAC output captures that audio exactly as it exists in the source file without introducing any additional compression artifacts. The result is a bit-perfect archive of the MPEG's audio content in a widely supported, open lossless format. The FLAC compression level controls only how hard the encoder works to shrink the file size — it has zero effect on audio quality.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg program, which is running here as a WebAssembly (FFmpeg.wasm) instance entirely inside your browser — no data is sent to any server.
-i input.mpeg Specifies the input MPEG file, which may contain MPEG-1 or MPEG-2 video alongside an MP2, MP3, or AAC audio track. FFmpeg demuxes both streams from the MPEG container.
-vn Disables video output entirely, telling FFmpeg to ignore the MPEG-1 or MPEG-2 video stream and produce an output file containing only the extracted audio. Without this flag, FFmpeg would attempt to include video in the output, which FLAC cannot contain.
-c:a flac Specifies that the audio stream should be encoded using the FLAC codec. FFmpeg first fully decodes the source MP2 audio to raw PCM, then re-encodes it as FLAC, ensuring no additional lossy compression is introduced beyond what already existed in the MPEG source.
-compression_level 5 Sets the FLAC compression effort to level 5 (the standard default on a scale of 0–8). This controls only the encoder's compression efficiency and processing time — it has no effect whatsoever on the audio quality or fidelity of the output file.
output.flac Defines the output filename with the .flac extension. The resulting file is a standalone FLAC audio file containing the losslessly compressed audio extracted from the MPEG source, with no video data.

Common Use Cases

  • Archiving audio from legacy broadcast recordings or VHS captures stored as MPEG-2 files, where you want to preserve the audio track without further lossy re-encoding
  • Extracting the MP2 audio track from a DVD-compatible MPEG file to edit in a DAW that accepts FLAC but not raw MP2 streams
  • Pulling audio from old MPEG-1 video files (such as early internet video or CD-ROM content) to create a losslessly compressed archive before the original media degrades
  • Separating the audio from broadcast MPEG-2 recordings (such as captured TV streams) to analyze, transcribe, or repurpose the audio content independently
  • Converting the audio from educational or training videos stored in legacy MPEG format into FLAC for long-term digital preservation workflows
  • Extracting a clean audio reference track from an MPEG source file for quality comparison or audio restoration work

Frequently Asked Questions

No — FLAC is lossless, but it cannot recover detail that was already discarded when the MPEG file's audio was originally compressed into MP2 or MP3. The FLAC output will be a perfect, bit-exact copy of the lossy audio data already in the MPEG file. What FLAC does guarantee is that no additional quality loss occurs during this conversion, making it the best archival choice when you want to preserve the audio exactly as it currently exists in the source file.
MPEG audio tracks use lossy compression (typically MP2 at 128–256 kbps), which achieves very small file sizes by permanently discarding audio information. FLAC uses lossless compression, meaning it must store all the audio data and can only reduce file size through reversible algorithms. Because FLAC is decompressing and then losslessly re-encoding the full PCM audio, the output is typically several times larger than the original MP2 stream — even at the maximum compression level of 8. This size increase is expected and is the trade-off for guaranteed lossless fidelity.
MPEG containers have very limited and inconsistently implemented metadata support compared to modern formats. Most MPEG files carry little to no embedded tag information. FLAC, by contrast, supports rich Vorbis Comment metadata tags. During this conversion, any metadata present in the MPEG source will be passed through by FFmpeg where possible, but in practice most MPEG files will produce a FLAC with minimal or no tags. You will likely need to add artist, album, and track metadata manually after conversion using a tag editor like MusicBrainz Picard or Mp3tag.
The -compression_level flag in FLAC controls the trade-off between encoding speed and output file size — it has absolutely no effect on audio quality. Level 5 is the standard default that balances compression efficiency with reasonable encoding speed. Levels 0–4 encode faster but produce slightly larger files, while levels 6–8 compress more aggressively but take significantly longer. For most use cases, level 5 is the right choice. If you are processing large batches of MPEG files and speed matters more than file size, try level 0 or 1.
To batch process multiple MPEG files in a Unix shell (macOS or Linux), you can wrap the command in a loop: `for f in *.mpeg; do ffmpeg -i "$f" -vn -c:a flac -compression_level 5 "${f%.mpeg}.flac"; done`. On Windows Command Prompt, use: `for %f in (*.mpeg) do ffmpeg -i "%f" -vn -c:a flac -compression_level 5 "%~nf.flac"`. Each MPEG file will produce a corresponding .flac file with the same base name. Note that this browser-based tool processes one file at a time — the FFmpeg command is provided specifically for running batch jobs locally on your desktop.
FLAC is widely supported across desktop and mobile platforms. On desktop, VLC, foobar2000, Windows Media Player (via codec packs), and macOS with QuickTime or IINA all support FLAC natively or with minimal setup. On mobile, Android has had native FLAC support since Android 3.1, and iOS/iPadOS support FLAC in the Music app since iOS 11. Most modern streaming-capable audio hardware such as network streamers and high-end DAPs also support FLAC. The main exception is older consumer electronics and some car audio systems designed around MP3 playback — if compatibility with older hardware is a priority, converting to MP3 instead would be more appropriate.

Technical Notes

MPEG-1 and MPEG-2 containers are among the oldest standardized video formats still in regular use, and their audio tracks are most commonly encoded in MP2 (MPEG-1 Audio Layer II) — the predecessor to MP3 that was standard in broadcast television and DVD authoring. MP2 uses a simpler psychoacoustic model than MP3, which means at equivalent bitrates it is often considered slightly lower fidelity, though at high bitrates (192–256 kbps) the difference is negligible for most listeners. When FFmpeg extracts this audio and re-encodes it to FLAC, it fully decodes the MP2 bitstream to raw PCM first, then applies FLAC's lossless compression — so the FLAC file is effectively a lossless snapshot of the decoded MP2 audio. One known limitation: MPEG containers do not reliably store sample rate, channel layout, or timing metadata in a way that survives all FFmpeg extraction paths cleanly. If the resulting FLAC has incorrect duration reporting or playback timing issues, adding the -fflags +genpts flag before the input can help FFmpeg reconstruct timestamps correctly. FLAC supports up to 8 channels and sample rates up to 655,350 Hz, so standard stereo or mono MP2 audio from MPEG sources will be fully accommodated without any downmixing or resampling.

Related Tools