<-- Back to Andy Balaam Home

Record TV

Warning: Record TV is not (currently) for the faint-hearted. One day, I hope it will have several friendly user interfaces, and lots of pretty colours. For now, if you don't like the idea of typing a long command at a terminal just to record a TV show, you should probably look elsewhere.

Record TV records TV on your Linux desktop. It also has experimental support for playing back recordings on the Nintendo Wii (using the Opera web browser).

It tries to take a direct approach, using the large and flexible toolkit that is available to Linux users, and should be useful for people who like to have control over how things work. It attempts to take the Unix approach of being a small tool that does one job well.

It's designed to be very flexible about how you set up recordings: the recording system looks in certain directories for the right kinds of files, and when it sees them it knows what to record. How those files get there is up the user interface, which means lots of different user interfaces can (potentially) all interact with the same recording system.

At the moment, it has essentually no UI for setting up recordings, and a simple web UI for playing them back.

Why not use MythTV instead? Well, you probably should, but I don't because:

What can it do?

OK, so you're convinced I've got big plans to make a cool, extensible TV recording system that can be controlled by lots of different GUIs, but you actually came to this site because you want to record TV, right?

Well, the good news is that you can record TV right now on your Linux desktop using Record TV. I genuinely use it myself, and it works! I even have it set up so I can watch the stuff I've recorded on my Nintendo Wii.

The bad news is that you'll need to be unafraid of things like the Unix command 'touch', or be willing to learn.

In further bad news, it's probably packed full of bugs.

Oh, and it's only been tested by ... erm ... me.

Getting Started

Still reading? Maybe you skipped straight to this bit? If so, I'd suggest dipping into the Fear, Uncertainty and Doubt I scattered in the previous section.

Note: these instructions are experimental, and are probably missing bits. Create an issue if you'd like to ask questions.

Here's what you need to do to start recording TV onto your hard disk:

      cd ~
      mkdir .recordtv
      cd .recordtv
      mkdir config
      ln -s ~/code/recordtv/include/channels_order_uk.rtvcfg channels_order.rtvcfg
      ln -s ~/code/recordtv/include/xmltv_channel_to_tzap_uk.rtvcfg xmltv_channel_to_tzap.rtvcfg

Running every night

Record TV does 2 things: downloads listings, and schedules recordings. I recommend doing the former once a week, and the latter every day. To assist you in this, there are some example scripts in the "cronscripts" directory of the tarball. Modify "recordtv-download" and "recordtv-schedule" to point at the location of the recordtv executable on your system, and then run crontab -e to edit your crontab file and type some entries like the example ones shown in "crontab-entries.txt".

Once this is set up, any programmes you name in your favourites directory should be recorded automatically for you. Watching on the Nintendo Wii

If you thought the above was a hassle, try this:

Recording one-off programmes

To record every instance of a programme, you can create a file with extension ".rtvfav" in the "favourites" directory inside ~/.recordtv, but if you want to record just one occasion, you need to create a file in "selections" instead. In this case, the file can be completely empty, but the filename must be exactly right. For example:

 cd ~/.recordtv/selections
 touch That_ll_Be_The_Day_T-2007-09-23_20_00-channel5.co.uk.rtvsel

... would record a programme called "That'll Be The Day That Was" on 23rd September 2007 at 8pm on Channel 5. The first part of the filename must be 20 characters or fewer, the date and time must be in the format shown, and the channel must be the codename you can find in the XMLTV files that were downloaded to ~/.recordtv/xmltv_files.

Obviously this is quite cumbersome for a human to get right. Someone should write a UI to do this for us...

More sophisticated favourites

You can do some other clever stuff with favourites. For example, create a file inside your favourites directory called "Working.rtvfav" that looks like this:


title_re can be any regular expression, deleteafterdays says when the recorded programme will be automatically deleted (this happens during scheduling). channel says only record the programme when it appears on this channel (again, the channel is the code name that may be found in the XMLTV listings), and priority helps Record TV decide which programme to record if two programmes overlap.

The default priority of a favourite is 0, and the default priority of a manual selection is 100. The programme with the higher priority is selected when there is a clash. Negative numbers are allowed. If two programmes with the same priority clash, the one that starts first is recorded, and if they start at the same time, one is chosen at random.

Creating an HTML TV guide

Record TV has one more feature: it can generate a funky Web 2.0 AJAX TV guide from the XMLTV listings it downloads. Just run this command:

 ./recordtv --generate-html-guide

and a tv guide will appear in ~/.recordtv/recorded_programmes/tvguide. It's not very good at the moment, but it really does use AJAX (so long as you ignore the 'X' part). What a good opportunity for you to learn how this Web 2.0 stuff works, and make it better!


Record TV is very new, and the code is very simple. What a good opportunity for you to get involved and make it cool!

It consists of a Python program, some PHP pages and, perhaps most importantly, some file- and directory-based interfaces which control the behaviour of the code.

An example of these interfaces is the "favourites" directory, which contains files with file extension ".rtvfav" that specify which programmes you wish to record on a regular basis. The interface states what the files should be called, and what they should contain, but allows you to create these files using any UI you like. For example, my Java TV guide programme FreeGuide could be adapted to create them, but I also plan to provide a PyGTK program to do it, and a web interface would be a natural way to do it (in fact, there is the beginnings of a web interface included with Record TV at the moment).

The Python code which forms the guts of Record TV at the moment reads these files (and others which do similar jobs) and acts on that information to schedule recordings using the Unix commands cron and at.

There is also PHP code to display the list of recorded programmes, and there are shell scripts used to do the actual recording.

The obvious areas for improvement are:

Features you might like to add:

Record TV uses git for source code control. You can get the source code from this page: https://codeberg.org/andybalaam/recordtv


My homepage can be found at http://www.artificialworlds.net. My name, by the way, is Andy Balaam.


recordtv is Copyright (C) 2007-2008 by Andy Balaam.

recordtv is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This licence is contained in the file COPYING.txt.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US

Edit | History | Print | Recent Changes | Search | Admin Page last modified on November 04, 2022, at 08:04 PM