Convert MPG to FLAC — Free Online Tool

Convert MPG video files to FLAC audio by extracting and losslessly compressing the embedded audio track — whether it's MP2, MP3, or AAC — into a high-fidelity FLAC file. Ideal for archiving broadcast or DVD audio with zero quality degradation after extraction.

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 encapsulate video (typically MPEG-1 or MPEG-2) alongside audio tracks most commonly encoded in MP2 or MP3. This conversion discards the video stream entirely and extracts only the audio, then re-encodes it using the FLAC codec — a lossless compression algorithm that preserves every bit of audio data from the source. Because the source audio in MPG is already lossy (MP2 or MP3), no further quality is lost during this step; FLAC simply compresses the decoded PCM audio without any additional degradation. The result is a .flac file that is an exact lossless representation of the audio as it existed in the MPG container, with compression level 5 offering a balanced trade-off between file size and encoding speed.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg tool. In the browser-based version of this tool, FFmpeg runs locally via WebAssembly (FFmpeg.wasm) — your MPG file never leaves your device.
-i input.mpg Specifies the input MPG file. FFmpeg reads the MPEG-1/2 container and identifies the available streams — typically an MPEG-2 video stream and an MP2 audio stream — from which only the audio will be processed.
-c:a flac Sets the audio codec to FLAC (Free Lossless Audio Codec). FFmpeg decodes the source MP2 audio from the MPG to raw PCM and then re-encodes it with the FLAC encoder, producing a lossless representation of the original audio waveform.
-compression_level 5 Controls how aggressively FLAC compresses the audio data, on a scale from 0 (no compression, fastest) to 8 (maximum compression, slowest). Level 5 is the default and offers a practical balance — it produces files meaningfully smaller than level 0 with no impact whatsoever on audio quality, since FLAC is lossless at every compression level.
output.flac Defines the output filename and container. The .flac extension tells FFmpeg to write a FLAC audio file. Because FLAC is a pure audio format, FFmpeg automatically omits the video stream from the MPG without requiring an explicit -vn flag.

Common Use Cases

  • Archiving the audio commentary or dialogue track from a broadcast MPEG-2 recording (e.g., a digitized VHS or DVR capture) in a lossless format for long-term preservation
  • Extracting the stereo soundtrack from a VCD or DVD-compatible MPG file to create a lossless master for audio restoration or mastering work
  • Pulling the audio from old MPEG-1 home video files to preserve the original sound quality before the video is re-encoded or discarded
  • Converting MPG lecture recordings or conference session files into FLAC for archival in a media library that requires lossless audio
  • Extracting the music or score from an MPEG-2 broadcast recording to store in a lossless format compatible with audiophile players and DACs
  • Preparing audio extracted from MPG source files for waveform editing in a DAW, where a lossless intermediate format like FLAC avoids generation loss

Frequently Asked Questions

No — FLAC is lossless, meaning it perfectly preserves whatever audio data it receives, but it cannot recover quality that was already lost when the audio was originally encoded into the MPG file. MPG files typically carry MP2 or MP3 audio, both of which are lossy formats. The FLAC file will be a bit-perfect lossless copy of the decoded audio from the MPG, but the artifacts introduced by the original MP2/MP3 encoding remain. Think of it as freezing the audio quality exactly as it is, with no further loss.
MPG files contain both a video stream and an audio stream, and the lossy MP2 or MP3 audio codec compresses audio aggressively. FLAC, while lossless, stores the full decoded audio waveform in a compressed but uncompromised form. When you strip the video and losslessly encode just the audio, the resulting file size depends entirely on the audio duration and sample rate — for long recordings or high-sample-rate audio, a FLAC file can be larger than the MPG audio-only portion. However, FLAC files will always be smaller than raw uncompressed WAV equivalents.
The video stream is completely dropped. FFmpeg automatically handles this because the output format is .flac, which is a pure audio container with no capacity for video. You do not need to pass a -vn flag explicitly — FFmpeg infers from the output extension that only audio should be written. The resulting FLAC file contains only the audio track from your MPG source.
MPG containers have very limited metadata support compared to modern formats, so there is typically little to no embedded tag data in an MPG file. FLAC supports rich metadata via Vorbis comment tags (title, artist, album, etc.), but since the source MPG rarely carries this information, the output FLAC will generally not contain populated tags either. You can add metadata to the FLAC file after conversion using a tag editor such as MusicBrainz Picard or foobar2000.
You can change the compression level by modifying the -compression_level value anywhere from 0 (fastest encoding, largest file) to 8 (slowest encoding, smallest file). For example, use -compression_level 8 for maximum compression or -compression_level 0 for the fastest conversion. Critically, compression level has absolutely no effect on audio quality — FLAC is lossless at every level. The only trade-off is encoding speed versus output file size.
Yes. On Linux or macOS, you can use a shell loop: for f in *.mpg; do ffmpeg -i "$f" -c:a flac -compression_level 5 "${f%.mpg}.flac"; done. On Windows Command Prompt, use: for %f in (*.mpg) do ffmpeg -i "%f" -c:a flac -compression_level 5 "%~nf.flac". This is especially useful for archiving a folder of broadcast recordings or VCD rips all at once.

Technical Notes

MPG is a multiplexed container governed by the MPEG-1 and MPEG-2 standards, and its audio payload is almost universally MP2 (MPEG-1 Audio Layer II) in broadcast and VCD contexts, though MP3 and occasionally AAC may appear in newer MPEG-2 streams. When FFmpeg decodes this audio for re-encoding to FLAC, it decodes the compressed stream to raw PCM first, then the FLAC encoder losslessly compresses that PCM. The fidelity ceiling is therefore set entirely by the source MPG audio — typically 192–384 kbps MP2 at 48 kHz for broadcast, or 128–224 kbps MP2 at 44.1 kHz for VCD. FLAC supports sample rates up to 655,350 Hz and bit depths up to 32 bits, so it will faithfully represent whatever the MPG decoder produces. Note that MPG does not support multiple audio tracks or subtitles in the way MKV does, so there is no risk of unintended stream selection. The -compression_level 5 default is a widely recommended middle ground — level 8 yields only marginally smaller files at significantly greater CPU cost, making it worthwhile only for very large batch archiving jobs.

Related Tools