Extract the Audio Track from a Video with ffmpeg -vn
Pull the soundtrack out of a video file instantly and losslessly using ffmpeg's -vn stream-copy trick.
Run ffmpeg -i movie.mp4 -vn -c:a copy audio.m4a to save the video's audio as a standalone .m4a file without re-encoding.
01Command
Command
$ ffmpeg -i movie.mp4 -vn -c:a copy audio.m4a02What it does
-vn tells ffmpeg to drop the video streams entirely, and -c:a copy moves the existing audio track into the new file byte-for-byte, so extraction runs at disk speed with zero quality loss. Choose the extension to match the source audio: .m4a for AAC audio (most phone and camera videos), or add -c:a libmp3lame with an .mp3 output if you specifically need MP3. If the copy fails with a container error, the codec doesn't suit that extension — transcode instead with -c:a aac.
03Risk
!Warning: Stream copy is lossless but inflexible — if the source audio is an unusual codec your player can't handle, re-encode (e.g. -c:a aac) rather than renaming the file.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- ffmpeg DocumentationEvidence: The documentation states that '-vn / -an / -sn / -dn options can be used to skip inclusion of video, audio, subtitle and data streams respectively' and documents -c:a as the per-stream audio codec option, which with copy reuses the existing audio stream.
- FFmpeg FAQEvidence: The FAQ mentions -vn as the option that drops video when producing an audio-only output file.
Last verified: 2026-09-19 · Category: Media