Extract Audio from AVI to FLAC — Free Online Tool

Extract lossless audio from AVI files by converting the audio stream to FLAC — preserving every bit of audio quality from the original recording. Whether your AVI contains MP3, AAC, or Vorbis audio, this tool re-encodes it to FLAC's open lossless format, giving you an archival-quality audio file without the video overhead.

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

AVI files store interleaved audio and video data in Microsoft's legacy RIFF-based container. During this conversion, the video stream is completely discarded (using the -vn flag) and the audio stream — which in AVI is typically encoded as MP3 (libmp3lame), AAC, or Vorbis — is decoded and then re-encoded into FLAC using lossless compression. Because FLAC is lossless, the output perfectly represents whatever the decoded audio data contains; however, if the original AVI audio track was already lossy (e.g. MP3 at 128k), this pipeline decodes that lossy audio and re-encodes it losslessly — the FLAC file is lossless, but it cannot recover detail that the original lossy codec discarded. The result is a standalone .flac file at compression level 5, which balances decode speed and file size without any quality compromise.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg program. In the browser-based version of this tool, this runs as FFmpeg.wasm compiled to WebAssembly — no files leave your device. When running locally on your desktop, this calls your system-installed FFmpeg binary.
-i input.avi Specifies the input AVI file. FFmpeg reads the RIFF container structure, identifies all streams (video and audio tracks interleaved within the AVI), and makes them available for processing. The -i flag must precede any output options.
-vn Disables video output entirely, telling FFmpeg to ignore all video streams from the AVI file. This is required because FLAC is a pure audio format and cannot contain video data — without this flag, FFmpeg would error or attempt an unsupported mux.
-c:a flac Sets the audio codec to FLAC for the output. FFmpeg will decode the AVI's audio stream (whether MP3, AAC, or Vorbis) to raw PCM internally, then re-encode it using the native FLAC encoder, producing a losslessly compressed output.
-compression_level 5 Sets FLAC's compression effort to level 5 on a scale of 0–8. This controls only the file size and encoding speed — all levels produce bit-perfect, identical audio quality. Level 5 matches the official FLAC reference encoder's default, striking a balance between compact file size and fast encoding.
output.flac Defines the output filename and tells FFmpeg to write a FLAC container. The .flac extension signals the correct output format, resulting in a standalone audio file containing only the losslessly encoded audio extracted from the original AVI.

Common Use Cases

  • Archiving the audio from vintage AVI camcorder footage or digitized VHS recordings in a lossless open format that will remain accessible for decades
  • Extracting a music performance or concert recording captured in AVI format to FLAC for inclusion in a high-resolution audio library
  • Pulling dialog or voiceover audio out of an AVI video project for further editing in a DAW like Audacity or Reaper, where FLAC is preferred over lossy formats
  • Converting AVI-packaged game cutscene audio or old multimedia CD-ROM content to FLAC for preservation and cataloging
  • Stripping the audio track from a large AVI video file to save storage space while retaining a lossless audio reference before the video is re-encoded or discarded
  • Preparing audio extracted from AVI source files for upload to lossless streaming platforms or music distribution services that accept FLAC

Frequently Asked Questions

The FLAC file itself is lossless, meaning it encodes whatever audio data it receives with zero further degradation. However, if your AVI's audio track is MP3 (which is the AVI default), that audio was already lossy when it was first encoded. The conversion decodes the MP3 stream and re-encodes the result to FLAC perfectly — but any detail lost during the original MP3 encoding cannot be recovered. If your AVI contains an uncompressed PCM audio track, the FLAC output will be a genuinely lossless representation of that original audio.
AVI files almost always carry lossy audio codecs like MP3 or AAC, which achieve small file sizes through aggressive perceptual compression. FLAC uses lossless compression — it stores the full decoded audio signal. When you decode a 128k MP3 stream and re-encode it to FLAC, the FLAC file represents the full PCM audio data (typically 16-bit stereo at 44.1kHz or higher), which is inherently larger than the lossy compressed version, even after FLAC's own compression is applied.
By default, FFmpeg selects the first audio stream (stream index 0) from the AVI file, which is the primary audio track. AVI does support multiple audio tracks, so if your file has secondary language dubs or commentary tracks and you want one of those instead, you can modify the command by adding -map 0:a:1 (for the second audio track) before the output filename. Note that the FLAC format only supports a single audio track per file, so each track would need to be extracted separately.
FLAC's compression level (0–8) controls how aggressively the encoder compresses the audio data to reduce file size — but crucially, all levels produce bit-identical audio output. Level 0 encodes fastest with the largest file size, while level 8 produces the smallest file but takes significantly longer to encode. Level 5 is the FLAC reference encoder's default and a well-established sweet spot for most use cases. Unless you're batch processing hundreds of large AVI files and need maximum encoding speed (use level 0–2) or are optimizing for minimum storage (use level 8), level 5 is the right choice.
To change the compression level, replace the 5 in -compression_level 5 with any integer from 0 to 8, for example: ffmpeg -i input.avi -vn -c:a flac -compression_level 8 output.flac. To extract a specific audio track from a multi-track AVI, insert a -map flag: ffmpeg -i input.avi -vn -map 0:a:1 -c:a flac -compression_level 5 output.flac (where 0:a:1 selects the second audio stream). To batch convert an entire folder of AVI files on Linux or macOS, use: for f in *.avi; do ffmpeg -i "$f" -vn -c:a flac -compression_level 5 "${f%.avi}.flac"; done.
AVI has very limited metadata support — it uses a basic RIFF INFO chunk that can store fields like artist, title, and creation date, but these tags are not standardized and are often absent entirely. FFmpeg will attempt to map any AVI metadata it finds to FLAC's Vorbis comment tag structure during conversion. However, because AVI metadata is rarely present or well-formatted in practice, you should verify tags in the output FLAC file and add them manually using a tool like MusicBrainz Picard or Kid3 if needed.

Technical Notes

AVI (Audio Video Interleave) is a RIFF-based container developed by Microsoft in 1992, and while it supports multiple audio codecs including MP3, AAC, and Vorbis, its audio is almost universally MP3 in real-world files due to historical defaults. FLAC (Free Lossless Audio Codec) is maintained by the Xiph.Org Foundation and stores audio as a series of independently-decodable frames with a streamable structure, making it ideal for archival. One important limitation: AVI's audio is muxed with strict interleaving constraints that can cause minor sync artifacts in edge cases — these are resolved when the audio is demuxed, decoded, and output as a pure audio file. The -vn flag is essential here; without it, FFmpeg would attempt to include video in the output, which FLAC does not support and would cause an error. FLAC files produced by this conversion natively support ReplayGain tags for volume normalization and can store cue sheet information, which can be added post-conversion for tracks extracted from concert recordings or compilation AVIs. Maximum FLAC channel count is 8 (7.1 surround), so even multi-channel AVI audio is fully supported. The output file size will vary substantially depending on whether the source AVI audio was stereo or mono, the original sample rate, and the FLAC compression level chosen.

Related Tools