I've been running MythTV in my home since late 2006, and have had great joy working with it over the years (started running it on Fedora Core 6- that's how long it's been!).  

So that's why when my wife got me an AppleTV2 for my birthday last year, I just had to integrate it into my MythTV environment.  The first thing I did was jailbreak the device, and installed XBMC.  Using the built-in DLNA server that MythTV includes, I was able to stream my recordings directly to my Apple TV2 with quite a bit of success.

While XBMC is a great product, using it on an Apple TV2 is not quite ideal- it requires a jailbreak, and it's a little odd moving back and forth between the Apple UI and the XBMC UI- which our family found ourselves doing quite a bit.  Also, Apple products seem to work best when you buy into their ecosystem- I know that sounds rather "sheep"-ish, but it's true.  

This instructable outlines how I am able to watch all of my MythTV shows on my AppleTV2, while staying "genius" friendly...

Step 1: My Environment- Overview

This is my environment.  A brief description of how the setup works:

1) MythTV records a TV show
2) A custom job executes at the end of the recording which uses HandBrakeCLI to encode the video into AppleTV2 format.
3) Every 5 minutes, a powershell job executes on the Win7 VM.  This job does the following:
     a)  Uses the iTunes SDK to acquire an instance of the active iTunes "TV Shows" library.
     b)  Performs a query on MythConverg looking for all transcoded shows, and finds any not in iTunes yet.
     c)  Adds any missing shows from mythconverg into the TV Shows library
     d)  Looks through the TV Shows library, and removes any that are no longer in mythconverg

4) Wife enjoys Big Brother on our Apple TV2!

Note: All scheduling of new shows, and deletion of old shows happens through mythweb.
sweet instructable thank you!
Cool. What gets me is there are all these streaming boxes based on open source that you dare not modify unless you want the wrath of the gods. Then there is Apple tv so proprietary and it is the one you can modify. Does not seem right.
Okay I took another look at this- and I think I know what the issue is. <br>Here's an example of what gets passed in from mythtv ($3): <br>2012-08-03T21:58:00 <br> <br>Here's what's in mythconverg as the start time field: <br>2012-08-03 21:58:00 <br> <br>So the ${3/T/ } is simply a bash construct to do a find/replace on the character 'T'. <br> <br>Knowing this- i doubt that $3 will actually work- it may have cleared up your error, but I'm sure your database didn't get updated properly, so I would guess that your test recordings are not watchable at the moment (it's an easy fix however). <br> <br>Here's the root of the problem though- the ${3/T/ } is a BASH construct, so you must actually be running BASH, and not another shell. On my machine, /bin/sh happens to be a symlink to bash, so that top line in the script is actually causing bash to run :). <br> <br>Try this: <br>from the command line- run: whereis bash <br>on line 1- replace /bin/sh with the output from that (likely /bin/bash- so #!/bin/bash for example.) <br> <br>I'll update the code to be /bin/bash instead of /bin/sh. Thanks- let me know if that fixes it!
Aha, yup on Ubuntu /bin/sh is symlinked to /bin/dash, that probably caused the problem. <br> <br>Thanks!
I can't get the bash script to work, it dies at this line: <br> <br>SHOWTIME=${3/T/ } <br> <br>What's it do? Why wouldn't SHOWTIME=$3 work? It seems to do so on my tests.
Thanks for trying it- I know it had something to do with formatting the date so the SQL query would work (sorry I wrote it a while ago). I'm out and about, but will investigate when I get home.

About This Instructable



More by cinntax:MythTV / AppleTV2 Integration- Non Jailbreak Version 
Add instructable to: