*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: Compiling mplayer for F11 Builds  (Read 7470 times)

Compiling mplayer for F11 Builds

anna
Master Contributor
***
Posts: 326


August 01, 2010, 08:18:45 PM

Note:  Edited for the 850 build rather than the original instructions for the Paraguay build os300py.

If you want to try this, you must be rather comfortable with command line in a simple console (as in no GUI whatsoever).  Also, this installs so much junk on your XO, you're probably best off reflashing it once you've confirmed the mplayer binary works.

I used three USB drives:  one for swap, and two ext3 formatted drives - one for the mplayer files and yet another for the yum cache.

This setup and compilation was on a freshly flashed 850.  Go into terminal as root (I usually do CTRL+ALT+F1 for a console) and edit /etc/inittab to give you runlevel 1 (single user mode).

Code:
id:1:initdefault:

Single user mode lets you do things on your XO without a window manager sucking up resources.  Another useful thing is to go ahead and create /etc/sysconfig/network-scripts/ifcfg-eth0 for your home network:

Code:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Wireless
MODE=Managed
ESSID=<my unprotected home essid>

If you've got WEP or WPA at your location, that's other stuff to deal with.

Set your timezone.  Otherwise, make throws out errors, even if you set your timezone in Sugar.  I'm in Birmingham, so I set it to Chicago, which is also Central.

Code:
ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime

After doing that, I reboot and get a blinking console with no login.  So I hit CTRL+ALT+F2

...and get a console only root prompt.  Swap space is vital, so I insert my dedicated swap USB drive and enable it.  Here's my real-life example:

Code:
swapon LABEL=myswap

To get a network connection, since I already set up /etc/sysconfig/network-scripts/ifcfg-eth0 for my house, all I need to do is

Code:
ifup eth0

Then ifconfig to verify I've got an IP address.  Since compiling stuff takes a lot of dependencies, I need to create enough space to download and install all that.  So I have an ext3 formatted USB drive I mount on /var/cache/yum.  Of course, your /dev/sdX might be different.

Code:
mount /dev/sdb1 /var/cache/yum

Disable console blanking

Code:
setterm -powersave off -blank 0

Add the rpmfusion repositories

Code:
rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
rpm -ivh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

Pull in many MB of dependencies:

Code:
yum groupinstall "Development Tools"
yum install yasm SDL-devel gtkmm-utils-devel gstreamer-plugins-ugly gstreamer-plugins-bad gstreamer-ffmpeg gstreamer-plugins-schroedinger libtheora-devel

It's a lot of stuff and takes a while.  It's probably pulling in a lot more than what's required, but I got rather aggravated at trying to figure out exactly what I needed, so I kind of threw the kitchen sink in there.

Mount your other USB drive and get the mplayer source.

Code:
mkdir /mnt/mplayer
mount /dev/sdc1 /mnt/mplayer
cd /mnt/mplayer
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

Get the codec tarball on your USB drive:

Code:
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20100303.tar.bz2

Create the directory for the codecs:

Code:
mkdir /usr/local/lib/codecs

Extract your codec tarball and put that stuff where mplayer can find it.

