Watching MythTV recordings on AppleTV with Boxee

A few weeks ago I decided to get an AppleTV to use as a mythtv frontend, as my current backend freezes up while playing back recordings. While the Mac OS X version of mythfrontend runs fine on the AppleTV, the playback performance is a bit choppy and the Apple remote does not work. I rent movies and watch podcasts through iTunes, so I didn’t want to give up the ability to play back iTunes purchases by formatting the AppleTV and installing linux (which would resolve both of the mythfrontend issues).

Instead, here’s a much better solution: Boxee. Boxee is a media player based on XBMC, and it runs on Mac OS X, AppleTV, and Linux. There are two ways you can access your mythtv recordings through Boxee, UPNP and SMB. There’s a third way, the xbmc mythtv plugin that communicates directly with your myth backend, however I was unable to get this to work with my backend on my AppleTV.

Browsing your recordings over UPNP is easy, simply select “Network Sources” from the Boxee video menu, wait a few seconds for UPNP to discover the backend, then go back out of the network browser and back in (there’s no option to refresh the list here). You should now see “Recordings” as an available source, which will give you access to all your mythtv recordings. I found this to be very unreliable on my MythTV 0.21 backend, streaming over UPNP would cause the mythbackend process to hang after several recordings. But I was determined to get this working!

Enter mythrename.pl and samba! mythrename is a perl script that is included with mythbackend (it’s available in /usr/share/doc/mythtv-backend/contrib/ on Ubuntu) that will either rename or symblink your mythtv recording files, which are normally just a bunch of numbers, to whatever format you specify. I’ve set up a cron job to run the following command every 30 minutes:

/usr/share/doc/mythtv-backend/contrib/mythrename.pl –link –format %T/%m%-%d%-%Y\ %S

The command above symblinks my recordings inside the mythtv recordings folder to show_names/(show name)/(month)-(day)-(year) (episode title). For example, last night’s episode of Life is available at /share/MythTV/show_names/Life/10-17-2008 Crushed.mpg. I simply export this folder over samba and add it as a source in Boxee (set as private to avoid indexing, which will fail because MythTV does not keep track of the season / episode numbers required by Boxee’s tv show detector).

I can now watch all my MythTV recordings on the AppleTV, controlled with the Apple remote, and without any choppiness during playback, while still having access to all my iTunes content through the AppleTV menus.