Attempting to perfect TV viewing system

As I've written about in the past, I've gone to great lengths to record and play TV shows (I don't torrent and I get my shows over the air). My system up until now has relied on El Gato's EyeTV 3 software running on my Mac Mini combined with a few scripts and now a command line program I wrote called EyeTVExporter to drive ffmpeg. The whole system has worked well, but one problem with EyeTV is that I have to screen share to the Mac Mini to add or modify schedules. Also, this process is far too complex to maintain in the long run. Also, I don't currently have faith that EyeTV will continue to be updated; for instance the latest issue I have with it is that the Export routines (either in the app or via AppleScript) convert all the audio to stereo instead of preserving the AC3 5.1 audio that is recorded on many shows and exists in the MPEG2 file that EyeTV internally stores. When I've tried to just export to MPEG2 with the cut marks which mark the commercials, it has garbled some of the video.

Never content with the status quo, I decided to give MythTV a try this weekend. I had tried to install it before, but the pre-canned installers failed. So this time, I decided to build MythTV using MacPorts using the instructions on the MythTV wiki. Other than a few minor hiccups due to old cruft lying around, the install succeeded after awhile of building. I also installed mythweb to manage the whole thing (I changed the port on the version of Apache installed so I didn't have to futz with the standard OS X Server apache install.)

After the initial configuration and purchasing a 2 month trial of Schedules Direct for the guide data, I was off and running. First step was to record. That went smoothly and the built in commercial skipping seemed adequate for my needs; having it built in instead of using an external component was a big win for me. The next part became trickier and required me to work on a script. I created a user job in the mythbackend that has the following calling parameters:

plexexport %DIR% %FILE% %CHANID% %STARTTIMEUTC% "%TITLE%" %SEASON% %EPISODE%

I then created a script that I placed in /usr/local/bin/plexexport (chmod +x the file after placing it there). Basically the script uses the commercial flags that MythTV inserted, converts those to a cut list and then exports to the appropriate location for Plex to pick up. My ffmpeg settings seem to work well for 1080i and 720p video and preserves the 5.1 audio. I did find that ffmpeg didn't stop when it was done and duplicating my test video for 9 hours of video; using a little script magic and ffprobe, I cleared up that problem by explicitly telling ffmpeg the duration.

With MythTV you can have it run the user job right after the show records, but I want everything to happen at night when I don't have to hear the box if I'm in my office, so I had to create a simple script based on a sample I found that I invoke every night (I use Lingon to set it up). This script tells MythTV to locate all shows that are less than 24 hours old and to queue a commercial flagging job and a Plex Export job. I have MythTV setup to do 1 job at a time so I don't have to worry about the processor getting overloaded.

The last piece in this puzzle is deleting old recordings automatically and yes, I have another script to accomplish that task.

This may sound like it was more complicated than in the past, but I had 4 scripts before and 1 custom program to do the same work. If this all works, my time will have been worth it.

This allows me to use a web browser to schedule shows and easily view upcoming recordings. While the web interface isn't great, it is usable. One caveat is that mucking with some things can have cause lots of problems as the web interface does very little error checking.

Does this save me money? No, Schedules Direct is $25/year while the EyeTV guide data is $20/year, so it is $5 more. However, by undertaking this now, I've proven to myself that when/if EyeTV stops functioning, I have a viable alternative. Hopefully this experiment pans out.