LinHES Forums
http://forum.linhes.org/

HOWTO: compile mplayer on R5.5 - UPDATE 05-Mar-2009
http://forum.linhes.org/viewtopic.php?f=11&t=4706
Page 1 of 7

Author:  graysky [ Fri May 27, 2005 7:00 pm ]
Post subject:  HOWTO: compile mplayer on R5.5 - UPDATE 05-Mar-2009

Update: 05-Mar-2009: First off, this thread really only applies to R5.5 since cesman and the dev team have already made up-to-date packages for mplayer for R6. Secondly, I decided to update the guide since the stable release of mplayer, as of 05-Mar-09 anyway, is quite dated and folks will likely want the latest/greatest features and bug fixes in their mplayer. Features like VDPAU for example. Don't worry, the "old" version of the guide can be found at the bottom of this post.

If you are interested in using the VDPAU features in mplayer, be sure to check out this post for a killer wrapper script that handles the file-type/codec flags automatically.

We'll be compiling from the daily subversion snapshot as is recommended on the mplayer webpage.

Note that there shouldn't be a need to re-compile under R6. Cesman has mplayer-vdpau enabled packages already.

Compiling mplayer on R5.5
:!: I take no responsibility for damages etc. to your system and am providing this strictly as information. That said, it worked for me on several different R5.5 machines.

READ THIS FIRST: Like most LINUX stuff, if you see a command run from $ it's run by the mythtv user. If you see one run from the # it's run from the root user. The sections displayed in the "code" boxes below can literally be copy/pasted into your ssh window assuming you're accessing your mythbox from another machine as you're reading this.

:arrow:Open up a shell as user mythtv. I'm assuming you're in your home dir (cd ~)

Download the codec pack:
Code:
$ wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2


Now make a dir for the codecs, unpack them there, and remove the unneeded dir:
Code:
# mkdir /usr/lib/codecs ; tar -xjf essential-20071007.tar.bz2 ; mv ./essential-20071007/* /usr/lib/codecs/ ; rmdir essential-20071007


You'll need git to get the x264 updates assuming you want to playback x264 files. Get it like this:
Code:
# apt-get install git-core


Now let's get the latest mplayer svn and compile it:

Code:
$ cd ~
$ mkdir mplayer-svn ; cd mplayer-svn
$ svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
$ cd mplayer
$ git clone git://git.videolan.org/x264.git
$ ./configure --prefix=/usr --enable-menu --disable-mencoder
$ make -j2


If you have a dual or quad core CPU, use 'make -j3' for a dual and 'make -j5 for a quad' instead of make -j2 (for single core systems). For more of multithreaded make commands, see this thread.

Note: if you have a VDPAU enabled video card, the ./configure step should automatically detect it and activate that option assuming you have the v180.x driver installed! You can simply download the official nvidia package for your card from their website. Know that you WILL run into problems upon a reboot; see this thread to fix them.

Depending on your CPU, the make step may take a while... it took a good 8 minutes on my Athlon XP 3200+ (2.20 GHz).

Remove the version of mplayer that comes with R5.5 by issuing this following command:
Code:
# dpkg -r mplayer


...and install mplayer you just compiled
Code:
# make install


You can check to see that the thing got updated correctly by doing a "mplayer -version" like so:
Code:
$ mplayer | grep SVN
MPlayer SVN-r28868-4.2.3 (C) 2000-2009 MPlayer Team


The 'SVN-r28868' is the version of mplayer and the '4.2.3' is the version of gcc that was used to compile it.

----- OLDER VERSION OF POST - 09-Aug-08

Instructions For R5.5
This is the procedure I used to -downgrade- mplayer from the development version that comes with R5.5 to the current stable version because I had playback issues with it. When I started watching a file, mplayer would display a black screen for about 5-10 sec, then dump me back to my video list. It seemed to work the 2nd time I tried. Anyway, I used the following procedure to remove the development mplayer, and replace it with the "stable" release.

:!: I take no responsibility for damages etc. to your system and am providing this strictly as information. That said, it worked for me on several different R5.5 machines.

