Linux webcam

From JasonAntmanWiki
Jump to: navigation, search

I have a CP Technologies gooseneck "snake" webcam. It cost me about $20 on Amazon a few years ago. Cheap and poor image quality, but it works.

I had it installed on an older laptop, but now wanted to use it for development with barcode decoding.

This particular webcam shows up, through dmesg, as a Pixart CIF Single Chip, vendor ID 093a and product ID 2468.

The full demsg output when plugging in the webcam was:

ohci_hcd 0000:00:03.1: wakeup
usb 2-1: new full speed USB device using ohci_hcd and address 2
usb 2-1: new device found, idVendor=093a, idProduct=2468
usb 2-1: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1: Product: CIF Single Chip
usb 2-1: Manufacturer: Pixart Imaging Inc.
usb 2-1: configuration #1 chosen from 1 choice

Software Installation

Through the compatibility list at http://mxhaard.free.fr/spca5xx.html I was able to determine that it works under the spca5xx driver with gbrg stream.

My target machine is an AMD x86_64 (Athlon 64) laptop running OpenSuse 10.2. I searched through YaST Software Management (I have a ***load of repositories installed) but didn't turn anything up. After following a HOWTO I happened to find here I added a HTTP repository on software.opensuse.org with directory /download/drivers:/webcam/openSUSE_10.2_Update_standard/. I then opened the Software Management tool (all of this just because I didn't want to deal with finding the correct package for the kernel I happen to be running) and searched for "spca". I selected the "spca-5xx-kmp-default-20060501_2.6.18.8_0.7-13.4.x86_64.rpm" package and installed it.

Once this was done, I plugged in the webcam. The output of dmesg was now:

usb 2-1: new full speed USB device using ohci_hcd and address 3
usb 2-1: new device found, idVendor=093a, idProduct=2468
usb 2-1: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1: Product: CIF Single Chip
usb 2-1: Manufacturer: Pixart Imaging Inc.
usb 2-1: configuration #1 chosen from 1 choice
Linux video capture interface: v2.00
/usr/src/packages/BUILD/spca5xx-20060501/obj/default/drivers/usb/spca5xx.c: USB SPCA5XX camera found. Pixart PAC207BCA
/usr/src/packages/BUILD/spca5xx-20060501/obj/default/drivers/usb/spca5xx.c: [spca5xx_probe:5479] Camera type GBRG
/usr/src/packages/BUILD/spca5xx-20060501/obj/default/drivers/usb/spca5xx.c: [spca5xx_getcapability:1764] maxw 352 maxh 288 minw 160 minh 120
usbcore: registered new driver spca5xx
/usr/src/packages/BUILD/spca5xx-20060501/obj/default/drivers/usb/spca5xx.c: spca5xx driver 00.60.00 registered

So we know that the camera is recognized. Running ls -l /dev/vid* shows something like:

lrwxrwxrwx  1 root root      6 2007-12-13 02:30 /dev/video -> video0
crw-rw----+ 1 root video 81, 0 2007-12-13 02:30 /dev/video0

so we see that the device (as per the default) should be at /dev/video0. Note that group ownership is the group "video", so your user should be a member of that group.

For the rest of the setup, I consulted the linux.com Webcam HOWTO. All I need to do right now is capture through a script, so streamer, part of Xawtv would do. Back to YaST and Software Management for an install. As suggested in the Linux.com article, I took a stab and installed the Xawtv package, hoping that streamer was included. Unfortunately, it wasn't. Searching http://rpm.pbone.net showed that, for OpenSuSE 10.2, it was in the v4l-tools package. I installed that.

Once streamer was installed, I gave it a quick test with

streamer -c /dev/video0 -b 16 -o outfile.jpeg

and viola! A picture.

To see what I did with the webcam, take a look at my barcode decoding page.

Views
Notice - this is a static HTML mirror of a previous MediaWiki installation. Pages are for historical reference only, and are greatly outdated (circa 2009).