Content here is by Michael Still mikal@stillhq.com. All opinions are my own.
See recent comments. RSS feed of all comments.


This is my page for MythTV information, including details of my book on the topic.


Sun, 17 Jun 2007



Implementing parental filters with MythTV

    The other morning I walked out to my five year old watching Robot Chicken. This isn't what I would call the highlight of my parenting career, but it did leave me with an immediate need to come up with a solution to stopping the kids from watching inappropriate things now that they're big enough to work their way through the MythTV user interface without our assistance. Its now quite common for me to wake up in the morning and discover that the kids have turned the monitor on in the living room, have found one of their shows, and are happily watching.

    (I guess it says something about the ease of use of the MythTV user interface that my four and five year olds have no trouble navigating it without assistance. Specifically, the video thumbnail of the various recordings is a killer feature because it helps kids who can't read yet find the shows they want.)



    The animated thumbnail of the recording appears in the bottom right of this example image.


    Back to my need to filter recordings. Unfortunately this isn't covered in the MythTV book (Amazon), mainly because it didn't seem to me to be a killer feature at the time of laying out the chapters, and because we wanted to focus on getting the important aspects of Myth working well. I'm going to make up for that by writing up everything I've learnt about it in the last couple of days here.

    You'll find the filtering setup, which can be used for both parental filtering and filtering based on your random other needs (like perhaps only wanting to display sports programs at the moment, or only documentaries when you're trying to impress visitors), in Utilities / Setup -> Setup -> TV Settings -> Playback -> View Recordings (Recording Groups), which is the fourth screen of the playback settings wizard. That location might be slightly different depending on what theme you are using. The screen looks like this:



    Enabling a filter


    You can see here my super secret password, which is used to escape the currently active filter, which I will show you how to do in a moment. You can also see that I've selected a filter called "Children" as the default filter to use when Media Library -> Watch Recordings is selected. The relevant options on this screen include whether to prompt for a filter when entering the Media Library -> Watch Recordings screen, which I disabled as I want the default to be the Children filter to stop my kids from selecting another filter. You can also have the filter default to whatever it was last time, which doesn't work for me because that would mean it was almost always set to showing all programs, but might be convenient to others. You can also choose to show the name of the filter instead of the words "All Programs" in the Media Library -> Watch Recordings view -- this is useful for reminding you what filter you are currently using, although you should turn this option off if you don't want people to know that you are using a filter at all.

    The list of filters you can apply is based off the categories of the recordings currently in your MythTV database. These are stored in the category column of the recorded table, and for my back end the list is currently like this:

      mysql> select distinct(category) from recorded;
      +--------------------------+
      | category                 |
      +--------------------------+
      | banana                   | 
      |                          | 
      | Children                 | 
      | Sitcom                   | 
      | Holiday-children special | 
      | Cooking                  | 
      | Crime drama              | 
      | Reality                  | 
      | Documentary              | 
      | House/garden             | 
      | Talk                     | 
      | Special                  | 
      | Comedy                   | 
      | Children-special         | 
      | Animated                 | 
      | Science fiction          | 
      | Auto                     | 
      | Docudrama                | 
      | Travel                   | 
      | Science                  | 
      | Drama                    | 
      | Home improvement         | 
      | Fantasy                  | 
      | Suspense                 | 
      +--------------------------+
      24 rows in set (0.00 sec)
      


    The "banana" category is me testing to see if the statement above is really true. It must be, because after I changed a recording to have a category of banana, this was then presented as an option in the user interface:



    Bananas make for good filters


    The currently active filter is stored in the settings table of the MySQL database. Look for entries named "DisplayRecGroup" if you are inclined to poke around in your database.

    This level of filtering is sufficient if you only want to show one category at a time in the Media Library -> Watch Recordings screen. However, there is no facility to filter based on the rating of the program, and no way to combine filters to display more than one category at once. For example, there is no way to display Children's shows, and Children's holiday specials at the same time. This is a bit of a shame. Conceivably you could implement custom filtering like this by changing the values for the category column in the recording table, but I wouldn't recommend this approach.

    Anyway, on to how to use the filter now that you have it set up. Go to the Media Library -> Watch Recordings screen with the filter set, and you'll see that the view has changed to only include those things in your default category. You'll be able to tell that the filter is on if you selected the option to display the category name instead of "All Programs". My recordings screen looks like this when filtered to only include children's recordings:



    Filtering to only show Children's recordings


    As opposed to what it used to look like:



    No filtering at all


    To change the filter, press the menu key on your remote, or the M key on the keyboard. You'll see this menu:



    The recordings menu


    Select "Change Group Filter" from the menu. If you configured a password to change between filters, then the user interface to enter that password is displayed:



    Entering a password


    Enter your super secret password, and then you'll be prompted with a list of possible filters. If you didn't enable a password, you will of course end up going directly to this menu:



    Selecting a new filter


    And you've escaped the tyranny of the filter!

    It would be nice for the filtering to be more granular, and there have been some proposals in that direction, although that proposal isn't a perfect solution either.

    Tags for this post: mythtv filter parental howto
    Related posts: Getting started with OpenStack development; Make Magazine: Building a Myth TV Box part 1; Comment spam again; How to lay people off; The new way of converting JPEGs to MPEGs; Procmail filtering mailing list traffic, by magic

