10/15/2025

Extract audio from video with FFmpeg as MP3, AAC, WAV, or a copied original stream. Includes quality settings, time ranges, and common fixes.

How to Extract Audio from Video Using FFmpeg

FFmpeg can extract the audio track from a video as MP3, AAC, WAV, or the original audio stream. The best command depends on whether you want speed, compatibility, editing quality, or a small file.

For a guided version, use the FFmpeg extract audio tool. For direct commands, start with the examples below.

Fastest: Copy the Original Audio

If you want the audio exactly as it exists inside the video, copy the audio stream:

ffmpeg -i video.mp4 -vn -c:a copy audio.m4a

This is fast because FFmpeg does not re-encode the audio. The output extension should match the audio codec. MP4 videos often contain AAC audio, so .m4a is usually a good choice.

Extract Audio as MP3

MP3 is the safest format when you need compatibility across many apps and devices.

ffmpeg -i video.mp4 -vn -c:a libmp3lame -q:a 2 audio.mp3

The -q:a value controls variable bitrate MP3 quality:

Value Result
0 Highest quality, larger file
2 Excellent general choice
5 Smaller file, acceptable for speech
9 Lowest quality, smallest file

You can also use a fixed bitrate:

ffmpeg -i video.mp4 -vn -c:a libmp3lame -b:a 192k audio.mp3

Extract Audio as WAV

Use WAV when you plan to edit the audio in another application.

ffmpeg -i video.mp4 -vn -c:a pcm_s16le audio.wav

WAV files are much larger than MP3 or AAC, but they avoid another lossy compression step during editing.

Extract Only Part of the Audio

Use -ss for the start time and -t for duration:

ffmpeg -ss 00:01:30 -t 00:00:45 -i video.mp4 -vn -c:a libmp3lame -q:a 2 clip.mp3

This extracts 45 seconds starting at 1 minute 30 seconds.

What the Options Mean

Option Meaning
-i video.mp4 Source video file.
-vn Disables video output.
-c:a copy Copies the audio stream without re-encoding.
-c:a libmp3lame Encodes audio as MP3.
-q:a 2 Sets high variable bitrate MP3 quality.
-b:a 192k Sets fixed audio bitrate.

Which Audio Format Should You Choose?

Output Best for Command style
.m4a Fast extraction from MP4, no quality loss -c:a copy
.mp3 Broad compatibility -c:a libmp3lame -q:a 2
.aac Modern playback and small files -c:a aac -b:a 192k
.wav Editing and archival workflows -c:a pcm_s16le

Common Problems

The output file has no sound.
Check that the input video actually has an audio stream. Run ffmpeg -i video.mp4 and look for an Audio: stream.

Copying audio fails or creates the wrong extension.
Use re-encoding instead of -c:a copy, or choose an extension that matches the codec. For AAC audio from MP4, use .m4a or .aac.

The command says Unknown encoder 'libmp3lame'.
Your FFmpeg build does not include the MP3 encoder. Install a full FFmpeg build or use AAC output instead. The FFmpeg error explainer can help decode the exact message.

Related FFmpeg Pages

Related tool

Extract Audio with FFmpeg

Generate FFmpeg commands to extract MP3, AAC, WAV, FLAC, or original audio streams from video files.

Open the command generator