Introduction

Introduction

During the 1990s, the personal computer underwent a radical transformation, entering the decade as an information processing device, suitable only for word processing and spreadsheets. By the turn of the century, the PC had become a media machine, playing music and movies, games, DVDs, and streaming news reports, live from CNN. Part of the reason for this reimagining of the possibilities of the PC came from the exponential growth in processing power, memory, and storage, courtesy of Moore s Law, which effectively states that computers double in CPU speed every 18 months.

Although Moore s Law might have enabled the age of PC-as-media-machine, it took an entirely new class of peripherals items such as PDAs, webcams, digital cameras and camcorders, MP3 players, and snazzy cell phones to make the age of media computing absolutely inevitable. Before the digital camcorder, only folks like Steven Spielberg and George Lucas had the resources and capability to edit films on a computer. Today just about any PC users can make their own movies using Microsoft Windows Movie Maker, Adobe Premiere, or any of a hundred other applications. These films can be posted to a Web site, enclosed within an e-mail message, or even distributed on DVDs with cinema-quality images and full surround sound, making it increasingly easy to create Hollywood movies at home.

In this revolution of media machines, nothing s changed as radically as recorded music. In 1990, the compact disc was still coming into its own. A decade later, CDs seem to be on their way out (for music, anyway), having been supplanted by newer formats such as MP3, Windows Media, and RealAudio, which deliver the same sound quality with a lot less storage. An album that used to take up 700 MB on a CD can be ripped into a 64-MB MP3 or Windows Media file, written out to a flash memory card, and popped into a computer, PDA, or MP3 player. As MP3s caught on as a format to encode and exchange music, song-swapping services such as Napster and Gnutella began to appear to the consternation of record companies around the world. Music has become so easy to transport that even downloading it over a dial-up modem (which isn t fast by today s standards of connectivity) happens millions of times each day.

A lot of software underlies this revolution in the way PCs deal with media. It s software that captures video or audio data, stores it, encodes it in bandwidth-intensive or bandwidth-sparing formats, and allows it to be edited and viewed. Without that layer of software, your computer would behave very much as it did in 1990 (albeit many times faster), confined to the dull tasks of mincing words and balancing books.

The internal details of many media formats are closely guarded pieces of information (for competitive purposes), and they re also not all that easy to understand. Nearly every encoding method employs sophisticated techniques of mathematical analysis to squeeze a sound or video sequence into fewer bits. In the early days of media programming for the PC, you d have to master these techniques for yourself a process that could take months, or even years.

It would be vastly preferable if the PC itself offered a set of services to handle the details of capturing, encoding, editing, decoding, and playback of audio and video signals. With that kind of help, a programmer could focus on the details of a media application without having to worry about endless, detailed specifics that could slow the job of writing an application to a crawl.

I confronted just this conundrum in October 2001. I had a great idea: I wanted to write some code that could transform a standard consumer-level digital camcorder into a backup device for my PC. The miniDV tapes used by these camcorders can store up to 18 GB of data the equivalent of nearly 30 CDs!

When I started to work on my project, I had no idea how to use software to control my digital camcorder, nor how I could read data from the camcorder into the computer or write it out. I studied the documentation for Microsoft DirectX a collection of multimedia technologies distributed as core parts of the operating system and found that most of the problem had already been solved for me. Microsoft DirectShow a set of DirectX interfaces designed specifically for video and audio provided everything I needed to control my digital camcorder. Because of DirectShow, I could focus on the unique part of my application writing data from the disk to the camcorder and restoring it while DirectShow handled all the communication with my camcorder. I d originally estimated that the job would take two months to complete. Instead, I finished in just two weeks! With a working prototype of my original idea, I could begin the process of patenting my invention. (With a bit of luck, in a few years, I ll have been granted a patent on the idea.)

Although DirectShow is very useful, the documentation included with the DirectX Software Development Kit (SDK) is quite technical, designed for the advanced user of DirectShow, rather than the rank novice. Therefore, I spent more time puzzling my way through the documentation than I did writing code. I realized that the perfect complement to the Microsoft documentation would be a book that could lead a programmer into DirectShow step-by-step, with useful examples presented as a cookbook of different techniques. So, here it is, Programming Microsoft DirectShow for Digital Video and Television. (I guess Microsoft Press thought it was a good idea, too.)



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