TapeWorm

A MythTV Parasite for Windows

About Download Configure Support Source Code


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 10, which is what I have.  That's because the computer I use for my MythTV box is really OLD and underpowered and I can't upgrade it and I can't afford to replace it right now. If you have a different flavor of Linux, and you almost certainly do, you'll have to figure out what your particular equivalent is.  If you send me detailed instructions, including screen shots, I'll happily post them and give you credit. If my instructions are unclear, feel free to 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 may wish 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.  Or you could just always leave that computer running, which you probably do, so the IP address doesn't change. For the sake of this page, we will assume that the MythTV Server is at 192.168.0.2 and that the folder where MythTV stores video files is /mythtv/Videos.

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 to other computers on your network.  There are multiple steps in this process.

Configure the Samba Server

The first step is to configure the Samba Server on your MythTV computer.  From the System menu, select Administration > 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 "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, I selected "User" for Authentication Mode, left Authentication Server adn Kerberos Realm blank, chose "Yes" for Encrypt Passwords, and set the Guest Account to No guest account.  I have no idea if these are the best values for these fields, but they work on my system. 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:

I chose to have MythTV save files to a directory in my HOME directory structure. I then right-clicked that directory, went to the Permissions tab, and gave "Create and Delete files" permission to myself, my group, and others. I then chose to Apply Permissions to Enclosed Files. But like I say, I don't have security issues on my network. You may need to do something else on your computer to maintain security for yourself in your situation.

Firewall Settings

I don't honestly remember what I did and what the system did automatically when I set this all up. It was a long time ago. But here's what my current Firewall settings are.

Under Trusted Services, I have Samba and Samba Client checked.

Under Other Ports, I have entries for port 3306, tcp for MySQL, port 6543, tcp, for MythTV, and port 6544, tcp, for MythTV.

For 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.0.2, type ping 192.168.0.2.  You should see an indication that you got a reply from the Server.  If not, there's a problem with your networking or firewall, 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.0.2 and a Samba Share name of Videos, map a drive letter to \\192.168.0.2\Videos.  If you get an error message that talks about being unable to connect because you don't have permission to access the share, you may also need to connect using a different user name.

For OS X

On OS X, open a Terminal Window.

First, let's check to see if you can see the MythTV Server from OS X.  Assuming the IP address of your MythTV computer is 192.168.0.2, type ping 192.168.0.2.  You should see an indication that you got a reply from the Server.  If not, there's a problem with your networking or firewall, 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.0.2 and a Samba Share name of Videos, open a Finder window, select the "Go" menu, and choose "Connect to Server". Enter the Server Address of smb://192.168.0.2/Videos and press "Connect". If you get an error message that talks about being unable to connect because you don't have permission to access the share, you may also need to connect using a different user name.

Sharing MythTV's MySQL data

The next step is to make sure you can connect to the MySQL database for MythTV from your Windows or OS X 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 network computer for the % character (IP addreses much be enclosed in quotation marks) in the above grant command.

There are also several very nice utilities available for MySQL that allow you to set up accounts and set permission to access different database schemas within MySQL.

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 won't see any of your MythTV data.  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:

There are several settings to note:

Set the MythTV Server Video Directory to the drive you mapped or connected to for 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 your MythTV Server may be in the "/mythtv/recordings" directory, enter the Samba Share name here, which is "\\192.168.0.2\Videos" on Windows for me or "/Volumes/Videos/" on OS X for me.  You need the path Windows or OS X uses, not the path Linux uses.  FURTHER NOTE: You can daisy-chain directories here, if your MythTV files are scattered across multiple drives or directories.  Just separate them by semicolors.  Multiple browses will be added to the chain.

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.  NOTE: You can daisy-chain directories here, if your MythTV files are scattered across multiple drives or directories.  Just separate them by semicolors.  Multiple browses will be added to the chain.

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.

On OS X, the Media Player Method is disabled, as you have no choice but to use the internal player. Similarly, there are no fields for Media Player Command and Media Player Parameters.

On Windows, 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.

Internal uses a simple internal media player I wrote, which wraps Windows Media Player under the hood on Windows for most formats, the QuickTime player under the hood for a few formats on Windows and everything on Mac OS X, and the GStreamer player on Linux. The player is very simple, but includes buttons for commercial skipping.

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 use the Internal method because of the commercial skipping buttons. I don't really know what's best between the other three.  It depends on what media player you like and whether you ever put spaces in file names more than anything else. That's why I've chosen to make all three available.  I used Method 2 with Windows Media Player and VideoLAN quite a bit with TapeWorm 1.0, and was pretty happy with the results. 

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. 

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 copy a video file from your MythTV computer to your Tapeworm computer.  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.) 

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 undeleted or 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. 

Import lets you add a video file to your local Tapeworm tab even if you didn't get it using MythTV. You have to enter your own program data, of course, unless you used the Export Data button below at some point.

Edit allows you to alter the program data for the selected entry.

Rename File renames the local video file, leaving the Server copy untouched. What can I say? I like my video files to have meaningful names when I look at them outside of Tapeworm.

Export Data allows you to export the local Tapeworm data about a program. Tapeworm creates a small XML file with the same name as the video file that contains the program data. This is useful if you want to move or copy a media file from one computer's Tapeworm to another, say your desktop to your laptop, after you've deleted the file from your MythTV system. (My MythTV computer and my laptop have very small hard drives. My desktop has a lot of hard drive space. I tend to archive a lot on my desktop, then take it on the road when I travel.)

Delete deletes the local copy of a show, leaving the Server copy untouched.

Configure, About, and Exit do just about what you'd expect them to do, the same as on the Server tab.

A word about Codecs

TapeWorm expects you to have an appropriate codec on your Windows or Mac OS X 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.

Unfortunately, under OS X on my Mac laptop, the Apple MPEG-2 codec won't play audio for the MPEG-2 media files my MythTV system captures. Your mileage may vary.

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. I'm always open to suggestions.