posted at: 18:33 | path: /mythtv/filter/parental | permanent link to this entry


Sat, 16 Jun 2007



How to transcode video for the Nokia N800

posted at: 13:47 | path: /mythtv/transcode | permanent link to this entry


Sat, 09 Jun 2007



Building a symlink tree for MythTV recordings

    I wanted to build a directory of symlinks that pointed to my MythTV recordings, so I wrote a little python script to do it for me. I figure someone else might find this useful too...

      #!/usr/bin/python
      
      # Copyright (C) Michael Still (mikal@stillhq.com) 2007
      # Released under the terms of the GNU GPL
      
      import MySQLdb
      import os
      import re
      
      from socket import gethostname
      
      # Connect to the MythTV database based on the MythTV config
      config_values = {}
      home = os.environ.get('HOME')
      config = open(home + '/.mythtv/mysql.txt')
      for line in config.readlines():
        if not line.startswith('#') and len(line) > 5:
          (key, value) = line.rstrip('\n').split('=')
          config_values[key] = value
      
      db_connection = MySQLdb.connect(host = config_values['DBHostName'],
                                      user = config_values['DBUserName'],
                                      passwd = config_values['DBPassword'],
                                      db = config_values['DBName'])
      cursor = db_connection.cursor(MySQLdb.cursors.DictCursor)
      
      # Regexp for what is allowed in the symlink name
      unsafe = re.compile('[^a-zA-Z0-9\-\:_]+')
      
      # Find the recordings directory -- this assumes you haven't used an
      # identifier string for this machine...
      cursor.execute('select * from settings where value="RecordFilePrefix" and '
                     'hostname="%s";' % gethostname())
      row = cursor.fetchone()
      basedir = row['data']
      
      # Now find all the recordings we have at the moment
      cursor.execute('select title, subtitle, starttime, basename from recorded;')
      
      for i in range(cursor.rowcount):
        row = cursor.fetchone()
      
        title = row['title']
        subtitle = row['subtitle']
        if subtitle == '':
          subtitle = str(row['starttime'])
      
        title = title.replace(' ', '_')
        title = unsafe.sub('', title)
      
        subtitle = subtitle.replace(' ', '_')
        subtitle = unsafe.sub('', subtitle)
      
        extn = row['basename'].split('.')[1]
      
        try:
          os.mkdir(title)
        except:
          pass
      
        try:
          os.symlink('%s/%s' %(basedir, row['basename']),
                     '%s/%s.%s' %(title, subtitle, extn))
        except:
          pass
      


    This creates a tree of symlinks in the current directory that looks like this:

      $ find . -type l
      ./Masterminds/Air_America
      ./Tech_Now/Getting_Famous
      ./Babar/To_Tell_or_Not_to_Tell
      ./Babar/The_Intruder
      ./Babar/Special_Delivery
      ./Babar/Conga_the_Terrible
      ./Babar/The_Celestville_Enquirer
      ./The_Backyardigans/Viking_Voyage
      ./The_Backyardigans/Cops_and_Robots
      ./The_Backyardigans/Eureka
      ./The_Backyardigans/Movers_of_Arabia
      ./The_Backyardigans/Save_the_Day
      ./Go_Diego_Go/Rainforest_Race
      ./Go_Diego_Go/Cool_Water_for_Ana_the_Anaconda
      ./Go_Diego_Go/Great_Jaguar_to_the_Rescue
      ./Go_Diego_Go/Diego_Saves_the_River_Dolphin
      ./Go_Diego_Go/Jorge_the_Little_Hawk_Learns_to_Migrate
      ./How_Its_Made/2007-06-08_09:30:00
      


    Tags for this post: mythtv symlink script python
    Related posts: init script; Rsyncing everything but the data; Twisted conch; pyconau 2010 twitter summary; Domain name lookup helper for python?; mbot: new hotness in Google Talk bots

