Extract Audio from MPG to FLAC — Free Online Tool

Extract lossless audio from MPG video files by converting the audio stream to FLAC format. This tool strips the MPEG-1/2 video track and re-encodes the MP2 or MP3 audio into lossless FLAC, giving you a perfect-quality archive of the audio regardless of the source bitrate.

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 typically carry audio encoded in MPEG Layer 2 (MP2) format, a lossy codec common in broadcast television, VCD, and DVD-video sources. Since FLAC is a lossless codec and MP2 is lossy, this conversion is not a simple stream copy — FFmpeg decodes the MP2 audio from the MPG container into raw PCM, then re-encodes it losslessly into FLAC. The video stream is discarded entirely using the -vn flag. The resulting FLAC file preserves every bit of audio information that existed in the decoded MP2 stream, meaning no further quality is lost beyond what was already lost during the original MP2 encoding. FLAC's compression is then applied to reduce file size without any additional audio degradation.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg command-line tool, which handles all demuxing, decoding, encoding, and muxing steps in this MPG-to-FLAC audio extraction pipeline.
-i input.mpg Specifies the input MPG file. FFmpeg reads and demuxes the MPEG-1/2 Program Stream, identifying the video stream (mpeg1video or mpeg2video) and the audio stream (typically MP2) separately.
-vn Disables video output entirely, telling FFmpeg to ignore the MPEG-1/2 video stream and produce an audio-only output. This also prevents FFmpeg from wasting time decoding the video frames, keeping the extraction fast.
-c:a flac Sets the audio codec to FLAC. FFmpeg decodes the source MP2 (or MP3/AAC) audio from the MPG into raw PCM and then re-encodes it using the FLAC lossless codec, ensuring no further audio quality is lost from this point forward.
-compression_level 5 Sets FLAC's compression level to 5, the balanced default. This controls encoder effort and output file size only — all levels from 0 to 8 produce bit-identical audio. Level 5 gives a good balance between encoding speed and compressed file size for typical MPG audio sources.
output.flac Defines the output filename and tells FFmpeg to mux the encoded FLAC audio into a .flac container, which also supports Vorbis comment metadata tags for organizing the extracted audio in a music library.

Common Use Cases

  • Archiving audio from VCD or DVD-ripped MPG files into a lossless format for long-term preservation without further quality degradation
  • Extracting the audio commentary or dialogue track from a broadcast-recorded MPG to use in a video editing project that requires lossless source material
  • Converting MPG recordings from legacy camcorders or capture cards into FLAC for use in a digital audio workstation (DAW) for post-production
  • Pulling music or film scores from MPG source files and storing them as FLAC for high-fidelity playback in audiophile media players
  • Stripping the audio from MPEG-1 or MPEG-2 broadcast recordings and converting to FLAC for metadata tagging and organization in a music library manager
  • Creating lossless audio backups from MPG training or educational videos where the spoken content needs to be transcribed or repurposed

Frequently Asked Questions

No — FLAC is lossless, meaning it perfectly preserves whatever audio it encodes, but it cannot recover quality lost during the original MP2 encoding in the MPG file. The MPG source already compressed the audio using a lossy codec (typically MP2 at 192kbps or similar), so that quality ceiling is fixed. What FLAC guarantees is that no additional quality is lost during or after this conversion, making it ideal for archiving.
MPG files store audio as MP2, a lossy codec that achieves very small file sizes by discarding audio data. FLAC losslessly encodes the full decoded PCM audio, which represents far more data than the compressed MP2 stream — even after FLAC's compression is applied. Depending on the source, the FLAC file may be 3–6 times larger than the equivalent MP2 audio track, which is expected and reflects the difference between lossy and lossless storage.
MPG files based on MPEG-1/2 have very limited native metadata support, so there is typically little or no tag data to carry over. FFmpeg will attempt to map any available metadata to the FLAC output, but in practice most MPG sources contain only minimal or no embedded tags. FLAC supports rich metadata through Vorbis comments, so you can add artist, title, album, and other tags to the output file using a tag editor after conversion.
FFmpeg handles all three audio codecs that MPG containers can carry — MP2, MP3 (libmp3lame), and AAC — using the same command. Regardless of which codec is present, FFmpeg decodes it to raw PCM and re-encodes it to FLAC losslessly. You don't need to change the command; FFmpeg detects the audio codec automatically from the stream.
The -compression_level flag controls the tradeoff between encoding speed and output file size, but importantly it does not affect audio quality — all levels produce bit-identical audio. The default level 5 is a balanced choice. You can set it between 0 (fastest encoding, largest file) and 8 (slowest encoding, smallest file) by changing the value: for example, use '-compression_level 8' for maximum compression when storage space is a priority, or '-compression_level 0' when you need fast batch processing of many MPG files.
Yes. On Linux or macOS you can run a shell loop: 'for f in *.mpg; do ffmpeg -i "$f" -vn -c:a flac -compression_level 5 "${f%.mpg}.flac"; done'. On Windows Command Prompt use: 'for %f in (*.mpg) do ffmpeg -i "%f" -vn -c:a flac -compression_level 5 "%~nf.flac"'. This applies the same extraction settings to every MPG file in the directory, which is especially useful for large VCD or broadcast archives.

Technical Notes

MPG is a container bound to the MPEG-1 and MPEG-2 standards, and its audio codec support is correspondingly narrow — MP2 is the most common and historically the default for VCD and broadcast sources, though MP3 and AAC appear in some MPEG-2 Program Stream files. FLAC uses its own container and the FLAC codec exclusively, so this conversion always involves a full decode-and-reencode of the audio rather than a stream copy. The -compression_level parameter in FLAC is purely an encoder efficiency setting and has zero impact on decoded audio output — all eight levels are perfectly lossless. One notable limitation: MPG does not support multiple audio tracks or subtitle streams, so there is no ambiguity about which stream to extract. The -vn flag ensures the MPEG-1/2 video stream is cleanly dropped without being processed, which keeps conversion fast since video decoding is skipped entirely. FLAC output supports replay gain tags and cue sheets, which can be added post-conversion for audiophile playback environments.

Related Tools