The key flag is -vn — "no video" — which drops the video stream and keeps only audio. From there you decide whether to copy the existing audio as-is (fastest, lossless) or re-encode it to a different format like MP3.
Key takeaways
-vnstrips video; the output keeps audio only.-c:a copyextracts losslessly when the container supports the codec.- Set
-q:afor MP3 quality (0 = best, 9 = smallest). - Combine with
-ss/-toto rip a specific segment.
Extract audio losslessly (no re-encode)
If you just need the original audio in its own file, copy the stream. Match the extension to the source codec — AAC audio goes into .m4a, for example:
# copy the existing AAC track into an .m4a ffmpeg -i in.mp4 -vn -c:a copy out.m4a
Convert to MP3, AAC, or WAV
To get a portable file, re-encode. MP3 for sharing, WAV for lossless editing, AAC for small high-quality files:
# MP3, high quality (VBR) ffmpeg -i in.mp4 -vn -c:a libmp3lame -q:a 2 out.mp3 # AAC at 192k ffmpeg -i in.mp4 -vn -c:a aac -b:a 192k out.m4a # uncompressed WAV ffmpeg -i in.mp4 -vn -c:a pcm_s16le out.wav
Rip only part of the audio
Add a start and end time to grab a clip — the 30 seconds you actually want, not the whole file:
# extract audio from 00:30 to 01:00 as MP3 ffmpeg -ss 00:00:30 -to 00:01:00 -i in.mp4 \ -vn -c:a libmp3lame -q:a 2 clip.mp3
Extract audio visually instead
FFmpegLab shows the audio track on the timeline so you can export it to MP3 or WAV with a click, and it runs fully offline — your recordings never leave the machine. Want the reverse? See removing or muting audio, or mixing tracks.