Tales From The Geek Side

The geeky musings of Greg Rowe.

Extracting Audio From Video

June 20th, 2008 by greg

I recently came across some some excellent concert footage. I wanted to have the performance available on my mp3 player but I didn’t want to re-encode the audio. Ffmpeg came to the rescue.

Using ffmpeg you can split out the audio and video components of any video stream it understands. In fact you can tell ffmpeg to transcode the audio as well. In my case the audio was already in mp3 format so I didn’t want to transcode. Ffmpeg allows you to specify “copy” as an output format in which case it doesn’t modify the audio stream in any way.

To extract the audio I ran the following. The -vn switch instructs ffmpeg to omit the video stream. The default behavior would be to output a video stream as well as audio streams. The -acodev switch tells ffmpeg what format you want the audio stream to be output as. In my case I didn’t want it transcoded so I specified “copy.”

$ ffmpeg -i slayer-rock-am-ring-2007.avi -vn -acodec copy slayer-rock-am-ring-2007.mp3

Now I just need to find a tool to break mp3s into audio tracks without re-encoding.

References:
http://howto-pages.org/ffmpeg/#strip

This entry was posted on Friday, June 20th, 2008 at 7:44 am and is filed under Geek, Tips. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply

You must be logged in to post a comment.