Chapter 7: Working with TV Tuners and Pausing Live Video Streams

Chapter 7

Working with TV Tuners and Pausing Live Video Streams

Ever since the emergence of the World Wide Web in the middle of the 1990s, pundits and futurists have predicted the dawn of convergence, an almost mystical state of communion wherein the television, home computer, and entertainment center would become as one, a single device that could carry broadcast media, Internet, video games, movies-on-demand, and so on. Although convergence sounded like a great idea particularly to other pundits and futurists media companies weren t too happy to share the spotlight (and advertising revenues) with the upstart new media companies and did all they could to frustrate the seemingly inevitable combination of old and new media. When AOL purchased Time Warner in early 2000, it seemed as though the age of convergence had finally come; now, some years later, AOL Time Warner seems more of a misconception than a business ideal, and convergence has entered the living room through a Trojan horse the personal video recorder.

The idea behind the personal video recorder, or PVR, is a simple one: take a live analog TV signal, convert it to digital, and then write its data to a high-capacity storage medium, such as a hard disk. Unlike a VCR, there d be no temperamental tapes to fuss with or to jam in the mechanical innards of a machine that few people even know how to program. (Think of all those VCRs in the world that still blink 12:00, and you can grasp the problem.) With a PVR you d get high-quality digital copies of your favorite TV programs, which you d be able to record by scrolling through a schedule of available channels and programming, selecting only those shows you d be interested in watching. For the user interface alone, the PVR represents a quantum leap over the VCR.

In March 1999, the first PVR, TiVo, came to market and it was an immediate success. Including TiVo along with the ReplayTV PVR from SONICblue, Inc., more than a million PVRs have been sold in just the first three years since their introduction, making them among the most successful consumer electronics devices of all time. Both products provide on-demand recording of analog TV signals, which can be played back at any time. Their most interesting feature, however, is the live pause capability they add to TV viewing. With the press of a button, TV programming can be stopped in the middle of a broadcast (which comes in handy if, for example, the phone rings during your favorite episode of The Simpsons ) and resumed with the press of another button. What kind of magic is this?

Basically, the PVR is always digitizing the TV signal and writing it to the hard disk. In normal operation, this stream of digital data is also immediately sent to the TV set. When the unit pauses live TV, the stream of video data continues to be written to the hard disk, while the stream to the TV pauses. Once the PVR re-enters play mode, the stream playback continues from the pause point, while the incoming stream continues to be rewritten to the PVR s disk. This gap between record and playback also makes it possible to skip over commercials (which is why SONICblue was sued by several major TV production companies), and it allows you to rewind a live broadcast, to watch a scene again and again, before resuming your normal viewing. This concept of buffered TV viewing has made the PVR a must-have item for anyone who has had the opportunity to time-shift a TV program.

As you ve already learned, Microsoft DirectShow provides a lot of functionality similar to that provided by a PVR. For example, you can capture a video stream in the filter graph and then write it to disk, while also previewing it to the display. In addition to the features we ve already covered, DirectShow has a number of filters that specifically provide features designed to work with PC-based TV tuner cards. These cards which can be purchased for less than $100 connect to an antenna or a cable TV signal and provide all the hardware needed to decode an analog TV signal, converting it to a digital format that can be manipulated by the PC. These peripherals generally come with software that provides basic PVR features. For example, many of them allow you to record a TV program to an MPEG movie file for later viewing through an associated application, such as Windows Media Player.

Noting the success of the PVR, Microsoft partnered with Hewlett-Packard and Samsung (at the time of this writing), introducing its own Windows XP Media Center Edition product in the autumn of 2002. The Hewlett-Packard product is a PC containing an on-board TV tuner with an integrated MPEG-2 encoder. The MPEG-2 encoder keeps the files nice and small and allows hundreds of hours of video programming to be stored on the system s hard disk. The computer also comes equipped with Windows XP Service Pack 1. This service pack is necessary because it provides a few new DirectShow filters, known as the Stream Buffer components. These components provide the basis for buffered viewing of video signals, just like TiVo.

Now that the Microsoft operating systems have become PVR friendly, we can expect to see an explosion in the use of TV tuner cards in the PC over the next few years, as the convergence promised nearly a decade ago begins to take shape. Windows programmers (and hopefully, more than a few readers of this book) will be able to use these new operating system features to build applications that make TV viewing an integral part of the PC experience; we might even see the day when a Windows-based PVR is just another desktop icon, like Internet Explorer. That s when TV viewing, Internet access, and electronic entertainment converge in an easy-to-use device. That s real convergence.



Programming Microsoft DirectShow for Digital Video and Television
Programming Microsoft DirectShow for Digital Video and Television (Pro-Developer)
ISBN: 0735618216
EAN: 2147483647
Year: 2002
Pages: 108
Authors: Mark D. Pesce

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net