READ THIS FIRST: Like most LINUX stuff, if you see a command run from $ it's run by the mythtv user. If you see one run from the # it's run from the root user. The sections displayed in the "code" boxes below can literally be copy/pasted into your ssh window assuming you're accessing your mythbox from another machine as you're reading this.

:arrow: Get started by downloading the following files from http://www.mplayerhq.hu
essential-20071007.tar.bz2
MPlayer-1.0rc2.tar.bz2


(These are current as of 09-Aug-2008.)

Download the files:
Code:
$ wget http://www3.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2 ;  wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2


Now make a dir for the codecs, unpack them there, and remove the unneeded dir:
Code:
# mkdir /usr/lib/codecs ; tar -xjf essential-20071007.tar.bz2 ; mv ./essential-20071007/* /usr/lib/codecs/ ; rmdir essential-20071007


Now unpack and configure the new mplayer
Code:
$ cd /home/mythtv
$ tar -xjf MPlayer-1.0rc2.tar.bz2 ; cd MPlayer-1.0rc2


Now configure it. Here are some suggested options:

Code:
$ ./configure --prefix=/usr --disable-ivtv --enable-largefiles --enable-menu


Note: The only required switches are --prefix=/usr and --disable-ivtv (the ivtv line is needed with R5.5 in my experience or else your make step will fail).

The enable-largefiles swtich allows you to play files >2 GB (DVD rips maybe?). Using the enable-menu allows for the OSD menu to work. This isn't the DVD menu. See the docs for more on this.

If you have an nVidia card, and you use mplayer to watch MPEG-2 streams (like VOB files from ripped DVDs). You can add in XvMC support which is disabled by default:

Code:
$ ./configure --prefix=/usr --disable-ivtv --enable-largefiles --enable-menu --enable-xvmc --with-xvmclib=libXvMCNVIDIA


XvMC on my Athlon XP 3200+ lowered the CPU usage to decode a 720x480 VOB by 30-40 % when compared to the xv output which is nice. The downside is that you have to implicitly tell mplayer to use xvmc when you watch MPEG-2 streams like this:
Code:
$ mplayer -fs -zoom -vo xvmc -vc ffmpeg12mc FILENAME.VOB


You really can't do it from mythfrontend unless you change the mplayer setup options. It should be noted that if you attempt to play video content that isn't MPEG-2 while using the xvmc driver, you won't get a video stream at all.

Finaly, if you will NOT transcode (i.e. ever use mencoder), you can add the --disable-mencoder switch to the ./configure line as well.

There are many other options you can enable/disable at the ./configure step. See ./configure --help and google for others. If you use the two above and haven't messed with R5.5 very much, you shouldn't get any errors.

Code:
$ make


If you complete the make without errors, go ahead and remove the development version that comes with R5.5 by issuing this following command:
Code:
# dpkg -r mplayer


Finally, install mplayer you just compiled
Code:
# make install


Depending on your CPU, the make step may take a while... it took a good 5 minutes on my Athlon XP 3200+ (2.20 GHz).

You can check to see that the thing got updated correctly by doing a "mplayer -version" like so:
Code:
mythtv@mythtv:~$ mplayer  -version


Mine returned this:
Code:
$ mplayer -version
MPlayer 1.0rc2-4.2.3 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) XP 3200+ (Family: 6, Model: 10, Stepping: 0)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE


If you use xscreensaver, the SVN version of mplayer that came with R5.5 would have very likely modded your /home/mythtv/.mplayer/config with a line to disable the screensaver while you're watching a video. Version 1.0-rc2 of mplayer uses a different line therefore comment out the heartbeat line and add the following one to disable the screensaver when you're using the version of mplayer you just compiled:
Code:
stop-xscreensaver = 1


Here in my .mplayer/config in its entirety:
Code:
monitoraspect=1.33333333333333
stop-xscreensaver = 1
#heartbeat-cmd="xscreensaver-command -deactivate > /dev/null"
subfont-autoscale=1
font=subfont.ttf


On a related note, if you wish to have brightness/contrast/saturation controls available to you when playing a video, you'll need to edit your

Video>Player Settings to have a -vf eq2. Here is mine:

Code:
Default Video Player: mplayer-resume.pl -fs -zoom -vo xv -vf eq2 %s


Related posts you may find of interest:
Read this howto if you want to make mplayer automatically resume videos exactly where you left off watching them. This is now the default with a R5.5 box.

Ethernut posted a guide for those of you who are experiencing problems with DTS audio and mplayer here.

Author:  khrusher [ Sat May 28, 2005 8:31 pm ]
Post subject: 

Just curious, is there a feature or reason to do this?

Author:  jbman [ Sat May 28, 2005 9:46 pm ]
Post subject: 

so you can play more file formats

Author:  brendan [ Sat May 28, 2005 10:14 pm ]
Post subject: 

jbman wrote:
so you can play more file formats


Also, so you can switch DVD audio tracks on the fly (a new keyboard option in .pre7), instead of by modifying the one mplayer DVD launch setup line in the mythtv configuration screens every time you want to listen to, say, the commentary tracks.

-brendan

Author:  graysky [ Sun May 29, 2005 4:38 am ]
Post subject: 

In my case, I make my own xvid encoded video streams with ogg audio wrapped in an mkv or ogm container and they didn't play out-of-the-box. Plus, if you do a:

Code:
$ ./configure --help


You'll see additional options which you can add into your mplayer build. Also, if you're using a non AMD Athlon XP chip, compiling mplayer freshly will give you CPU specific optimizations (I'm pretty sure I read cesman compiled mplayer with an XP chip).

Author:  khrusher [ Sun May 29, 2005 6:58 am ]
Post subject: 

thanx, well beyond my mplayer usage.

Author:  graysky [ Sun May 29, 2005 8:32 am ]
Post subject: 

The only reason I could see you doing it would be to get the P4 optimized binary. Will that make a difference you can see? I don't know.

Author:  relder [ Wed Jun 01, 2005 11:37 am ]
Post subject: 

khrusher wrote:
Just curious, is there a feature or reason to do this?


In my case DVDs wouldn't play with the knoppmyth V5R15 stock mplayer, a new compile with latest mplayer code works great.

Author:  Luthair [ Tue Jun 07, 2005 8:33 pm ]
Post subject: 

I think it needs to be:
./configure --prefix=/usr

Otherwise it puts mplayer in /usr/local/bin instead of /usr/bin

Author:  lorenzanaj [ Mon Jun 27, 2005 12:36 am ]
Post subject: 

I am having problems after this update. I needed to update because mplayer didn't have dts support and it buzzed like crazy when playing Blade 3. Anyway I followed the howto ( included a a rpm --erase --nodeps mplayer-1.0-44-pre7.rhfc3.at but forgot the fonts but did that later) and now dts audio (had to also add libdts-dev-0.0.3-0.rpm) is good. But it left my mythfrontend w/ "Segmentation Fault".

I rebooted a few times. Then noticed my nvidia-settings were also causing a seg fault so i reinstalled those. I even went back to the orig mplayer i had from rpm but that didn't help. I even went ahead a double checked any common(?) files were tweaked by rpm --verify on all the myth packages but didn't find much here it is:


Code:
[root@localhost mythdead.autopsy]# less at-stablesrpms.out
package at-stabless is not installed
prelink: /usr/bin/fceu-sdl: at least one of file's dependencies has changed sinc
e prelinking
S.?.....    /usr/bin/fceu-sdl
package ivtv-0.2.0-68_rc3j.rhfc3.at.i386 is not installed
SM5....T    /lib/modules/HcwMakoA.ROM
.......T    /lib/modules/ivtv-fw-dec.bin
SM5....T    /lib/modules/ivtv-fw-enc.bin
package ivtv-kmdl-2.6.11-1.27_FC3-0.2.0-68_rc3j.rhfc3.at.i686 is not installed
prelink: /usr/lib/libmyth-0.18.1.so.0.18.1: at least one of file's dependencies
has changed since prelinking
S.?.....    /usr/lib/libmyth-0.18.1.so.0.18.1
prelink: /usr/lib/libmythtv-0.18.1.so.0.18.1: at least one of file's dependencie
s has changed since prelinking
S.?.....    /usr/lib/libmythtv-0.18.1.so.0.18.1
package mplayer-1.0-44_pre7.rhfc3.at.i386 is not installed
Unsatisfied dependencies for mythmkmovie-1.0.1-3.rhfc3.at.i386: /usr/bin/mencode
r
Unsatisfied dependencies for mythvideo-0.18.1-109.rhfc3.at.i386: mplayer
missing     /usr/lib/nvidia-graphics-1.0-4496/libGL.so.1
missing     /usr/lib/nvidia-graphics-1.0-4496/libGL.so.1.0.4496
missing     /usr/lib/nvidia-graphics-1.0-4496/libGLcore.so.1
missing     /usr/lib/nvidia-graphics-1.0-4496/libGLcore.so.1.0.4496
missing     /usr/lib/nvidia-graphics-1.0-4496/tls/libGL.so.1
missing     /usr/lib/nvidia-graphics-1.0-4496/tls/libGL.so.1.0.4496
missing     /usr/lib/nvidia-graphics-1.0-4496/tls/libGLcore.so.1
missing     /usr/lib/nvidia-graphics-1.0-4496/tls/libGLcore.so.1.0.4496
.......T    /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Tk/pTk/e
xtralibs.ld
prelink: /usr/bin/plaympeg: at least one of file's dependencies has changed sinc
e prelinking
S.?.....    /usr/bin/plaympeg
prelink: /usr/lib/libsmpeg-0.4.so.0.1.3: at least one of file's dependencies has
 changed since prelinking
S.?.....    /usr/lib/libsmpeg-0.4.so.0.1.3
missing     /usr/X11R6/lib/modules/extensions/libGLcore.a
missing     /usr/X11R6/lib/modules/extensions/libglx.a
missing     /usr/X11R6/lib/libGL.a
missing     /usr/X11R6/lib/libGL.so
....L...    /usr/lib/libGL.so


Not sure what it is. Can anyone help, here is my last couple line of strace. btw, I did check that I copied the fonts to /usr/local/share/mplayer/fonts

.. snip ..
Code:
open("/usr/share/fonts/KOI8-R/misc/resource.frk/fonts.dir", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/fonts/KOI8-R/misc/.resource/fonts.dir", O_RDONLY) = -1 ENOENT (No such file or directory)
munmap(0xb7f85000, 1101)                = 0
stat64("/usr/share/fonts/KOI8-R/misc/fonts.dir", {st_mode=S_IFREG|0644, st_size=1101, ...}) = 0
open("/usr/share/fonts/KOI8-R/misc/6x13s.pcf.gz", O_RDONLY) = 5
fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0
fstat64(5, {st_mode=S_IFREG|0444, st_size=5139, ...}) = 0
mmap2(NULL, 5139, PROT_READ, MAP_PRIVATE, 5, 0) = 0xb7f84000
close(5)                                = 0
munmap(0xb7f84000, 5139)                = 0
stat64("/usr/share/fonts/KOI8-R/misc/6x13s.pcf.gz", {st_mode=S_IFREG|0444, st_size=5139, ...}) = 0
open("/usr/share/fonts/KOI8-R/misc/fonts.alias", O_RDONLY) = 5
fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0
fstat64(5, {st_mode=S_IFREG|0444, st_size=5046, ...}) = 0
mmap2(NULL, 5046, PROT_READ, MAP_PRIVATE, 5, 0) = 0xb7f84000
close(5)                                = 0
mmap2(NULL, 425984, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7ef3000
munmap(0xb7ef3000, 425984)              = 0
open("/usr/share/fonts/KOI8-R/misc/._fonts.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/fonts/KOI8-R/misc/%fonts.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/fonts/KOI8-R/misc/.AppleDouble/fonts.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/fonts/KOI8-R/misc/fonts.alias/rsrc", O_RDONLY) = -1 ENOTDIR (Not a directory)
open("/usr/share/fonts/KOI8-R/misc/resource.frk/fonts.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/fonts/KOI8-R/misc/.resource/fonts.alias", O_RDONLY) = -1 ENOENT (No such file or directory)
munmap(0xb7f84000, 5046)                = 0
stat64("/usr/share/fonts/KOI8-R/misc/fonts.alias", {st_mode=S_IFREG|0444, st_size=5046, ...}) = 0
open("/usr/share/fonts/KOI8-R/misc/7x14Bs.pcf.gz", O_RDONLY) = 5
fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0
fstat64(5, {st_mode=S_IFREG|0444, st_size=4957, ...}) = 0
mmap2(NULL, 4957, PROT_READ, MAP_PRIVATE, 5, 0) = 0xb7f84000
close(5)                                = 0
munmap(0xb7f84000, 4957)                = 0
stat64("/usr/share/fonts/KOI8-R/misc/7x14Bs.pcf.gz", {st_mode=S_IFREG|0444, st_size=4957, ...}) = 0
getdents64(4, /* 0 entries */, 4096)    = 0
close(4)                                = 0
stat64("/usr/share/fonts/KOI8-R/misc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/share/fonts/default/ghostscript/fonts.cache-1", O_RDONLY) = 4
stat64("/usr/share/fonts/default/ghostscript", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/usr/share/fonts/default/ghostscript/fonts.cache-1", {st_mode=S_IFREG|0644, st_size=3764, ...}) = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=3764, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f85000
read(4, "\"bchr.pfa\" 0 \"Bitstream Charter:"..., 4096) = 3764
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0xb7f85000, 4096)                = 0
open("/usr/share/fonts/default/Type1/fonts.cache-1", O_RDONLY) = 4
stat64("/usr/share/fonts/default/Type1", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/usr/share/fonts/default/Type1/fonts.cache-1", {st_mode=S_IFREG|0644, st_size=26025, ...}) = 0
close(4)                                = 0
stat64("/usr/share/fonts/default/Type1", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
[root@localhost mythdead.autopsy]#


misc stats:

/usr/lib/libmythtv-0.18.1.so.0.18.1 has an old modified file date, and so were the other ones so i don't think it's those.

2.6.11.1-27_fc3
myth 0.18
nvidia 7174
ivtv 0.3.6.q

Thanks in advance, Jay

Author:  lorenzanaj [ Mon Jun 27, 2005 8:03 pm ]
Post subject: 

yippie. i'll answer my own post.

so i continued my search and ran a "find / -type f -mmin 720" to search for any files modified within the last 12 hrs. A bunch of files were tweaked but strace showed font stuff.

Putting 2n2 together I saw that ~/.fonts.cache-1 was tweaked so i copied it from some other dir i run myth from and whala (sp) it worked!!!

I'm so happy :)

Author:  RacerX [ Sun Jul 10, 2005 6:20 pm ]
Post subject: 

Thanks graysky

Today I was able to recompile Mplayer on my V4 myth box with your directions. Now I can play (Quicktime, Realplayer, Divx, and WMV) files right from the Video folder in Myth...

I really appreciate the help

One more thing I found a command to check if the codecs are installed correctly

Code:
mplayer -vc help



Thanks again

Author:  graysky [ Sat Sep 03, 2005 5:58 am ]
Post subject: 

@RacerX: you're welcome; glad it worked out for you! Also happy that I could give back somethings after all the great support I've received in here :)

Author:  graysky [ Sun Sep 18, 2005 7:47 pm ]
Post subject: 

Dammit... to others who have followed my instructions: what is your output the following command:
Code:
$ mplayer -version

Mine is as follows:
Code:
MPlayer 1.0pre6-3.3.5 (C) 2000-2004 MPlayer Team
CPU: Advanced Micro Devices Athlon 4 /Athlon MP/XP Palomino (Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.


Why doesn't the version reflect the 1.0pre7 files I used? Is this a bug or did I fool myself with this install? How can I wipe out the previous version of mplayer? I tried a "make clean" but that did nothing.

Author:  cesman [ Sun Sep 18, 2005 8:18 pm ]
Post subject: 

Code:
/usr/local/bin/mplayer -version

Code:
dpkg-r mplayer
Then install per your directions. For those that have followed your directions, just dpkg -r mplayer...

Page 1 of 7 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/