Showing posts with label Tutorial. Show all posts
Showing posts with label Tutorial. Show all posts

Thursday, May 15, 2008

The Chronicles of All for 1 Multimedia Player (Part 2 - VLC + amr codec)

I'll skip the Mplayer's installation story because of I don't need it while I got VLC running smoothly but will consider to post if I got a request (It's 5 min to 4.00 a.m damn it !! I need to finish it up fast!!).

Now the story continue ...

1. Get the VLC latest source (as for now the version is vlc-0.8.6f)
wget http://download.videolan.org/pub/videolan/vlc/0.8.6f/vlc-0.8.6f.tar.gz

2. Extract the source code and change to the extracted directory
root@watthafxk-pc:~# tar zxvf vlc-0.8.6f.tar.gz

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

root@watthafxk-pc:~# cd vlc-0.8.6f
root@watthafxk-pc:~/vlc-0.8.6f#


3. Get the all the library that needed for build VLC
root@watthafxk-pc:~/vlc-0.8.6f# apt-get build-dep vlc


This is the trickiest part, when I run ./configure I got this following error message
root@watthafxk-pc:~/vlc-0.8.6f# ./configure

--------------cut----- snip-------cut--------------

checking for libavcodec.a in /root/ffmpeg... no
configure: error: cannot find libpostproc.a in /root/ffmpeg/libavcodec/libpostproc/.
Make sure you configured ffmpeg with --enable-pp
root@watthafxk-pc:~/vlc-0.8.6f#
noted: for vlc version 0.8.6f --enable-pp was replaced by --enable-postproc. It's a must when you configure ffmpeg with --enable-gpl.

what the fxck ? need to compile ffmpeg again ? hmm ... I check the the missing library file 1st
root@watthafxk-pc:~/vlc-0.8.6f# find / -name 'libpostproc.a' -type f -print 2> /dev/null
/usr/lib/libpostproc.a
root@watthafxk-pc:~/vlc-0.8.6f#

The library file is in /usr/lib/. I need to tell configurator the location of the library (set the flag for the library). Then I try to run ./configure again
root@watthafxk-pc:~/vlc-0.8.6f# export LDFLAGS_ffmpeg="-lfaad -la52 -lmp3lame -lamrnb -lamrwb"
root@watthafxk-pc:~/vlc-0.8.6f# ./configure

---------yada--------no error------------yada----------



Then 2nd last stage is "make"
root@watthafxk-pc:~/vlc-0.8.6f# make

---------yada----------pray for no error----------yada----------
make[2]: Leaving directory `/root/vlc-0.8.6f/doc'
make[1]: Leaving directory `/root/vlc-0.8.6f'
root@watthafxk-pc:~/vlc-0.8.6f#

YEAH BEBEH !! SUKSES!! SUKSES!! and we can install it !!

root@watthafxk-pc:~/vlc-0.8.6f# make install

-------yada--------------yada----------yada-----
make[2]: Leaving directory `/root/vlc-0.8.6f/doc'
make[1]: Leaving directory `/root/vlc-0.8.6f'
root@watthafxk-pc:~/vlc-0.8.6f#


We can try playing 3GP file
achikjep@watthafxk-pc:~$ vlc test.3gp
VLC media player 0.8.6f Janus
[00000281] main playlist: stopping playback
achikjep@watthafxk-pc:~$

It can play with sound now !! I've tried with various types of media file such as mp3, wmv, mkv and such with no problemo.

Hope you all will be lucky as me ... chow !!

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 ...