Convert video to audio-only format
basic conversion
// what it does
Drops the video stream with -vn and encodes just the audio. The first form uses libmp3lame in VBR mode at -q:a 2 (roughly 190 kbps average, near-transparent MP3), while the second produces an AAC .m4a at a fixed 192 kbps. Use these to extract soundtracks, podcasts, or music from a video file.
// shell
$ ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3$ ffmpeg -i input.mp4 -vn -c:a aac -b:a 192k output.m4a// gotcha
-q:a sets a per-encoder VBR quality scale: for libmp3lame here it maps to LAME's -V (well tuned, so 2 is about 190 kbps). The native aac encoder has a -q:a VBR mode too, but it's poorly tuned and not recommended — set the AAC bitrate with -b:a instead, as the second command does. To keep the existing audio track untouched, use -c:a copy and skip re-encoding entirely (when the target container supports that codec).