VDR TV in a Box 2.0

This is vdrtvib, a Linux Gnome panel applet that shows what's on TV! It uses the excellent VDR and the streamdev plugin to display a tiny TV picture in a box on the panel. The applet includes buttons for changing channels, and for launching a full sized viewer. Here's the obligatory screen-shot:

vdrtvib applet grab

(Yes, that really is somebody or other from Neighbors. I need to get out more.)

This version removes the dependency on pymedia and has a much smoother playback. You will need a VDR supported TV card, plus the following software:

Other versions will probably work, as the applet does nothing particularly tricksy. Its known to work with a Hauppauge WinTV-HVR-900, but any VDR/LinuxTV supported DVB card should work.

Download, Install, Use

Download vdrtvib_2.0.tgz and unpack it with tar zxvf vdrtvib_2.0.tgz. cd into the vdrtvib_2.0 directory and, as root, build and install the applet with python setup.py install. The build step includes compiling a Python C extension wrapper for FFMPEG's libavcodec library. You may have to adjust setup.py's library_dirs and include_dirs paths for your distro. Ignore the compiler deprecation warnings.

Either restart your desktop, or run killall bonobo-activation-server; killall gnome-panel. Make sure VDR and the streamdev plugin are running, then add the applet to the panel. It should tune in to the first TV channel and display it in a tiny box! The arrow buttons change channels up & down, or you can set the channel directly with the applet preferences menu.

A left-click on the TV picture launches a full sized TV viewer (e.g., xine). The launcher command can be set in the applet preferences menu, as can the URL of the VDR server.

The preferences menu item Show Nth sets the applet display rate. Every Nth frame is displayed, so higher numbers reduce CPU load but also reduce picture quality. A setting of '1' displays every frame, but uses around 40% CPU on my box. The default value is '3', which seems a reasonable compromise between CPU load and picture quality on a tiny screen.

You should probably set the streamdev plugin option Suspend behavior to Always suspend, otherwise the applet won't be able to retune the receiver.

Troubleshooting

Make sure VDR and the streamdev plugin are working by pointing your browser at http://localhost:3000. You should see a list of available channels. Click on one of these channels and a MPEG PES stream should start downloading.

If the applet won't start, try running it as a normal window by executing python /usr/libexec/vdrtvib_applet test in a shell. This should show a tiny TV window somewhere on the desktop.

If that works but the applet still doesn't start, try running /usr/libexec/vdrtvib_applet, then add the applet to the panel in the normal way. This will allow you to see the applet errors that usually end up down a black hole.

If you're still stumped, contact me.

Bugs

Version 1.0

Version 1.0 used pymedia (http://pymedia.org), whereas 2.0 uses ffmpeg directly via a C extension module. Pymedia seemed rather unstable in this application, and gave a very jerky playback, which I couldn't eliminate. Version 2.0 wraps its libavcodec calls in the Python C extension module tvibvdec which reads and decodes the stream directly, calling a user supplied Python function for each decoded frame. This is much more efficient and stable, and removes a dependency on an external module, making installation simpler. tvibvdec could conceivably be used standalone in other Python applications that need to process MPEG streams as a series of RGB frames. See the tvibvdec __doc__ strings for the API.

If you really want it, Version 1.0 is here

Contact Me

Feedback, Questions, Comments, Suggestions & Bugs to lsmithso@hare.demon.co.uk. Or see my Home Page.
(c) Copyright L. Smithson 2007.
$Id: vdrtvib.html 19 2007-04-23 12:21:59Z lsmithso $