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.

6 Replies to “Attempting to perfect TV viewing system”

  1. Keep the articles coming!

    I’m more than happy to screen share for eye tv over running all kinds of scripts. We just fast forward through commercials and manually edit commercials from content we wish to keep. My beef is that we pay extra for channels like UP and Hallmark but during the recordings time warner displays ‘channel not available ‘ and/or goes into the bouncing tw logo screen saver mode. Not a happy camper with tw!

    1. I use an antenna, so I’m not paying for TV that I don’t watch. I have TWC for Internet and have no real complaints about it except that my Internet only fee just went up to $89.99 for 50 Mbps (However, I’m actually getting about 115 Mbps while they transition to MAXX service.)

  2. I hate to sound like a newbie but how do use your Eyetvexporter? I got as far as downloading and unzipping it. What’s next?

    1. I was calling it from an AppleScript that ran daily. This is the AppleScript that grabbed all the EyeTV archives that were modified in the last day. Unfortunately my ideas are not really turnkey systems!


      tell application "Finder"
      with timeout of 86400 seconds
      set yesterdayDate to (current date) - 1 * days
      set eyeTVFolder to "Macintosh HD:Users:mediacenter:Documents:EyeTV Archive"
      set theFiles to (files of folder eyeTVFolder where name extension is "eyetv")
      repeat with theFile in theFiles
      set modDate to modification date of theFile
      if (modDate > yesterdayDate) then
      set posixFileLocation to quoted form of POSIX path of (theFile as alias)
      with timeout of 86400 seconds
      do shell script "/Users/mediacenter/Desktop/ConversionScripts/ProcessVideos -f /usr/local/bin/ffmpeg -p /Users/mediacenter/Plex -e " & posixFileLocation
      end timeout
      end if
      end repeat
      end timeout
      end tell

      1. Is there a reason why you were using ffmpeg versus handbrakeCLI? I tried several times to install ffmpeg to no avail. Did you use macports to install ffmpeg? Have you settled on Mythtv as your primary DVR or are you still using EyeTV?

        1. Hi Jason,

          I just downloaded the Mac binary for ffmpeg and ffprobe; no need to use MacPorts as each is just 1 file that I dropped in /usr/local/bin. I haven’t played much with HandbrakeCLI.

          Right now I’m completely using MythTV and am quite happy with the setup. The UI on EyeTV is, of course, more Mac like, but I like the options of MythTV, the native commercial detection, and the integrated ability to run “jobs”. For instance, if something happens and my Plex export doesn’t run, I can just use MythTV to trigger it again. I’ll give it a few months and if all is working well, then I’ll call MythTV a success.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.