Extract audio from video file

Extract audio from MP4 video file and save it as MP3 audio file:

  • avconv -i filename.mp4 -vn -ar 44100 -ac 2 -ab 128k -f mp3 filename.mp3

Quick and dirty way to extract audio from all video files in the directory:

  • for i in *.mp4; do myname=`basename “$i”`; avconv -i “$i” -vn -ar 44100 -ac 2 -ab 128k -f mp3 “$myname.mp3”; done

If you copy and paste this code and it does not work, please check the back tick and quotation marks. they normally get “spoiled” when copying HTML.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.