Sunday, February 3, 2013

How to extract the audio from video files using ffmpeg

Here's how to extract the audio portion of a video using ffmpeg:
    ffmpeg -i yourvideofile.mp4 -vn -ac 2 -ar 44100 -ab 320k -f mp3 audioonly.mp3
If you didn't want to reencode it in mp3, it's even simpler:
    ffmpeg -i yourvideofile.mp4 -vn -acodec copy audioonly.origformat
I do this for a lot of the videos on online education sites like Coursera.

No comments: