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.
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.5This 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.
Get started by downloading the following files from
http://www.mplayerhq.huessential-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.