Extract the audio track from a video with ffmpeg

Dump a video's audio into a standalone MP3 (or WAV/FLAC/AAC) file without touching the video itself.

LinuxTerminalmediaLow risk
Run ffmpeg -i video.mp4 -vn -c:a libmp3lame -q:a 2 audio.mp3 to save the video's audio as an MP3.

01Command

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

02What it does

-vn drops the video stream, leaving only audio to be encoded; -q:a 2 is a VBR quality setting for libmp3lame (0 best ~245 kbps, 9 smallest). To keep original quality instead of re-encoding to MP3, copy the track directly: ffmpeg -i video.mp4 -vn -c:a copy audio.aac — this works only when the existing audio codec is allowed in the target container (AAC in m4a, e.g.). Use -map 0:a:0 when a video has multiple audio tracks to pick the first, and verify the result with ffprobe audio.mp3.

03Risk

RiskLow risk
Requirementsffmpeg installed; libmp3lame included in most distro builds (Fedora needs RPM Fusion for MP3 encoding)

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • FFmpeg Documentation
    FFmpeg · vendor-doc · 2026-09-17
    Evidence: The FFmpeg documentation describes -vn as disabling video recording and codec/quality options such as -q:a for audio output streams.

Last verified: 2026-09-17 · Category: Media

06Related solutions