O'Reilly logo

Linux Multimedia Hacks by Kyle Rankin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #97. Star in Your Own Reality TV Show

Install and use common USB webcams under Linux.

Webcams have a variety of uses, from video conferencing to surveillance to just showing your friends what you are doing at the moment. Linux support for webcams, particularly USB webcams, is pretty good, provided you know where to look. Once the webcam is installed, there are a lot of programs available to take quick snapshots, automatically upload images to a server periodically, and even turn your webcam into a motion detector. In this hack, I cover the general steps you need to install a webcam under Linux, and highlight some of the popular Linux webcam applications.

Install the Webcam

The first and most difficult step to installing a webcam is figuring out which Linux module it uses. There are a number of webcam modules built into the standard kernel series, but there are also quite a few that aren't, so the sort of detective work you need to do will vary depending upon your webcam. Before you do too much detective work though, just plug in your webcam and check the output of dmesg to see if your system automatically recognizes your webcam. Here is some sample dmesg output showing a webcam being recognized.

	$ dmesg … usb 1-1: new full speed USB device using uhci_hcd and address 3 Linux video capture interface: v1.00 /home/greenfly/src/spca5xx-20050701/drivers/usb/spca5xx.c: USB SPCA5xx camera found. Type Labtec Webcam (unknown CCD) /home/greenfly/src/spca5xx-20050701/drivers/usb/spca5xx.c: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required