Sunday, November 20, 2011

Compile mplayer on OS X

Finally, success. My tears of frustration did not short out my kkkkkkeyboard and I ca finally type ut thi simple howto (well, simle for me ayway).

So why compile mplayer? There's a relatively recent binary for Tiger and up available here inside an application wrapper that you can extract if you want to use it from the command line. It's from September 2009, recent enough for pretty much anything now, but it's almost 2012 and 2014 or 2015 are just around the corner, and by then it'll be six years old. So what if nobody steps up and provides a distributable binary for Tiger or PowerPC users? What if it's 2015 and users clinging to Classic and using TenFourFox 147 need an updated binary? Well, you're gonna have to roll your own and here are the basic steps to do it.

First, in order to compile anything, you need to install Xcode. In fact, for this compile specifically, you'll need SVN and Git, too. Specific instructions about this are in two posts back here. Also, you'll need to install Make 3.82 available here.

If you haven't added /usr/local/bin to your path, do it now by editing or creating ~/.bash_profile and adding the line:

. ~/.bashrc
(don't forget both dots).

Then edit or create the file ~/.bashrc with the line:

PATH="$PATH:/usr/local/bin"

With this you can call anything installed in /usr/local/bin simply by typing the application name in the command line.

Onto compiling:

On the surface it's just a simple process of downloading the source, running ./configure, make, and sudo make install, but I came across a few hurdles that I'll show you how to get over.

First, create a new folder to download the source into, set that folder to the current directory, and then download the source with these three commands:

mkdir ~/Development

cd ~/Development

svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer (on one line)

Then you want to run the configuration script like this:

cd mplayer

./configure --enable-menu --with-freetype-config=/usr/X11R6/bin/freetype-config (on one line, the two arguments are for OSD support and require X11 to be installed)

At this point I got a message I wasn't prepared for: No FFmpeg checkout, press enter to download one with git or CTRL+C to abort

When I didn't have Git installed, that was a problem. But after I installed Git and reran the script, I simply pressed enter and continued on. At this point you may get a longer error message that ends with:

git pull failed, (re)move ffmpeg/mp_auto_pull to disable pulling

The solution is to remove "mp_auto_pull" from ~/Development/mplayer/ffmpeg. Then when the ./configure script ends, run make. But there's a bug here. Make 3.80 won't work. You'll get an error, make: *** virtual memory exhausted. Stop. You have to upgrade to Make 3.82.

After installing 3.82, you'll notice the default Make is still 3.80 in /usr/bin. Since I didn't know how to make the new version the default and wasn't sure of the implications of mixing an updated Make with other dev tools, I just invoked it by typing its full path. So after the ./configure script completes, type:

/usr/local/bin/make (this will take awhile)

Then at the conclusion, run:

sudo /usr/local/bin/make install

And that's it! You should have a working binary. To get Truetype subtitles working, you can copy any fontname.ttf file from your /Library/Fonts directory to ~/.mplayer/subfont.ttf like:

cp /Library/Fonts/fontname.ttf ~/.mplayer/subfont.ttf (one line)

The file in your ~/.mplayer folder must be called subfont.ttf.

When I first started this whole mess, I couldn't get it to compile with OSD support. I tried using Macports to install some of the dependencies as described here, and man what a nightmare. Finally I went back to look for a simple explanation and found the ./configure arguments for OSD support here.

And with that I'm gonna watch a movie.

Tuesday, November 15, 2011

Linux MintPPC 11 is Out!

I just installed the new MintPPC 11 and have been playing around with it, so this is more a quick look than a comprehensive review but I like what I see.

First, the authors announce this is based on Debian Wheezy (testing) so there are likely to be some bugs. This is roughly equivalent to what Ubuntu does, basing their releases on the "testing" branch rather than "stable". The advantage is you get newer versions of software like Iceweasel 7.

I can report to you that Iceweasel 7 is fast. Like super-fast. Another very cool piece of software installed by default is Minitube, a youtube viewer for PPC users lacking flash.

The install was hassle free. The only head scratcher was when confronted with a screen asking you to choose which kernel. I chose version 3 since it was highlighted by default. I thought, "Well, I'll probably break sleep with this, but what the hell? Latest and greatest, right?" And predictably, sleep doesn't work. Other users report sleep works fine, so maybe they went with the safer 2.6 kernel.

Setting up wireless was pretty painless. Sound began muted, but I just had to untick the mute box and had sound working. The LXDE desktop was slick and its memory usage was low. Everything runs comfortably in this iBook with 256 MB of RAM. MintPPC installs by default a variety of of useful software, so everything's there pretty much set up for the average user.

One last thing, unlike the stable branch, mplayer from testing now works on G3's. The stable version was compiled it appears for G4's only. However, VLC still breaks when playing video. I got the stable version working by compiling my own, but I haven't gotten to that here yet.

So give MintPPC a shot. If you're new to it, just register for free at their website and you'll find install instructions and a responsive forum area. Good luck.

UPDATE: If you have a dual boot system, beware that the Debian installer MintPPC uses can corrupt your OS 9 drivers making your OS 9 partition unbootable. The solution is to run Drive Setup from a Mac OS 9 install CD and update drivers. I wrote about this earlier here.

Wednesday, November 9, 2011

SVN, Git and Xcode for Tiger

So I'm having this nightmare trying to compile the latest development version of mplayer on Tiger, and I plan on writing about it if my tears don't short out my keyboard before then, but I thought I'd drop by with a quick post in the meantime about some tools you'll need in the process.

These are basic development tools that are getting hard to find for Tiger, and they're also not just for compiling mplayer. If you want to do any compiling or developing, these are the tools you want.

First one's the big one. Xcode from Apple. You can get this either from your install DVD or by downloading it from Apple's website. It's better to download it as you can get the latest version. You have to sign up for a free developer's account and then do a little hunting around on the site, but if you click Resources at the top, then find a Mac OS X Downloads link, you'll eventually come to the Downloads section. Tiger users want to download Xcode 2.5 Developer Tools. Leopard users, your latest version is I believe 3.1.4. The whole install will end up taking a couple of gigabytes, but on the plus side you now start developing all those awesome apps for Tiger you always wanted to.

Another tool you'll need to retrieve source code is SVN, a version control system that supplanted CVS as the popular choice. The Tiger version can be found by going to svnbinaries: Home, then clicking on "Need to download older binaries?", clicking the OS X folder, then choosing Subversion 1.4.6 Universal.

The last tool I have for you is Git, a version control system that supplanted SVN as the popular choice. Honestly, world, I wish you'd make up your mind. Both Tiger and Leopard universal binaries can be found here.

One thing going for Git, it has the funniest install ReadMe I've seen. It says, well, I'll just quote it:

GIT - the stupid content tracker

"git" can mean anything, depending on your mood.

• random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant.
• stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
• "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
• "goddamn idiotic truckload of sh*t": when it breaks
I vote the latter.

UPDATE: Oh, look. Somebody made Homebrew for Tiger and Leopard PowerPC.