Originally published at ffmpeg-micro.com
You recorded a webinar, a YouTube video, or a product demo. Now you need the audio track as a standalone file. Maybe you're repurposing video content as podcast episodes. Maybe your app needs to strip audio from user uploads for transcription. FFmpeg handles this in a single command, but getting the codec and container options right takes some trial and error.
How to Extract Audio from Video with FFmpeg
The core command is simple. The -vn flag tells FFmpeg to drop the video stream, and you specify the output format through the file extension or codec flag.
ffmpeg -i input.mp4 -vn -c :a libmp3lame -b :a 192k output.mp3
Enter fullscreen mode
Exit fullscreen mode
This extracts the audio from input.mp4 , re-encodes it as MP3 at 192 kbps, and writes output.mp3 .…