Saturday, July 31, 2010

Recorded MythTV in XBMC

 

My search for the ultimate home media centre solution recently resulted with an install of Linux, MythTV and XBMC.  I have wanted to give XBMC a go for a long time, however I always hesitated because my home media center solution gets a lot of use with Live TV and Recorded TV. 

I have always known that MythTV is a great solution for TV on a HTPC, but that means Linux and I was always too cautious to leave my Windows Comfort Zone.  Well recently I left Microsoft for good and all my PC's now run Linux (more about that later). So with the ability to experiment with MythTV on my main PC without the headache of dual booting, I got my feet wet with Myth.

After a few weeks of working out the finer details of MythTV, I introduced the XBMC / MythTV combo to my main lounge room.  This is truly a powerful combination as XBMC is no doubt the best for downloaded content and MythTV is now in my opinion the best software solution for Live and Recording TV. 

The best of both worlds
To have the best of both worlds you need to get XBMC and MythTV to work well together.  The last thing you want to be doing is switching back and forth between applications more often that you have to.  XBMC has a built in solution for MythTV  http://wiki.xbmc.org/?title=MythTV that allows you to view live channels, view recorded programs and even view the TV guide.  This is a very basic interface to MythTV that has a lot of room for improvement, however it does give you access to TV from XBMC and with a few tweaks you can make it even better. 

Recorded TV in XBMC
The MythTV interface in XBMC provides you access to view your recorded TV with a very basic interface which lists your recordings in a list, however with a couple of tweaks within MythTV you can integrate your recorded TV into your XBMC menu structure along with all your other media.

With the recent release of Myth .23 came the introduction of a new event system.  The event system allows you to run scripts on, you guessed it, events.   http://www.mythtv.org/wiki/Release_Notes_-_0.23 

I did some digging around and found a peal script  (http://www.mythtv.org/wiki/Mythlink.pl) that creates symbolic links from your recorded MythTV into a specified folder with nice file names that allows a good integration with XBMC.  Initially I attempted to run this Perl script from the Start Recording Event and pass the specific show session details into the script. This proved problematic and I gave up on this method and put it down to some sort of delay within MythTV in starting the writing of the recorded file to disk.  I had immediate success with the on Recording Finish Event and therefore decided I could go with this solution, the only draw back of the finish event as apposed to the start event is that you have to wait until the recording is finished until you can watch your recording via the XBMC Recorded TV folder.



With a folder full of nicely named files and setup correctly within XBMC, the end result is a nice looking Recorded TV folder amongst all your other media folders within XBMC.  Although this is not a make or break tweak to my solution, it is all the little customisations that help make MythTV and XBMC sing together.