ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3

Category: Media & Conversion

ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3

Extract the audio track as an MP3 file

Drops the video stream with -vn and encodes the audio as MP3 with the libmp3lame codec. -q:a 2 selects VBR quality on a 0-9 scale where lower is better, and 2 is a good music default. To copy audio without re-encoding use -c:a copy instead.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.