Code:
tar -xvjf all-20100303.tar.bz2
cp -rav all-20100303/* /usr/local/lib/codecs

Go to the mplayer source on your usb drive and get this thing to compile.

Code:
cd mplayer
./configure --enable-gui --disable-mencoder --disable-lirc --disable-apple-ir --disable-dvdnav --disable-dvdread --disable-libdvdcss-internal --disable-dvdread-internal
make

After about an hour and a half, you'll find an the mplayer binary in your current working directory.  Put it where Fedora can find it.  If you do "make install" the installer will put it in /usr/local/bin and that's not in your default path.

Code:
cp mplayer /usr/bin

Change your /etc/inittab back to runlevel 5 so you can get a window manager when you reboot to see if everything went OK.

Code:
id:5:initdefault:

Halt the system and pull out all those USB drives.

Code:
sudo halt -p

Reboot into Gnome or Sugar.  Open the terminal and create the directory for your config file.

Code:
mkdir /home/olpc/.mplayer

This is mostly from Teapot's Ubuntu /home/olpc/.mplayer/config and it seems to work well.

Code:
vo=sdl
ao=alsa
framedrop=1
lavdopts=skiploopfilter=all:fast=1

Now you should be able to play any media file, fullscreen if you like as in this example, from the terminal.  

Code:
mplayer -fs myfile.avi

I did notice while bopping around testing a bunch of files, the alsa device takes a minute to release from the last file played.  So if the sound doesn't work while you're playing around, give it a bit and try again.

Note:  The XO you compiled on will have almost 700MB used on the nand, so I would just reflash it instead of trying to figure out what all to uninstall.

You can take this mplayer binary and drop it into /usr/bin on any F11 XO, making sure to set up /home/olpc/.mplayer/config as well.

To pack it up:

Code:
tar cvjf mplayer.tar.bz2 mplayer

To extract it:

Code:
tar xvjf mplayer.tar.bz2
« Last Edit: August 17, 2010, 09:50:35 PM by anna » Logged

#1 Re: Compiling mplayer for F11 Builds

anna
Master Contributor
***
Posts: 326


August 05, 2010, 03:17:06 PM

If you don't want to go through all this, or just want to try it out, I uploaded the precompiled binary to:

EDITED LINK:
http://www.sendspace.com/file/rhvw3d

Download, then unpack

Code:
tar xjvf mplayer.tar.bz2

Make it executable

Code:
chmod 755 mplayer

Either move it to your path

Code:
sudo mv mplayer /usr/bin

Or run it from that directory
Code:
./mplayer myfile
« Last Edit: August 17, 2010, 05:36:02 PM by anna » Logged

#2 Re: Compiling mplayer for F11 Builds

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


August 05, 2010, 10:56:01 PM

If you don't want to go through all this, or just want to try it out, I uploaded the precompiled binary to:

http://www.sendspace.com/file/0l7s6u

That is nice Grin Thx.
Is it any different (better/faster/"lighter") than the F11 Mplayer in the rpmfusion repository?
Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#3 Re: Compiling mplayer for F11 Builds

anna
Master Contributor
***
Posts: 326


August 06, 2010, 09:40:02 AM

Is it any different (better/faster/"lighter") than the F11 Mplayer in the rpmfusion repository?

I haven't done benchmarking between the two, but some of my pals, and indeed myself, have sometimes had trouble installing from rpmfusion, so I thought I'd do up a binary for a quicker, less frustrating option so folks could play around with the new F11 builds and still be able to listen to music and watch movies without too much hassle.  It's certainly a lot faster to drop a binary in /usr/bin than the yum install, especially if you have to give it multiple attempts.

It's not a huge difference in the scheme of things, but at 11MB, the precompiled mplayer binary is slightly smaller than the 17M this pulls in:

Code:
yum install mplayer gstreamer-plugins-ugly gstreamer-plugins-bad gstreamer-ffmpeg gstreamer-plugins-schroedinger

Of course, having those gstreamer plugins installed is handy for other things besides mplayer.

It's just another option if you find yourself getting irritated and want things to work right now.  And I rather enjoyed figuring out how to get that thing compiled on the XO itself.
Logged

#4 Re: Compiling mplayer for F11 Builds

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


August 06, 2010, 10:23:40 AM

some of my pals, and indeed myself, have sometimes had trouble installing from rpmfusion
Specially now that F11 is not officially supported, is kind of hassle to get rpmfusion going.

Quote
And I rather enjoyed figuring out how to get that thing compiled on the XO itself.
How long did it take (compile time) on the XO? A night or two?... Grin
Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#5 Re: Compiling mplayer for F11 Builds

anna
Master Contributor
***
Posts: 326


August 06, 2010, 10:36:42 AM

How long did it take (compile time) on the XO? A night or two?... Grin

Actually, not as long as you might expect.  I didn't time it, but from typing make, perhaps a little over an hour, maybe an hour and a half.
Logged

#6 Re: Compiling mplayer for F11 Builds

anna
Master Contributor
***
Posts: 326


August 17, 2010, 05:41:32 PM

I compiled mplayer again, this time on 850.  I disabled dvd support, which saved about a MB.  I also included ogg/theora support, though that isn't tested yet.


http://www.sendspace.com/file/rhvw3d


This mplayer binary comes in at 9.9 MB.  I tested it on a "freshly flashed" 850 and full screen video works.  Don't forget your /home/olpc/.mplayer/config file.
Logged

#7 Re: Compiling mplayer for F11 Builds

LaPaglia
Senior Contributor
**
Posts: 196


August 17, 2010, 08:22:23 PM

I compiled mplayer again, this time on 850.  I disabled dvd support, which saved about a MB.  I also included ogg/theora support, though that isn't tested yet.


http://www.sendspace.com/file/rhvw3d


This mplayer binary comes in at 9.9 MB.  I tested it on a "freshly flashed" 850 and full screen video works.  Don't forget your /home/olpc/.mplayer/config file.

I followed the instructions. Found the info you put in the config file. It played small only. So I looked around and saw where someone suggested adding fs =yes to the config file. I did that and it didnt work, still played small only.

Then I REALLY read your instructions, the part about rebooting, Gee, when I actually followed your directions it all worked great.

Thank you so much for doing this. Its a big help for me.  I owe you one.

Michael.
« Last Edit: August 18, 2010, 12:30:21 AM by LaPaglia » Logged

#8 Re: Compiling mplayer for F11 Builds

anna
Master Contributor
***
Posts: 326


August 17, 2010, 08:28:50 PM

Then I REALLY read your instructions, the part about rebooting, Gee, when I actually followed your directions it all worked great.

Huh?  You shouldn't have to reboot.  But at least it's working for you now.  Glad I could help.
Logged

#9 Re: Compiling mplayer for F11 Builds

LaPaglia
Senior Contributor
**
Posts: 196


August 17, 2010, 08:37:04 PM

Then I REALLY read your instructions, the part about rebooting, Gee, when I actually followed your directions it all worked great.

Huh?  You shouldn't have to reboot.  But at least it's working for you now.  Glad I could help.

In your directions where you compiled the version on the XO one of your last instructions was to reboot. So I figured it couldn't hurt, and it worked. I'm not going to argue  Grin

For those of us who use midnight commander as a file manager if you do the following you can start a movie in mplayer with a double click in MC.

To make a symbolic link:
-------------------------
1. Open Terminal.
2. Type: sudo ln -s /home/olpc/mplayer /usr/bin/mplayer

3. Close Terminal.

Now you can launch movies from Midnight Commander.

I have mplayer in /usr/bin/

Thanks again for all your help.
Logged

#10 Re: Compiling mplayer for F11 Builds

anna
Master Contributor
***
Posts: 326


August 17, 2010, 09:39:02 PM

I just edited the original post for compiling mplayer on 850, in case anyone wants to do that or just see how I did it.

If you don't want to fool with compiling, download the precompiled binary from

http://www.sendspace.com/file/rhvw3d

Extract the tarball

Code:
tar xjvf mplayer.tar.bz2

Make the mplayer binary executable

Code:
chmod +x mplayer

Move it to your path

Code:
sudo mv mplayer /usr/bin

Create /home/olpc/.mplayer/config

Code:
vo=sdl
ao=alsa
framedrop=1
lavdopts=skiploopfilter=all:fast=1
Logged

#11 Re: Compiling mplayer for F11 Builds

anna
Master Contributor
***
Posts: 326


February 28, 2011, 04:44:34 PM

Latest and greatest mplayer compiled on and for the XO-1 running 860.

http://www.sendspace.com/file/c817y7


Edit:


Also tested and working on Dextrose 439dg
« Last Edit: February 28, 2011, 06:32:07 PM by anna » Logged

#12 Re: Compiling mplayer for F11 Builds

anna
Master Contributor
***
Posts: 326


March 02, 2011, 04:22:13 PM

I was recently asked why you can't use mplayer to watch video files you've bought and downloaded from iTunes.  It's the DRM (Digital Rights Management) on those files.  Unfortunately, there's no easy and/or legal way around that.

Please DO NOT reply with links or suggestions on circumventing DRM.
Logged
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 28
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 19
Total: 19