Chapter 5: Capturing Audio and Video from a Webcam

Chapter 5

Capturing Audio and Video from a Webcam

Webcams have become nearly ubiquitous peripherals for today s PCs. They re inexpensive and produce video imagery of varying quality often dependent on how much the webcam cost or how fast your computer runs. Furthermore, you don t have to do much to set up a webcam: just plug it into an available port, and you re ready to go. Windows XP provides desktop-level access to webcams (and all digital cameras attached to the computer) through Windows Explorer; here you can take single frames of video and save them to disk as photographs.

A webcam appears as a video input source filter in DirectShow. Like the audio input source filters we covered in the last chapter, the webcam produces a stream of data that can then be put through a DirectShow filter graph. Some webcams particularly older models capture only video, relying on a separate microphone to capture audio input. Many recent versions of webcams, including the Logitech webcam I have on my own system, bundle an onboard microphone into the webcam, and this microphone constitutes its own audio capture source filter.

For this reason, DirectShow applications will frequently treat webcams as if they are two independent devices with entirely separate video and audio capture components. That treatment is significantly different from a digital camcorder, which provides a single stream of multiplexed audio and video data; that single stream of digicam data is demultiplexed into separate streams by DirectShow filters. Although this treatment makes webcams a tiny bit more complicated to work with, their ubiquity more than makes up for any programming hoops you ll have to jump through.



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