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.
01Command
$ ffmpeg -i video.mp4 -vn -c:a libmp3lame -q:a 2 audio.mp302What 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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- FFmpeg DocumentationEvidence: 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
Transcode any input video to MP4 (H.264 + AAC) with sensible quality settings for sharing and playback everywhere.
Refresh the package index from all configured repositories, then install newer versions of every upgradable package.
Find every occurrence of a pattern across all files in a tree, printed as file:line:number matches.