Using Xine with your MythTV videos: small screens while you work


I use gnome or xfce for my desktop environments at home and work.  In both places I tend to listen to movies while I work.  I have a large collection of DVDs and even a larger collection of vhs tapes.  The former are mostly ripped to disk now but the latter are a work in progress.  Eventually I'll write an article about how to get the best quality out of those tapes on a budget.

I take my DVDs to work in a small case.  I use Xine to play them using packages from the fedora RPMFusion site and livna.  See Mauriat Miranda's excellent guide to configured media under f10 for more details on getting media to play on F10.  At home, since I have the videos ripped to disk, I can use mythtv.

The idea here is to have video playing and visible while you work no matter which workspace you use, but not have the video window take up too much space.  MythTV doesn't make this easy.  After all, that isn't really what it's for – it's for displaying video on dedicated output devices.  The alternative is to use xine, which allows the video window to be made very small.  Fortunately, it also reads many different video formats directly from files and not just DVDs.  And that makes Xine a better choice while I work.

The first trick is to take the video archives stored on your MythTV server and export them via nfs.  If you run a remote MythTV client then chances are you already do that.  If not, just edit /etc/exports to specify which directories to make available.  The directories should also only be made available to your local network at home.  NFS over anything other than a local network would be far too slow to be useful.  That means NFS doesn't make a good solution for streaming your videos at home to work across the Internet.

Here is an example /etc/exports entry used to make videos on my MythTV server available to the rest of the local network:

/store/movies/Cinema-1 192.168.1.0/255.255.255.0(rw,sync,no_root_squash,insecure)

The path /store/movies/Cinema-1 is just one external usb drive on that system.  The IP address 192.168.1.0 is matched to the netmask of 255.255.255.0 to tell NFS that only hosts on the local network can access this directory.  The other options are not necessarily useful to everyone but I use them to give me full access to read/write to the directory from the client side.  After making these changes the NFS service needs to be restarted.

sudo service nfs restart

On the client side I use the following entry in /etc/fstab to allow the remote directory to be mounted locally, using the mount command, to the same directory:

genm:/store/movies/Cinema-1 /store/movies/Cinema-1 nfs rw,rsize=8192,wsize=8192,hard,intr,noauto 0 0

In this entry genm is the name of the server.  The local directory must exist or the mount request will fail.  The nfs field tells the mount command that NFS should be used as the filesystem type when accessing /store/movies/Cinema-1.  The rsize and wsize options increase the throughput from the default settings for NFS (NFS4, the latest version which I believe F10 defaults to now, may already use higher values).  The hard and intr options allow you to recover more easily from problems with the remote server going away while you're using it.

Now the client (the desktop system) can mount the remote videos directory and access it just like it was local:

sudo mount /store/movies/Cinema-1

With the videos available locally, I can use Xine to browse the directory and pick a movie.  Browsing with Xine this way is not as visually appealing as browsing your videos under MythTV, but with meaningful file names for the videos that isn't a big problem.

Once the video starts to play comes the next trick:  reducing the size of the display.  I play Xine at half size because it's a simple keystroke to get it there:  Alt-1.  Alternatively you can resize the window manually just as you would any other desktop window.  This works really well with the ripped videos but not so well with DVDs because Xine can resize itself with each title it plays, and it can play a number of them (like the scary FBI warning) before it gets to the video.  The ripped versions don't have extra titles so you don't have to wait till you get to the title video to resize the display.

Performance of NFS over my local 802.11g wireless network is satisfactory unless I'm doing something very disk intensive, like saving a large gimp image to a directory on a remote system via NFS.  And even in cases like that the video doesn't tend to skip much.  In fact, I tend to have more problems with playback when the local CPU is 100% loaded.  That happens a lot when I'm using firefox, especially when adding a new post to my web site.

Even so, playing my videos with Xine while I work is a lot more fun when I can still see the rest of my windows and, well, do more work.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.