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

Sunday, May 11, 2008

Welcome Ubuntu (Part 2)

The installation process is going smoothly and almost hassle free (refer here for instruction). Very user friendly, everything next ... next ... next ... not sure can go back ... next ... finish and reboot !! I remember my 1st experience installing linux, using RedHat in late 90's (most user friendly at that time) I'm stuck at creating partition. If I'm not mistaken there was no auto creating partition option in that time.

Back to the topic, finish installing the packages and some required setting (timezone, hostname, ip, username and yada-yada), reboot and voila !! Ubuntu is using Gnome as desktop, the system requesting for autoupdate for various packages. There a popup message that give instruction for enable the sytem to install my graphic card driver. I follow the instruction "click System -> Administration -> Hardware driver -> Enable restricted driver". Then the driver automatically installed.

This is good, I dont need to make my hands dirty at the 1st day of using Ubuntu.

I'm playing around the desktop to make myself familiar with the interface.

I open up the terminal

sudo ps ax

to checked the default process and wow !! compiz is run by default. This is good. I googling around to find how to setting up and manage the compiz (I'm crazy about the 3D desktop thingy). I need to install compiz config setting manager.

sudo apt-get install compizconfig-settings-manager

And then I click System > Preferences > Advanced System Effects Settings. There are several plugins installed and running, I just need to add Desktop Cube and Rotate Desktop. By googling around I found a keyboard shortcut for compiz fusion

Desktop Effects Keyboard Shortcuts
Rotate Cube Mousewheel on Desktop
Switcher Alt + Tab
Shift Switcher Super + Tab (2 modes: flip and cover)
Ring Switcher Super + Tab - overrides Shift Switcher
Expo Super + E (toggle)
Film Effect Ctrl + Alt + Down Arrow4
Rotate Cube Manually Ctrl + Alt + Left Mouse Button
Scale Windows Alt + Shift + Up Arrow
Show/Clear Desktop Ctrl + Alt + D (toggle)
Snapping Windows Move a window across workspaces5
Screenshot Super + Left Mouse Button
Zoom In/Out Super + Mousewheel
Transparent Window Alt + Mousewheel
Resize Window Alt + F8
Move Window Alt + F7
Add Helper Super + P
Widget Layer F9 (toggle)
Water Effects Shift + F9 (toggle)
Fire Effects: On Super + Shift + Left Mouse Button
Fire Effects: Clear Super + Shift + C
Annotate: Draw Super + Left Mouse Button
Annotate: Start Super + 1
Annotate: End Super + 3
Group: Select Window(s) Super + S
Group: Group Windows Super + T
Group: Ungroup Windows Super + U
Group: Flip Windows Super + Right or Left Arrow
Note: Super key = Windows icon key

After playing around with the effects, I'm entering my previous NTFS partitions (Note: This machine is dual boot with WinXP and got 2 NTFS partition) and tried play HD Movie with default movie player which is Totem. Wow no problemo !! MP3's file running with Rhytmbox Music Player. What I love is I can preview the MP3's sounds by pointing the mouse pointer to the MP3 files at File Browser !!

Then I tried play 3gp files. Video is ok but no sound. Hmm ... tried using command line to find out what's the problem and this is the output

watthafxk@watthafxk-pc:~$ totem watthafxk.3gp
** Message: don't know how to handle audio/AMR, codec_data=(buffer)0000001164616d72533630200081800005, rate=(int)8000, channels=(int)1
** Message: Missing plugin: gstreamer|0.10|totem|Adaptive Multi Rate (AMR) decoder|decoder-audio/AMR (Adaptive Multi Rate (AMR) decoder)
no application found
** Message: No installation candidate for missing plugins found.
watthafxk@watthafxk-pc:~$

** Message: No installation candidate for missing plugins found. This is not good. Googling around to find other 3gp's compatible player. Yeah !! RealPlayer will be my saviour. I downloaded the installation file and run the command as in instruction at several forums and blogs

watthafxk@watthafxk-pc:~$ chmod a+x RealPlayer11GOLD.bin
watthafxk@watthafxk-pc:~$ ./RealPlayer11GOLD.bin
bash: ./RealPlayer11GOLD.bin: No such file or directory
watthafxk@watthafxk-pc:~$ sudo ./RealPlayer11GOLD.bin
[sudo] password for watthafxk:
sudo: unable to execute ./RealPlayer11GOLD.bin: No such file or directory
watthafxk@watthafxk-pc:~$


What the fxck !!

Then I googling around about mplayer, still problem with amr ... what the fxck

Trying to get info about vlc player then I found this

samr is the FourCC for AMR (Adaptive Multi-Rate) audio. It is not supported in VLC due to licensing issues. VLC can be compiled with AMR (using FFmpeg compiled with it) however this is not compatible with the GPL due to software patents. - Source


WHAT THE FXCK !!

to be continued ?

Thursday, May 8, 2008

Welcome Ubuntu (Part 1)

After I got new portfolio for my job, I don't have time to spend at games anymore. Yes I was hardcore at gaming especially online games, so I decide uninstall a couple of games that takes around 25GB of hard disk space.

Hey I got more free space now and no more gaming, so I decided to use linux as my "main personal OS" because of needs (from my job) to do research, development, coding and yada-yada.

My rig is running on AMD 64-bit dual core and using NVIDIA 7900 GTO graphic card and after googling around I found that Ubuntu might be fulfill my needs. While waiting for downloading ISO by so called " bandwidth provider that give you an unsurpassed Internet experience" (refer here) to finish, I shrunk my NTFS partition using GParted LiveCD to give space for Ubuntu.

Burn the ISO (ubuntu-8.04-desktop-amd64.iso) and boot it up ...

What the fxck ??!!

to be continued ........

Wednesday, May 7, 2008

what the fxck ??!!

This is my 1st attempt to write this such thing (blogging) even though I've been lurking around the net since "once upon a time" ago. I'm not trying to be a "blog whore" but just want to make a personal notes and sharing a knowledge on any interesting things that happen in my life.

What the fxck is "blog whore" ??!! I can't answer that and "University of Google" seems cant give the answer too.

What the fxck ??!! "blog whore" not in wikipedia too ??!!

sigh, someone need to be a contributor there