- the ffmpeg from Ubuntu repositories does not suppport AMR
- ffmpeg dropped support of libamr as it used to have - now they use lib-opencore-amr
Following this how-to by FakeOutdoorsman, I downloaded x264 sources (why not? let's compile to support as many formats as possible), compiled it, and downloaded ffmpeg source code:
1. Make sure you don't have any of this installed from ubuntu:
sudo apt-get purge ffmpeg x264 libx264-dev
2. Download and compile x264: (You may need to install some build tools -- see the original how-to if you don't have them)
cd
git clone git://git.videolan.org/x264.git
cd x264
./configure
make
sudo checkinstall --fstrans=no --install=yes --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1" --default
3. Get libopencore-AMR-NB and libopencore-AMR-WB from DebianMultimedia. These are the urls for i386 and amd64. Download the four files libopencore-amr*, and install them with dpkg -i
4. Download, configure and build ffmpeg. Note that the ./configure step is different than the one in the mentioned how-to -- it adds the flags for AMR.
cd
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-nonfree --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3
make
sudo checkinstall --fstrans=no --install=yes --pkgname=ffmpeg --pkgversion "3:0.svn`date +%Y%m%d`-12ubuntu3" --default
And it's done! I am now able to transcode my files to mp3:
ffmpeg -i test.amr -f avi -vcodec xvid -acodec libmp3lame -ar 22050 test.mp3
Now if later you want to remove these packages, remove ffmpeg, x264 and the four libopencore-amr* we have installed. And also, if you ever want to upgrade with a newer source code, see the original post; they instructions are there (I have not tested that yet).
Thank you very much!
ReplyDeleteThis helped me a lot.
It works fine with Ubuntu 9.04 and 9.10!
ReplyDeleteAlso, it is necessary to install these packages before compiling x264 and ffmpeg, all available through Ubuntu repositories:
- checkinstall
- yasm
- libfaad-dev
- libfaac-dev
- libmp3lame-dev
- libtheora-dev
- libxvidcore4-dev
One more thing:
ReplyDeleteKarmic has the libopencore-amr* packages in its repositories.
They work fine.
That's great! I am about to install Karmic (not upgrade-- my ubuntu install got fat over the years and upgrades) so hopefully I will not have to resort to this trick. Thank you for all your comments!
ReplyDelete