How to install linux webcam ?

Any word after the directory line and # sign such as "/home/user #" is a command line you have to type or copy and paste then press the key.

1. Login as root: Enter su then your root password at the command line:

/home/user # su
/home/user # userRootPassword
user directory /home/user becomes root directory:
linux:/home/user #

2. Check the vendor ID, product ID, and name of your webcam :

linux:/home/user # lsusb

You will see the manufacturer name of your webcam such as: OmniVision Technologies, Inc, follow by Vendor ID 05a9 and Product ID: a518 from the group 05a9:a518 as shown below:

Bus 002 Device 003: ID 05a9:a518 OmniVision Technologies, Inc.

If you can't use lsusb by the lack of usbutil, then use command below, you will see the names of webcam manufacturer, vendor ID, and product ID in table:

Linux:/home/user # cat /proc/bus/usb/devices

T: Bus=02 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
>>>>>> P: Vendor=05a9 ProdID=a518 Rev= 1.00
>>>>>> S: Manufacturer=OmniVision Technologies, Inc.
S: Product=USB Camera
C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=ov511
E: Ad=81(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms

3. Look for your webcam driver from the link:
Example: Camera name Vimicro, vendor ID and product ID: 0x0ac8 0x303b, and driver name spca5xx/LE:

Vimicro 176 0x0ac8 0x303b Generic Zc0301p PB330 _ jpeg spca5xx/LE gspca v4l1/v4l2

You can download the new driver ov51x then remove the old before install the new OV51x:

Write a note or copy driver name: spca5xx/LE gspca v4l1/v4l2 from website :

4. Download driver into your directory:
Type the command wget and paste address in the same line from 2 lines below, (break for missing characters by ...):

Linux:/home/user # wget

5. Untar your pack:

Linux:/home/user # tar -xzvf gspcav1-20071224.tar.gz

6. Change directory with the name of driver gspcav1-20071224 without extension tar.gz from gspcav1-20071224.tar.gz:

Linux:/home/user # cd gspcav1-20071224
Linux:/home/user/gspcav1-20071224 #

7. Install:
7.1. Check make file:
Enter ls to see if you have file name "make", if you have only Makefile then try to Makefile at the command line:

Linux:/home/user/gspcav1-20071224 # ls

If it doesn't work then look for "make" with the command "whereis":

7.2. Look for make:
Linux:/home/user # whereis make

You may have this table:

Linux:/home/user #
/usr/bin/make /usr/share/man/man1/make.1.gz

7.3. Change directory which has "make" from above directory:

Linux:/home/user # cd /usr/bin

7.4. Copy make to the directory with driver gspcav1-20071224 :

linux:/usr/bin # cp make /home/user/gspcav1-20071224

You can copy without change your directory:
cp /usr/bin/make /home/user/gspcav1-20071224/make

(try ln -s /usr/bin/make /home/user/gspcav1-20071224)

7.5. Change directory:
linux:/home/user# cd gspcav1-20071224
linux:/home/user/gspcav1-20071224 #

7.6. Configure: Prepare for install:

linux:/home/user/gspcav1-20071224 # sh configure

If you don't have error then type make:
linux:/home/user/gspcav1-20071224 # make


7.7. Final install:
linux:/home/user/lgspcav1-20071224 # make install

If you don't have error by dependencies:

7.8. Reboot computer.

8. Check video driver:

linux:/home/user/gspcav1-20071224 # dmesg | grep video

Boot video device is 0000:01:00.0
Linux video capture interface: v1.00
drivers/usb/media/ov511.c: USB OV518+ video device found .

9. Check to add video devive video0:
linux: /home/user # ls -l /dev

You may have them as show:

lrwxrwxrwx 1 root root 6 2008-11-05 06:38 video -> video0
crw------- 1 user video 81, 0 2008-11-05 06:38 video0
crw------- 1 user video 81, 1 2008-11-05 06:38 video1

Look for video0 near the bottom of the list, if you don't have it then add video device video0, after change directory:

linux: /home/user # cd /dev

linux: /dev #
Type after # the below line:
linux: /dev # mknod /dev/video0 c 81 0

and check video1 if you have a second camera, if you don't have it then add:
linux: /dev # mknod /dev/video1 c 81 0

Add permission for both:
linux: /dev # chmod 600 video0
linux: /dev # chmod 600 video1

10. Check photo:
linux: /home/user # streamer -c /dev/video0 -b 16 -o outfile.jpeg

You may have few lines such as:
files / video: JPEG (JFIF) / audio: none
....... 0/0, video 1/16, convert 1/16

You have the photo file outfile.jpeg in the directory where you entered the command "streamer", let check it by:
linux: /home/user # ls

or you may open Konqueror with this directory /home/user :
You may see this photo file name and detail:

outfile.jpeg...........................................................7.5 KB JEPG Image
Click on photo file outfile.jpeg to view it. You may not have a clear photo, so:

11. Check video:
Assume that you have a second device video1 for ADS USB Instant VCD:
linux:/home/user # streamer -q -c /dev/video1 -f rgb24 -r 3 -t 00:30:00 -o

You may have this error by the wrong user name:
open /home/user/outfile.avi: No such file or directory
movie writer initialisation failed.

If the lead light of the adapter is on and the blinked cursor is not at the
command line, you can check video by click on outfile.avi in the Konqueror
with address /home/user to automaticly view video by Kaffeine player.

12. Stop video:
Press Ctrl + Z keys to stop recording video.

You may have the red lead of adapter is still turning on, to stop it you may enter ps in the command line to know the Process ID (PID) number of your video:

linux:/home/user # ps

You may see 5 lines:

6610 pts/4 00:00:00 su
6625 pts/4 00:00:00 bash
6643 pts/4 00:00:00 streamer
6806 pts/4 00:00:00 ps

Noting the PID number 6643 at the line with the word streamer, type it with command kill -9 into command line to manually turn off adapter ADS:

linux:/home/user # kill -9 6643

13. Activate motv:

To view webcam video0 or TV and video with ADS USB Instant VCD by video0 and the motv, let activate motv:

linux:/home/user # motv -c /dev/video0

or you can exchange or shift the usb plug between video0 and video1

linux:/home/user # motv -c /dev/video1

Remember to chmod 600 /dev/video0 and /dev/video1 at root directory.

14. Open motv:
From the kde menu at the lower left corner, click on Multimedia then motv to automaticly view video webcam by motv.

15. Turn off motv:
You just click on x mark at the upper right corner of motv window, or choose quit from motv menu to turn off motv and ADS USB Instant VCD adapter.

If you view webcam by Kaffeine and turned off Kafeine player, your webcam may busy, if your webcam doesn't have the lead light, you can let it run without screen on so the others can not use two video devices at the same time!

If the ProductID of your webcam was not listed but the Vendor ID is, you can edit the file such as(gspcav_core.c)then look for the same Vendor ID and add your new Product ID after adding the or (||) statement to try a new webcam model.

From this address /home/used/outfile.avi, you can upload video to the internet by the perl script! For the other camera which has the video out for yellow jack of the AV cable, you may use it to connect from the Linus driver which listed your ADS Instant VCD Adapter, and use this adapter to view any new camcorder as a webcam for a better zoom, or buy the IP camera without modify the Linux webcam driver.

If your camera is not listed in the above driver or you can't use ADS Instant VCD or DVD adapter, but you have a Fujitsu camera, you can edit below driver by download then untar for stream.c file from Mishoo, and replace camera Product ID from A310 to your product ID:

Look for below line to edit and change from 0x0125 to 0x0104 such as:
if (dev-descriptor.idProduct == 0x0125 /* Fuju Finepix A310 */ /* exemple Fuji Finepix 2600, 0x0104 is your product ID*/

More on Mishoo webcam

Back to Index

Good luck!

Reference: Setting up your webcam under SuSE-OpenSuSE 10.3