Shell tricks: extract audio from mp4 in Ubuntu

Posted by

I was out at a fantastic show yesterday and recorded video with my phone. The audio was great, the video not so much. So, how to extract the audio from the MP4?

Approach 1:

sudo apt-get install gpac
MP4Box -add infile.mp4#audio outfile.m4a

Approach 2:

sudo apt-get install ffmpeg
fmpeg -i /PATH/TO/INPUT.mp4 /PATH/TO/OUTPUT.mp3

In Ubuntu 14.04, ffmpeg is a bit of a pain to install, so we can use avconv instead:

sudo apt-get install avconv
ffmpeg -i /PATH/TO/INPUT.mp4 /PATH/TO/OUTPUT.mp3

GoSaBe Blog - Jan 7, 2015 | Linux