Wednesday, May 14, 2008

The Chronicles of All for 1 Multimedia Player (Part 1 - ffmpeg)

That RealPlayer installation issue really piss me off. I don't know is it bugged or not compatible with 64 bit architecture. I don't even want to think about it. All I need is my 3gp's file can be play with sound.

This is the 1st time I have to make my hands dirty in Ubuntu. I though as Ubuntu's user I just can install all the packages (either using apt-get , aptitude , dpkg , Install and Remove Applications or Synaptic Package Manager).

I've managed to compile mplayer with ffmpeg for solving the "amr codec" issue (for most of 3gp audio) based on severals tutorial that I found while googling. That's hell of pains because I need to try multiple ways based on multiple tutorials to compile with succeed (yes I'm a noob at compiling).

After that I have a thought "Hey, why not I try to compile vlc player with that ffmpeg ?". Then I ask my guru for the guide (google of course) but no luck ... sigh

I'm still in the mood of dirty hands so I try it a little bit by bit. Learning from errors is a good training for you.

The story begins ...

1st of all, I compile ffmpeg with libavcodec (the leading audio/video codec library) to support MP3 and AMR based on tutorial from Chez Mattiouz's blog. Thanx :)~ (FYI I tried a several guides from others, but your's the only way that I manage to succeed compiling with mplayer and vlc)

1. Fire up the terminal and then get into root shell environment
achikjep@watthafxk-pc:~$ sudo -i
[sudo] password for achikjep:
root@watthafxk-pc:~#

2. Get the latest sources from LAME MP3 official site, as for now the latest beta version is lame-3.98 beta 8.
wget http://optusnet.dl.sourceforge.net/sourceforge/lame/lame-3.98b8.tar.gz

3. Extract the source code and change to the extracted directory
root@watthafxk-pc:~# tar zxvf lame-3.98b8.tar.gz

------yada-yada------*cut*------yada-yada------

root@watthafxk-pc:~# cd lame-3.98b8
root@watthafxk-pc:~/lame-3.98b8#

4. Configure and install
root@watthafxk-pc:~/lame-3.98b8# ./configure

-------------------if no error-----------------------

root@watthafxk-pc:~/lame-3.98b8# make && make install


5. Check the AMR Codec Library site for latest version of amrnb and amrwb and grab them, as for now the lates version of amrnb is 7.0.0.1 and for amrwb is 7.0.0.2
root@watthafxk-pc:~/lame-3.98b8# cd ~
root@watthafxk-pc:~# wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.1.tar.bz2

------------------- cut cut cut -------------------------

root@watthafxk-pc:~# wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.2.tar.bz2

6. Extract amrnb, configure and install
root@watthafxk-pc:~# tar xvjf amrnb-7.0.0.1.tar.bz2
root@watthafxk-pc:~# cd amrnb-7.0.0.1
root@watthafxk-pc:~/amrnb-7.0.0.1# ./configure && make && make install


7. Extract amrwb, configure and install
root@watthafxk-pc:~/amrnb-7.0.0.1# cd ~
root@watthafxk-pc:~# tar xvjf amrwb-7.0.0.2.tar.bz2
root@watthafxk-pc:~# cd amrwb-7.0.0.2
root@watthafxk-pc:~/amrwb-7.0.0.2# ./configure && make && make install

8. Make sure that that your /etc/ld.so.conf includes the directory where these 3 libraries just got installed (usually its /usr/local/lib).
root@watthafxk-pc:~/amrwb-7.0.0.2# cd ~
root@watthafxk-pc:~# cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf

root@watthafxk-pc:~#

Mine didn’t so I had to add it to /etc/ld.so.conf.d/ffmpeg.conf and run "ldconfig"
root@watthafxk-pc:~# echo /usr/local/lib > /etc/ld.so.conf.d/ffmpeg.conf
root@watthafxk-pc:~# cat /etc/ld.so.conf.d/ffmpeg.conf
/usr/local/lib
root@watthafxk-pc:~# ldconfig
root@watthafxk-pc:~#

10. Get the ffmpeg source from SVN repository, but you need "subversion" package installed in your system
root@watthafxk-pc:~# svn
The program 'svn' is currently not installed. You can install it by typing:
apt-get install subversion
-bash: svn: command not found
root@watthafxk-pc:~# apt-get install subversion

----------------snip snip snip---------------------------

root@watthafxk-pc:~# svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

11. Configure ffmpeg and make, if you got no error you can proceed to install
root@watthafxk-pc:~# cd ffmpeg
root@watthafxk-pc:~/ffmpeg# ./configure --enable-libamr_nb \
--enable-libamr_wb --enable-libmp3lame --enable-nonfree \
--enable-postproc --enable-gpl

------------------- if no error -----------------------

root@watthafxk-pc:~/ffmpeg# make

------------------- if no error -----------------------

root@watthafxk-pc:~/ffmpeg# make install
noted: notice --enable-gpl ? You can refer here. I'm scared if it's true because of VLC really need that when compiled with ffmpeg


There you go !! now we got ffmpeg that supporting MP3 and amr codec

But ... what the fxck !! This page is getting longer !!

to be continue ...

No comments: