Blog / Guide

How to Extract Audio from a Video Without Unnecessary Quality Loss

How to Extract Audio from a Video Without Unnecessary Quality Loss

To get the audio out of a video with no quality loss, copy the existing audio track into a new file without re-encoding it. This is possible when the audio codec fits the container of the new file. If you need a different format, such as MP3 for an app that only accepts it, the audio has to be decoded and encoded again, and a lossy format will lose some quality. Renaming the file never works, and saving as WAV doesn’t bring back detail that the original compression already discarded.

Which method applies depends on where the video is: a file on your computer, or a video playing in your browser. The sections below cover both.

Extraction, conversion, track selection and muting are different jobs

People searching for this mean several different things, and the right tool differs:

  • Extraction pulls an existing audio stream out of a video into its own file.
  • Conversion changes the audio into another format or codec. It re-encodes the sound.
  • Track selection chooses one audio track from a video that has several, for example a language or commentary track. You need this before you extract.
  • Muting removes the audio from a video and keeps the picture. It is the opposite task.

Mixing these up causes the usual surprises: an extracted file in the wrong language, a file that is silent, or audio that sounds worse than the original.

Copy or convert: the decision that decides quality

Inside a video file, the audio is already compressed with a codec such as AAC, MP3 or Opus. FFmpeg’s documentation describes two ways to handle it:

  • Stream copy passes the encoded audio from the source into a new file without decoding or encoding. Nothing about the sound changes. FFmpeg’s description of streamcopy says exactly this: copying packets without decoding, filtering or encoding them.
  • Transcoding decodes the audio and encodes it again. FFmpeg’s transcoding notes point out that encoding is expensive and in most cases degrades the stream quality, so it should be used when necessary, for instance when the target can’t decode the original codec.

Stream copy needs a compatible destination. AAC audio, for example, can usually be written to an .m4a file as it is. If you ask for an MP3 and the audio is AAC, a copy isn’t possible: the audio has to be converted, and MP3 is a lossy format. Not every conversion is lossy: a lossless target such as FLAC doesn’t discard more information. But it also doesn’t recover anything the original lost, and it produces a larger file for the same sound.

That is the answer to the popular question: WAV does not improve the quality of lossy audio. If the source was AAC at a modest bitrate, a WAV made from it holds a much bigger version of the same decoded sound. Choose the conversion target for compatibility, not to improve quality.

You want What happens Quality
The original audio, in a file that accepts its codec Stream copy Unchanged
A different lossy format (for example MP3) Re-encode A further lossy generation
A lossless format (for example WAV or FLAC) Decode, store without further loss No further loss, but no recovery of earlier loss; larger file
A silent video Mute, not extraction Not applicable

If the video is a file on your computer

Use a local tool that opens the file. With FFmpeg, first list the audio streams. The output shows each stream’s index and codec, and a file with several tracks lists several lines:

ffprobe -v error -select_streams a -show_entries stream=index,codec_name:stream_tags=language,title -of csv=p=0 input.mp4

A typical result looks like 1,aac,eng and 2,aac,spa: the stream index, the codec and the language tag, if the file has one. The index counts all streams in the file, video included. If the track you want is aac, you can copy it. Without -map, FFmpeg picks an audio stream by its own automatic rules, so select it explicitly. -map 0:a:0 means the first audio stream and -map 0:a:1 the second, counting audio streams only:

ffmpeg -i input.mp4 -map 0:a:1 -c:a copy output.m4a

-map chooses the stream and -c:a copy copies it unchanged. FFmpeg discards video that isn’t mapped, so no -vn is needed here. If you need MP3 instead, from the same second track:

ffmpeg -i input.mp4 -map 0:a:1 -c:a libmp3lame -b:a 192k output.mp3

That is a re-encode. Pick a bitrate for the target, and don’t expect a higher bitrate to improve audio that was already compressed at a lower one. For a file with a single audio track, -map 0:a:0 is the same as FFmpeg’s default and can be left out, but it does no harm.

Graphical editors work too. Web tools such as Riverside’s audio extractor and Descript’s take an uploaded file and export a chosen format. They are convenient, but their pages focus on picking an output format and don’t clearly say whether the result is a copy of the original audio or a new encode. They also involve uploading the file, and Riverside’s page states a 100 MB upload limit.

If the video is playing in your browser

First check whether the publisher offers an audio download or a permitted route of their own. If you want the audio of a video that the page loads in your browser, a browser extension can save it directly.

MAX Video Downloader can save an original audio track from supported media it finds on a page, or convert it to another supported format, without inflating the bitrate. It can also save selected tracks separately instead of merging everything into one file. The format list depends on the current version, so check the extension’s options rather than assuming a particular format. MAX is built around media a page loads in your browser; it doesn’t open files from your disk, so for a local file use one of the tools above.

When the video has more than one audio track

Many streams carry several audio tracks, such as languages or a commentary. In HLS, alternative audio is declared as separate renditions that the player selects, as RFC 8216 describes, and in DASH the audio is a separate stream from the video. So the audio you get depends on the track you pick, and an extraction can produce the wrong language or, if no audio track is chosen, no sound at all. Look at the track list first. DASH video downloads and HLS downloads explain how these streams are built.

Rights and limits

Extracting audio from a video you don’t have the right to copy doesn’t make it yours. Use it for content you own, that is licensed for it, or that the publisher permits you to save. MAX doesn’t support YouTube or DRM-protected media, and nothing here is a way around those protections.