posted at: 21:35 | path: /mythtv | permanent link to this entry


Sun, 03 Jun 2007



Review

posted at: 15:37 | path: /mythtv/book | permanent link to this entry


Fri, 04 May 2007



Book printed!

posted at: 13:46 | path: /mythtv/book | permanent link to this entry


Sun, 15 Apr 2007



Status

posted at: 15:42 | path: /mythtv/book | permanent link to this entry


Fri, 30 Mar 2007



I just noticed...

posted at: 12:09 | path: /mythtv | permanent link to this entry


Thu, 29 Mar 2007



Done and done

posted at: 19:44 | path: /mythtv/book | permanent link to this entry


Sun, 25 Mar 2007



MythTV on AMD 64

posted at: 17:56 | path: /mythtv | permanent link to this entry


Sat, 17 Mar 2007



MythNetTV beta 4

    As it says in the email:

    To: Discussion about mythtv <mythtv-users@mythtv.org>
    Subject: MythNetTV beta 4
    
    Hi again.
    
    MythNetTv is my video downloader / aggregator / importer thingie for MythTV.
    
    I've spent a little longer testing this beta, and I think it's getting
    kinda ready for a real release number or something. New things in this
    version (from the change log):
    
      - Made --update more terse
      - Made --update more liberal about what it considers to be a video,
        specifically added video/quick time and text/html (to work around the
        rather broken http://www.mobuzztv.com/uk/rss/quicktime
      - Added a filter option to --download to constrain it to only
        downloading shows with a specific title
      - Added transcoding for mov and wmv2 files
      - If there is a straggling import, and it causes as error, just skip
        it and mark it as imported
      - Don't reset transferred data statistic when we start downloading a
        show again
      - Started implementing moniker support for downloads
      - Unsupported monikers will result in an attempt to download the URL
        using mplayer (which works for RTSP and MMS at the least)
    
    Yes, that's right. You can now download only shows with a specific
    title, and you can also download any protocol which mplayer supports --
    specifically, RTSP and MMS are now supported.
    
    Now, if only there was a non-sucky way to work out what streams
    abc.net.au were offering at any given time...
    
    Get it here if you care: http://www.stillhq.com/mythtv/mythnettv/
    
    Mikal
    


    Tags for this post: mythtv mythnettv beta release video download rtsp mms stream
    Related posts: MythNetTV release 1; MythIPTV Beta 2; Couldn't determine the video directory?; MythNetTV release 3; MythNetTV release 6; MythNetTV release 5

posted at: 18:42 | path: /mythtv/mythnettv | permanent link to this entry


Sun, 25 Feb 2007



Now, about the video backlog

posted at: 20:12 | path: /mythtv/mythnettv | permanent link to this entry


MythNetTv Beta 3

posted at: 20:03 | path: /mythtv/mythnettv | permanent link to this entry


Renaming!

posted at: 19:53 | path: /mythtv/mythiptv | permanent link to this entry


Mon, 19 Feb 2007



MythIPTV Beta 2

    Just announced. It was either do the washing, or this:

      Date: Mon, 19 Feb 2007 10:11:09 -0800
      From: Michael Still 
      To: Discussion about mythtv 
      Subject: MythIPTV Beta 2
      
      Hi again.
      
      There's a new version of MythIPTV now at http://www.stillhq.com/mythtv/mythiptv/source/beta-2/
      
      This version adds the following:
      
       - subscription management: you can add RSS URLs to watch,
         list them, update them (download new versions of the XML and
         import the shows), and remove them
      
       - ad hoc video management: add a remote URL to the TODO list,
         download a remote URL and import it now, import a local file
      
       - transcoding: it's quite probable that you'll encounter a
         video format which isn't know. Please report it if you do
      
       - statistics: how many programs do I have? how many are waiting
         to download? how much data have I downloaded so far?
      
       - reporting: what shows would be downloaded next? what does the
         internal log say about the state of MythIPTV?
      
      Once again, this is a beta, so good backups are needed. I would love more feedback.
      
      Oh, and you _really_ need mplayer and mencoder installed now. Really.
      
      Cheers,
      Mikal
      


    Tags for this post: mythtv mythiptv release beta
    Related posts: MythNetTV beta 4; MythIpTV Beta 1; MythNetTV release 1; MythIPTV Beta 2; MythNetTV release 3; Craigslist personal ad styled on the Yahoo reorg

posted at: 10:11 | path: /mythtv/mythiptv | permanent link to this entry


MythIPTV Beta 2

    Just announced. It was either do the washing, or this:

      Date: Mon, 19 Feb 2007 10:11:09 -0800
      From: Michael Still 
      To: Discussion about mythtv 
      Subject: MythIPTV Beta 2
      
      Hi again.
      
      There's a new version of MythIPTV now at http://www.stillhq.com/mythtv/mythiptv/source/beta-2/
      
      This version adds the following:
      
       - subscription management: you can add RSS URLs to watch,
         list them, update them (download new versions of the XML and
         import the shows), and remove them
      
       - ad hoc video management: add a remote URL to the TODO list,
         download a remote URL and import it now, import a local file
      
       - transcoding: it's quite probable that you'll encounter a
         video format which isn't know. Please report it if you do
      
       - statistics: how many programs do I have? how many are waiting
         to download? how much data have I downloaded so far?
      
       - reporting: what shows would be downloaded next? what does the
         internal log say about the state of MythIPTV?
      
      Once again, this is a beta, so good backups are needed. I would love more feedback.
      
      Oh, and you _really_ need mplayer and mencoder installed now. Really.
      
      Cheers,
      Mikal
      


    Tags for this post: mythtv mythnettv release beta
    Related posts: MythNetTV release 1; MythNetTV beta 4; MythNetTV release 3; MythNetTV release 2; MythNetTV release 4; MythNetTV release 7

posted at: 10:11 | path: /mythtv/mythnettv | permanent link to this entry


Sat, 17 Feb 2007



MythIpTV Beta 1

    Some folk at LCA expressed interest in my video blog aggregator for MythTV. I've cleaned it up, and just sent out the first release:

      Date: Sat, 17 Feb 2007 09:38:04 -0800
      From: Michael Still 
      To: Discussion about mythtv 
      Subject: MythIpTv Beta 1
      
      Hi.
      
      I've been recently wanting a video blog aggregator which integrates with
      MythTV. Specifically, I wanted the videos to appear as recordings. I've
      had a horrible script for that for a few months, but ended up cleaning
      it up when it occurred to me that Akimbo (http://www.akimbo.com) is just
      a per user RSS feed, and something a lot like MythTV.
      
      So, I wrote MythIpTv. It takes RSS feeds, imports the entries in the
      feed and builds a TODO list. It then downloads shows and imports them
      into the MythTV recordings menu.
      
      The code has only been tested by me, so if you're interested in giving
      it a try, please take good backups. You can find the code here:
      http://www.stillhq.com/mythtv/mythiptv/source/beta-1/mythiptv
      
      Before use, you need to make a temporary data directory in your current
      working directory:
      
      mkdir data
      
      You use mythiptv like this:
      
      ./mythiptv --url <url to RSS feed> <show title>
      
      or
      
      ./mythiptv --file <RSS file on local disk> <show title>
      
      I've been using Google Video to test this, as the AVI format they use is
      natively supported by the MythTV player. This isn't true for a lot of
      RSS feeds and transcoding isn't implemented yet, so if you want
      something to test with, you might want to use the same command line as me:
      
      ./mythiptv --url
      "http://video.google.com/videofeed?type=search&q=engedu&so=1&num=20&output=rss"
      "Goole EngEdu"
      
      That command just builds a TODO list. You then need to download some of
      the shows. You do that like this:
      
      ./mythiptv --download <number of shows to download>
      
      Once downloaded, the shows will appear in the recordings menu.
      
      I would be really interested in people's comments on the code, and
      suggestions for improvement. There are a couple of things I know about
      already:
      
       - it really needs transcoding
       - the is no graphical UI yet
      
      Cheers,
      Mikal
      


    Tags for this post: mythtv mythiptv release
    Related posts: MythIPTV Beta 2; MythNetTV release 7; RemoteWorker v70; MythNetTV release 4; Another version of blather; MythNetTV release 2

posted at: 09:41 | path: /mythtv/mythiptv | permanent link to this entry


MythIpTV Beta 1

    Some folk at LCA expressed interest in my video blog aggregator for MythTV. I've cleaned it up, and just sent out the first release:

      Date: Sat, 17 Feb 2007 09:38:04 -0800
      From: Michael Still 
      To: Discussion about mythtv 
      Subject: MythIpTv Beta 1
      
      Hi.
      
      I've been recently wanting a video blog aggregator which integrates with
      MythTV. Specifically, I wanted the videos to appear as recordings. I've
      had a horrible script for that for a few months, but ended up cleaning
      it up when it occurred to me that Akimbo (http://www.akimbo.com) is just
      a per user RSS feed, and something a lot like MythTV.
      
      So, I wrote MythIpTv. It takes RSS feeds, imports the entries in the
      feed and builds a TODO list. It then downloads shows and imports them
      into the MythTV recordings menu.
      
      The code has only been tested by me, so if you're interested in giving
      it a try, please take good backups. You can find the code here:
      http://www.stillhq.com/mythtv/mythiptv/source/beta-1/mythiptv
      
      Before use, you need to make a temporary data directory in your current
      working directory:
      
      mkdir data
      
      You use mythiptv like this:
      
      ./mythiptv --url <url to RSS feed> <show title>
      
      or
      
      ./mythiptv --file <RSS file on local disk> <show title>
      
      I've been using Google Video to test this, as the AVI format they use is
      natively supported by the MythTV player. This isn't true for a lot of
      RSS feeds and transcoding isn't implemented yet, so if you want
      something to test with, you might want to use the same command line as me:
      
      ./mythiptv --url
      "http://video.google.com/videofeed?type=search&q=engedu&so=1&num=20&output=rss"
      "Goole EngEdu"
      
      That command just builds a TODO list. You then need to download some of
      the shows. You do that like this:
      
      ./mythiptv --download <number of shows to download>
      
      Once downloaded, the shows will appear in the recordings menu.
      
      I would be really interested in people's comments on the code, and
      suggestions for improvement. There are a couple of things I know about
      already:
      
       - it really needs transcoding
       - the is no graphical UI yet
      
      Cheers,
      Mikal
      


    Tags for this post: mythtv mythnettv release
    Related posts: MythNetTV release 1; MythNetTV beta 4; MythNetTV release 3; MythNetTV release 2; MythNetTV release 4; MythNetTV release 7

posted at: 09:41 | path: /mythtv/mythnettv | permanent link to this entry


Sun, 11 Feb 2007



Akimbo

    I was at Fry's today with the kids, and while wandering around I came across the Akimbo. It's an interesting device -- a hardware player that downloads content over your Internet connection, and then plays those videos for you when you ask nicely. You can select what you want to download form their website, and they have a (smallish it seems to me) collection of commercial content.

    They seem to be aiming at being the next iTunes store -- you can get them to host your video blog, and they will make it available to their devices. You can even charge for people to watch your recorded rantings.

    I see a couple of problems though:

    • The device is expensive ($200 US is recommended retail, you can get them for $99 at the moment)
    • This functionality would be trivial to implement in MythTV for free (in fact, I have been sitting on a python script that does this for MythTV since LCA -- it just needs some cleanup before release)
    • They use DRM
    • Even worse, they use MS Windows DRM


    I wonder if anyone has asked them if they'd be willing to allow a MythTV client?

    Tags for this post: mythtv iptv akimbo

posted at: 20:45 | path: /mythtv/iptv/akimbo | permanent link to this entry


Sun, 04 Feb 2007



Time for a status update?

posted at: 17:49 | path: /mythtv/book | permanent link to this entry


Fri, 12 Jan 2007



Errata: Tweak to homework, new VMWare image

posted at: 20:44 | path: /mythtv/tutorial/lca2007 | permanent link to this entry


Previous page