Friday, January 11, 2008

ffmpeg with AMR (nb & wb), lame, FAAC and FAAd codec.

Below is how I have installed and used ffmpeg to convert avi and wmv files to 3gp format so that I can store and play them in my mobile phone. I have a very rough guide, but hope that will help you in understanding more about the procedure by doing your own research. Consider the below scribble as a pointer to get things started. Now that being said, lets get started..

Download the source for amr_nb (nb stands for narrow band; amr is for the 3gp support). If you can find the sources for both you can use both of them. I was not able to find the source for amr_wb and at last I had to beg in irc://irc.freenode.net (#ffmpeg) to get the source from a fellow who had it uploaded in some file sharing site for me.

For mp3 support, get the lame codec from sourceforge

Download faac, faad2 from sourceforge.net and get them installed.

get the amr and lame codecs compiled and installed.

Get the source for ffmpeg from the svn or search for the tarball.

svn://svn.mplayerhq.hu/ffmpeg/trunk

Get things going with the configure, make & make install.

./configure --enable-libmp3lame  --enable-libvorbis --enable-libamr-nb --enable-libamr-wb --enable-gpl --enable-libfaac --enable-libfaad --enable-shared

voila.. you are ready to convert video files for your mobile ~smile~

Below is the way I use ffmpeg to convert. Figuring out the options for ffmpeg is your job (hint: man ffmpeg)

./ffmpeg -i /home/old_desktops/sabarish.old/laptop_backup/Azureus\ Downloads/Kylie\ Minogue\ -\ Spinning\ Around\ \(xvid\ K-rip\).avi -f 3gp -vcodec mpeg4 -acodec faac -ar 8000 -ac 1 -ab 12.2k -y Kylie.3gp

I have used options, -acodec libamr_wb also but had some issues with the sound in the video, so rolled back using faac audio codecs. You can experiment around and use the best to get things done.

5 comments:

Fahiec.com said...

Do you know how to get VP7 codec works with FFMPEG?

kryptoz said...

I am sorry Fahiec[dot]com, but I was never in need for it so far. If I ever give a try, I will update here.

sandy said...

I'm playing with the convertions regarding ffmeg. basically, my goal is to convert an avi file into a 3gp which will be streamed using darwin streaming server.

I've been playing with the setup for almost a week now but I didnt have any luck at all. File is being converted but streaming is not.

Hope you might have some idea about this.

kryptoz said...

I haven't used darwin for any content streaming as yet. I guess you can get help on it from here --> "http://lists.apple.com/mailman/listinfo/streaming-server-users", if you'd be more specific about the problem you are facing !

jj said...

"get the amr and lame codecs compiled and installed."

Could you elaborate on that? I can't get the amr codecs installed.