TapeWorm
A MythTV Parasite for Windows














Upgrading from TapeWorm 1.0?
If you've already got TapeWorm 1.0 configured and running, you can skip this page and read the Upgrade Page instead.
Overview
There are several steps in preparing your MythTV Server for use with TapeWorm. Fortunately, you only have to go through this process once.
The following directions assume Fedora Core 4 Linux, which is what I have. If you have a different flavor of Linux, you'll have to figure out what your particular equivalent is. If these instructions are unclear, please e-mail me.
A word about security
Please note that my ISP does not allow me to expose servers of any kind to the outside world. On the one hand, this prevents me from doing some things I'd like to. On the other hand, it reduces my security risks considerably. Because of that, I don't have to worry about security on my MythTV Server. If you do, you need to take these instructions with a grain of salt and add security precautions that may not be included here. Security for your system is your concern, and I assume absolutely no responsibility or liability concerning security on your system by providing these instructions.
Fixed IP address for the MythTV Server
If your MythTV Server is not configured to use a fixed IP address, you will need to change your network configuration to use fixed IP. Otherwise, the IP address of that computer could change, making it hard to find for TapeWorm and requiring repeated reconfiguation of TapeWorm. For the sake of this page, we will assume that the MythTV Server is at 192.168.1.145 and that the folder where MythTV stores video files is /mythtv/recordings.
Sharing MythTV's video files
The first thing you need to do is share the directory where MythTV stores your video files so that it is accessible from Windows. There are multiple steps in this process.
Configure the Samba Server
The first step is to configure the Samba Server. From the Applications menu, select System Settings > Server Settings > Samba. Press the "Add Share" button. On the Basic tab, specify the name of the directory where MythTV stores your recordings and give the Samba Share a name. Being clever, I named mine mythtv. Then check the two boxes to make the share writable (this is optional) and Visible.

On the Access tab, I chose to "Allow access to everyone." I'm on a safe, protected network. If you want to restrict access, you're on your own to figure out how. Press "OK" to close the "Create Samba Share" dialog box.
Now choose Preference > Server Settings. On the Basic Tab, type in the Workgroup for your network and give your MythTV Server a creative description such as MythTV Server. On the Security tab, select "Share" for Authentication Mode and set the Guest Account to your MythTV user name. Press OK to close the Server Settings dialog, then close the Samba Server application.
Set permissions for the video directory
Next, you need to set permissions for the MythTV Video Directory you chose to share above. I don't know if there's a better way, but here's what I did:
Open a Terminal Window.
Type su followed by your root password to enter "super-user mode".
Then give all accounts full permissions on the folder and all files it contains. Assuming your video files are in /mythtv/recordings, type chmod -R a+rw /mythtv/recordings. If you want to be more selective, granting only Read permission or granting permission to only some accounts, you are on your own to figure out exactly how.
Type exit to leave "super-user mode".
Test access from Windows
On Windows, open a Command Prompt window.
First, let's check to see if you can see the MythTV Server from Windows. Assuming the IP address of your MythTV computer is 192.168.1.145, type ping 192.168.1.145. You should see an indication that you got a reply from the Server. If not, there's a problem with your networking or you have the wrong IP address for the MythTV server.
Now let's see if you can connect to the Samba Share you created. Assuming an IP address of 192.168.1.145 and a Samba Share name of mythtv, type net use \\192.168.1.145\mythtv. If you get an error message that talks about being unable to connect because you don't have permission to access the share, re-read the steps described above.
Sharing MythTV's MySQL data
The next step is to make sure you can connect to the MySQL database for MythTV from your Windows computer. Remember, these instructions assume that your server is not accessible from the internet and that you don't need to be concerned about security.
Open a Terminal Window on your MythTV Server.
Start MySQL by typing mysql -u root -p. Then type in the MySQL root password you set up in setting up your Server.
Assuming that your MythTV Server uses a MySQL account named mythtv, the "no security" option, as described in the MythTV HOWTO document, is to type
grant all on mythconverg.* to mythtv@"%" identified by "mythtv";
followed by
flush privileges;
A more secure option is to substitute the fixed IP address of each Windows computer for the % character (IP addreses much be enclosed in quotation marks) in the above grant command.
Finally, it's time to install and run TapeWorm!
If you have not already done so, please install TapeWorm now.
The first time you start the program, you will receive a database error. This is because you have not configured TapeWorm yet, so it doesn't know how to attach to the MythTV Server.

Press the Configure button. Using the settings we have assumed throughout these instructions, you should fill the form out something like this:

Set the MythTV Server Video Directory to the directory on your MythTV Server where the video files get saved. The MythTV Server Video Directory Browse button only works for me if I type in the IP address of the MythTV Server first. Otherwise, the Samba Server does not appear in my Network Neighborhood anywhere. Your mileage may vary. NOTE that even though the videos on my MythTV Server are in the "/mythtv/recordings" directory, I enter the Samba Share name here, which is "\\192.168.1.145\mythtv". You need the path Windows uses, not the path Linux uses.
Set the Local Video Directory to a location on your local computer where you'd like to store copies of shows MythTV has recorded. If you are on a laptop and want to take shows with you on the road, or if you have network bandwidth issues that make watching shows off the MythTV Server impractical, this is a nice option. If you don't intend to copy shows from the MythTV Server, you can leave it blank.
The MySQL Username, MySQL Password, MySQL Server IP Address, and MySQL Server Database fields are needed to connect to the MySQL database your MythTV Server uses for storing information about your recorded shows.
The Media Player Command allows you to specify the Media Player you want to use to play your video files. TapeWorm has been tested with Windows Media Player, the VideoLAN Client, and the Zoom Player, though other players will certainly work as well. You can also specify as many Media Player Parameters as you need. Each parameter must be separated by a space from the others. The example above invokes Windows Media Player and tells it to automatically play the video.
The Media Player Method is used to select between several different options for launching the Media Player specified in the Media Player Command. Basically, I've discovered a number of different ways of launching a media player from Python, but none of these ways is perfect. There are tradeoffs. And rather than forcing everyone to accept the formula that works best for me, I thought I'd give you some options.
Method 1 uses Python's os.spawnv() command. It's the first method I tried for launching a media player. It works with Windows Media Player and the Zoom Player, but not with the VideoLAN Client. It handles spaces in the video file names and the video file paths appropriately. It is not Modal, meaning that you can switch between your media player and TapeWorm if you wish to, and both will continue functioning. I originally rejected Method 1 in writing TapeWorm 1.0 because it fails with VideoLAN.
Method 2 uses Python's os.popen2() command. It's the second method I tried for launching a media player, and is the method that was used in TapeWorm 1.0. It works with Windows Media Player, the VideoLAN Client, and the Zoom Player. Unfortunately, it cannot play videos if there are spaces in the video file names or the video paths, and it is Modal, meaning that TapeWorm is frozen while the media player is open. The issue with spaces, pointed out to me by Andy Foster, is the main reason this method isn't acceptable as the only way to launch media players. If you do use this method, be sure to change your Local Video Path so that it doesn't include any spaces, such as the one in the middle of "Program Files". I suggest using something like "C:\TapeWormVideo".
Method 3 uses wxPython's wx.Process() command. It works with the VideoLAN Client (only if the "-f" parameter is used, and even then, it's a bit wonky!) and the Zoom Player, but not with Windows Media Player. It can handle spaces in video file names and paths, and is not modal.
So which method is best? I don't really know. That's why I've chosen to make all three available. I've used Method 2 with Windows Media Player and VideoLAN quite a bit with TapeWorm 1.0, and have been pretty happy with the results. However, I think I'm going to try Method 1 with Zoom for a while and see if I like that better.
Finally, you can check the Include Live TV Listings option if you would like to see shows that you may have captured via Live TV.
Click OK and you should be able to see your recorded video files.
The Server Tab

The Server Tab displays information about the shows available on the MythTV Server. From here, I think things are pretty obvious.
Double-click the listing you want to see, or click once and press Play. With a little luck, that should cause your configured Media Player to load and to start playing the desired video file.
Selecting a show and pressing the Capture button allows you to make a copy of a show. This is very nice if you want to take some shows with you on your laptop or if you experience bandwidth issues on your network. You can see what shows you've captured with TapeWorm by looking at the Local Tab. (See below.) Please note that program feedback while files are being copied is minimal. (The cursor changes to the hourglass, and the completion of the copy is noted in the information window only) Providing feedback extended the time needed to copy files by an unacceptable amount of time.
The Delete button on the Server Tab will remove shows from your MythTV server. It deletes the video file and removes the appropriate database records. Once a show is deleted, it cannot be retrieved,
If your program list becomes outdated due to MythTV backend activity, click Refresh Program List button.
Click on the About button to see copyright and license information, to get program support, and to donate money to Capital Candlelighters because this program works so well.
If you don't know what to do with the Exit button, I'm afraid I can't help you.
The Local Tab

The Local Tab displays information about videos that have been captured locally from the MythTV Server. It works essentially the same way the Server Tab does. Play plays the local copy of a video. Delete deletes the local copy of a show, leaving the Server copy untouched.
A word about Codecs
TapeWorm expects you to have an appropriate codec on your Windows computer to be able to play the format in which you have MythTV encode your video. If you use MPEG-2 as I do, but don't have a good MPEG-2 codec for windows, you might take a look at Stinky's MPEG-2 Codec.
Anything else?
I would strongly encourage you to go to the Support page and sign up for the TapeWorm mailing list. That's where I'll announce new releases, and that's where you can go if you have questions about TapeWorm or suggestions for new features you'd like to see.