Saturday, July 23, 2011

ffmpeg - rip the audio track from a video file

i've been toying around with ripping the audio track from a video file and mplayer just wasn't living up to the job. i have used ffmpeg in the past but hadn't recently so i took a look at the man page and found i could accomplish this task very easily in one line with a pipe to lame.

matthew@hufflepuff:~$ ffmpeg -i video.mp4 -f wav - | lame -V 3 - audio.mp3

this takes video.mp4 and dumps the audio track in wav format then pipes it to lame and creates an mp3 of the dump. sweet.