TiVo users in Great Britain were treated to a "surprise" in May 2002. Their TiVo set-top boxes recorded an episode of a new BBC comedy -- without them having programmed their boxes to do so. Worse, the recording could not be deleted; it only automatically deleted itself after four days.
It's partly because of incidents like this that Klaus Schmidinger from southern Bavaria, Germany created Video Disk Recorder, or VDR. VDR serves as a user interface for those who want to build their own digital satellite-TV receiver and recorder box running under Linux. It is based mainly on the DVB-S digital satellite TV receiver card from Fujitsu Siemens, and upon drivers developed by the LinuxTV project. Essentially, VDR ties together this hardware and software with Linux so you can have your own TiVo-like box, but with the extras that TV network executives don't want you to have: on-screen removal of commercials and the ability to burn TV programming you've recorded to CD-Rs in the VCD format. See Figure 1.
Figure 1: A home-built digital video recorder that runs under Linux and Video Disk Recorder.
First, the bad news: for American Linux users, VDR is indeed too good to be true. The building of a Linux VDR box to record U.S. television shows is hampered by the fact that U.S. stations broadcast their signals differently from European ones. The DVB cards used in Europe (which VDR is written to interface with) are not compatible with U.S. broadcasts. VDR works only with the DVB-S, DVB-C, and DVB-T models supported by the Linux DVB driver. These cards are for (respectively) satellite, cable, and terrestrial broadcasts in the European market.
Additionally, unlike TiVo, VDR cannot record analog (non-digital) broadcasts (whether they are in the U.S. or the European format) that a TV tuner PC add-on card receives. In its present release, VDR receives and records only digital satellite TV broadcasts.
Furthermore, almost every U.S. digital satellite TV transmission is encrypted, and VDR does not have the capability to decrypt them. (Europeans enjoy plenty of "free-to-air" broadcasts.) To work around this, Schmidinger is currently rewriting parts of the VDR code so that other programmers can easily implement connections to alternative sources of video data. Interfacing VDR to a proprietary box, like a U.S. DirecTV receiver, could then most likely be accomplished through an MPEG2 encoder card, not directly. So the analog audio/video-out signal of the set-top box would be fed to the input jack of the MPEG2 encoder card, and VDR would then record the resulting digital MPEG2 data stream.
"I just want to make clear that I have no plans to directly interface VDR with any proprietary set-top boxes," says Schmidinger. "The main reason for this being, of course, that these boxes usually have no digital interfaces that are openly accessible."
Schmidinger started development of VDR in late 1999 and released version 1.0 in April 2002. What began as a hobby for him has since evolved into an open source project; several people have contributed to the VDR code base.
While he admits to having no personal hands-on experience using a TiVo, Schmidinger was already wary of one of its features: to use this device, an owner must subscribe to a TV program listing service, which transmits this information to their TiVo through a phone line. "Personally, I don't like the idea of my box being connected to a provider via telephone," says the 43-year-old electrical engineer. "You never know what kind of information is transferred -- in both directions! I wouldn't want to use a box that I don't have completely under control."
Now for the good news: needless to say, Schmidinger designed VDR so that the user is fully in control. For example, to eliminate the need for such a personal video recorder to be connected to an outside provider, VDR compiles its TV program listings from the Electronic Program Guide (EPG) information found in the standardized data stream that already comes from a satellite, cable, or terrestrial TV broadcast. See Figure 2. Schmidinger incorporated a code library written by Rolf Hakenes into VDR to decode this EPG data.
Figure 2: A TV program schedule shown on Video Disk Recorder's on-screen menu.
VDR records TV broadcast signals as MPEG2 format, but the program doesn't actually do any compressing. The broadcast video/audio data itself is already compressed by the station as MPEG2. VDR simply performs some repacking on the data packets in a process that is really only a matter of changing packet sizes and header information. VDR then stores these recordings under the normal Linux filesystem, making them fully accessible to users to do with whatever they please.
A major selling point that TiVo boasts is its ability to pause a program as you watch a TV broadcast. VDR can do this, too, but it needs two DVB cards to pull this off: one to record the signal and the other to replay. This second card can be a lower-cost model that features only the ability to record and doesn't contain an MPEG2 decoder for playback.
VDR also has the ability to skip over commercials in one-minute intervals -- and to edit them out entirely. You can mark the beginning and end points of every commercial break and VDR will then generate a quick-edit version of the recording, with the commercials removed. Obviously, U.S. TV network executives won't be happy with this feature, if future versions of VDR are able to record U.S. broadcasts.
Besides video recording, VDR can be used for other tasks. Because the software can execute user-defined commands in a Linux shell, a lot of home automation can be performed thru a TV screen. Schmidinger has set up his email server so that it sends a message to his own Linux VDR box whenever there is new email for him.
"You could control the temperature of your hot tub, turn on the light in a room -- anything that could be done through some interface that converts a function call into some electrical action or vice versa," says Schmidinger. "All that such a script would need to do is call some function that initiates the action, and eventually write some resulting output -- if any -- to its
stdout channel. The text written to
stdout will then be displayed on the TV screen."
The versatility of VDR will be expanded upon in the software's next release with the implementation of user-created plug-ins. This will allow other programmers to implement features to VDR without needing to patch the core code. Plug-ins presently under development include a DVD player, a Teletext display, an MP3 player, and an image file viewer. Though nobody is working on it right now, Schmidinger says a plug-in to support analog TV tuner cards would be doable. (An interface to make VDR work with a TV tuner card would need to convert the analog signal to MPEG2 format as it is received in real-time.)
With this plug-in version to come, the possibilities for VDR could become quite scary for the TV network executive. Theoretically, Linux VDR users could connect their boxes to one another in P2P fashion over a broadband connection to "share" the TV programming they have recorded. Along with the ability to knock out commercials entirely, this is a probable use (abuse?) of digital video recording technology that U.S. TV networks want to quash from devices like TiVo.
However, maybe these execs should relax a little. Schmidinger thinks that most TV watchers will prefer a TiVo or a similar commercially-sold, set-top instead, despite the outside controls and limitations imposed upon these devices:
"A TiVo is probably best for TV consumers who don't want to go into any technical details. They just want a box that records stuff and plays it. VDR is more for people who like to program their box to do exactly what they want."
Like not recording bad British sitcoms.
Howard Wen is a freelance writer who has contributed frequently to O'Reilly Network and written for Salon.com, Playboy.com, and Wired, among others.
Return to the Linux DevCenter.
Copyright © 2009 O'Reilly Media, Inc.