Converting Android 1.5 “Camcorder” videos with SAMR audio codec on Ubuntu Jaunty with ffmpeg

Written by  on June 2, 2009

So, T-Mobile pushed the Android 1.5 update to me last Sunday (I think).  I installed it and subsequently had to record a video with the new Camcorder application.  It works well; but produces videos with the audio track in AMR format.  The standard ffmpeg distributed with Ubuntu doesn’t have AMR compiled in because the AMR codec isn’t liberated/free.  I followed Chez’ instructions with a few modifications to get a tweaked ffmpeg that will convert videos recorded with my G1 phone.

  • Run the standard ffmpeg to get the configure options used to compile it.
  • apt-get install libmp3lame-dev libgsm1-dev libshroedinger-dev libspeex-dev libtheora-dev libvorbis-dev libdc1395-22-dev.
  • Download, unpack, configure [--prefix=/usr/local/amr], make && make install both libamr-nb and -wb.
  • svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg-2009-06-02.
  • configure [*], make && make install ffmpeg.
  • export LD_LIBRARY_PATH=/usr/local/amr/lib:/usr/local/ffmpeg/lib:$LD_LIBRARY_PATH
  • /usr/local/ffmpeg/bin/ffmpeg -i video.3gp -ar 44100 vide.mpg

[*] I ended up using the following configure command for ffmpeg:
./configure –enable-gpl –enable-postproc –enable-x11grab –prefix=/usr/local/ffmpeg –enable-avfilter –enable-avfilter-lavf –enable-libgsm –enable-libschroedinger –enable-libspeex –enable-libtheora –enable-libvorbis –enable-pthreads –disable-stripping –enable-libdc1394 –disable-armv5te –disable-armv6 –disable-armv6t2 –disable-armvfp –disable-neon –disable-altivec –disable-vis –enable-shared –disable-static –enable-libamr-nb –enable-libamr-wb –enable-nonfree –extra-cflags=-I/usr/local/amr/include –extra-ldflags=-L/usr/local/amr/lib