Extracting audio from 3gp files using ffmpeg

Extracting audio from a 3gp video file recorded on an Android phone (this was tested on a video file recorded on Google Nexus One running Gingerbread).

First find out what audio format is present in the file:

ffmpeg -i VID_20110518_184415.3gp
.
.
Stream #0.0(eng): Audio: aac, 16000 Hz, mono, s16, 96 kb/s

Turns out, the audio encoded as .aac. Here’s what can be done next:

1. Don’t transcode the audio just extract the audio track as it is:

ffmpeg -i VID_20110518_184415.3gp -vn -acodec copy clarinet.aac

2. Extract audio and transcode it to mp3 at 64kbps:

ffmpeg -i VID_20110518_184415.3gp -vn -acodec libmp3lame -ab 64k clarinet.mp3

3. Extract audio and transcode it to ogg at medium quality:

ffmpeg -i VID_20110518_184415.3gp -vn -acodec libvorbis -aq 50 clarinet.ogg

This can be handy if you want to embed the file using the new HTML5 audio tag. e.g.

<audio controls>
  <source src="clarinet.ogg"/>
  <source src="clarinet.mp3"/>
</audio>

With a lot of help from: http://howto-pages.org/ffmpeg/

Viewing 1 Comment

    • ^
    • v

    This was awesome and worked perfectly on video from my Droid Incredible 2. Thanks for figuring this out. You can extract a 3gp to a wav file too, with the following command:

    ffmpeg -i myvideo.3gp -vn -acodec pcm_s16le -ar 44100 -ac 2 mywave.wav

    Anyone out there reading this, don't waste your time with AoA Audio Extraction. That thing is a piece of junk that will distort your audio. The above technique works perfectly. Of course, downloading an installing ffmpeg is a bit of an intimating process if you're not well versed in the world of open source development. But if you're heart is really set on editing together a silly movie that you shot on your Android phone, stick with it!  

 
close Reblog this comment
blog comments powered by Disqus