MythTV

Useful Web Pages

I have been using MythTV for a number of years now, and have accumulated a certain amount of knowledge about it along the way. At times, that process was somewhat painful, taking wrong paths around the net trying to find out how to do things. There are all too often web pages out there that, in trying to be helpful, actually confuse things. So where I find a really useful page, I will try to list it here.

LinHes: Architecture and Customization

This is an excellent page describing how to get your infrared remote control working in MythTV on recent Linux kernels where the IR drivers are now part of the kernel instead of in lirc. It is written for LinHes users rather than Mythbuntu, but it is the only page I have found that sets out everything clearly and it also tells you how to debug your setup.

Mythimport (and Mythexport) beta testing

mythimport 3.0 beta

As of MythTV 0.28, the old mythimport program that is part of the now-discontinued Mythbuntu distribution no longer works properly with MythTV.  This is because of the new recordedid field in the recorded and recordedfile tables in the database.  Since I use mythimport frequently, I have now written a completely new version of it that is compatible with MythTV 0.28+.  This is now ready for beta testing if anyone would like to try it.

My Scripts

At times, I have wanted to do things that are not builtin functions of MythTV, and have found myself having to write a a script to to it. Some of these are likely to be useful to other people, so I am making them available here.

Adding a new storage drive to a MythTV system and balancing the free space

Download balance_storage.sh

Whenever I fill up all my storage drives with TV recordings and have to add a new drive, there is a serious problem. All the old drives are almost full, and will need to expire programs for them to be used. So all the recordings will happen on the new drive. At times I can have seven recordings going at once, and with overlaps for pre- and post-roll that can mean 14 or more recordings trying to write to one drive. That causes data to be lost from one or more recordings. So what I need to do is to move old recordings onto the new drive so that the free space is balanced between all the recording drives. I have done that manually, and it is a complete pain. You have to judge how many recordings you can move before the next new recording starts, and other such complications. So I wrote this script to do the job. This can just be started at any time, and it will stop in time to allow the next recording to happen, or when the free space is all balanced.

Finding gaps in the MythTV recording schedule to do maintenance in

I have a busy MythTV box, so when I need a few hours to do some maintenance on it, such as changing tuner cards or rearranging the drives, it can be a problem to work out when enough time will be available.  So I wrote myself a Python script called "gaps" that uses the new API to get the recording schedule and find when there are gaps in it.  It takes one command line parameter which is the minimum number of hours of gap needed.  A floating point number is accepted, so you can specify fractions of an hour.  If there are no parameters given, it will list all the gaps, no matter how small.  The script is rather rough and ready, but it works for me.  To use it, you need to also have the Utilties.py Python module installed.  You can download that from the Wiki Python API Examples page, or my web server (see below).  I just put a copy of the file in my /usr/local/bin directory.  Make sure you save the file as a UTF-8 encoded file.  You may also need to install the Python dateutil and enum34 packages.

Download gaps

Download Utilities.py