# How install USB digital camera?

## pmam

I am trying to install an old and simple digital mini camera (can be webcam) - 

However looks something is missing: maybe should add any driver to kernel? 

How can see this device with ls -l /dev command? What letters should it show up in the list?

How can I see the picture: maybe it is working after all...

Here outputs: 

```
lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 005 Device 008: ID 2770:9120 NHJ, Ltd Che-ez! Snap / iClick Tiny VGA Digital Camera

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 003 Device 003: ID 046d:c03e Logitech, Inc. Premium Optical Wheel Mouse (M-BT58)

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
```

dmesg:

```
USB disconnect, device number 7

[22324.896040] usb 5-2: new full-speed USB device number 8 using uhci_hcd

[22325.050169] usb 5-2: New USB device found, idVendor=2770, idProduct=9120

[22325.050175] usb 5-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0

[22325.050179] usb 5-2: Product: USB DIGITAL STILL CAMERA
```

----------

## pilla

Have you tried to access the camera using any software?

----------

## pmam

pilla Hi,

I just added a line to my previous post: 'How can I see the picture: maybe it is working after all...'   :Smile: 

I tried to see it with vlc and smplayer, but do not see it and do not know the name of the camera should be there...

Please advise what software is needed?

Thanks

----------

## xaviermiller

Did you enabled the uvc kernel module ?

----------

## pmam

I hope you mean to this kernel's info and it looks ok:

```
Symbol: USB_CONFIGFS_F_UVC [=y]

Symbol: USB_F_UVC [=m]
```

----------

## Jaglover

/dev/video0

----------

## pmam

```
ls -l /dev/video*

ls: cannot access /dev/video*: No such file or directory
```

----------

## Jaglover

See here, it is not a UVC camera: http://ubuntuforums.org/showthread.php?t=435463

----------

## Syl20

Once installed, you can run cheese to test your webcam. It's very light.

----------

## chithanh

A grep for your device's vendor and product ID in kernel finds one hit:

```
drivers/media/usb/gspca/sq905.c:        {USB_DEVICE(0x2770, 0x9120)},
```

This agrees with what is written in the Ubuntu forums. So enable CONFIG_USB_GSPCA_SQ905 in your kernel (you can press / in menuconfig to search).

To test your webcam you can use mpv if built with USE="v4l" and run as a user who is member of the video group:

```
$ mpv --tv-device=/dev/video0 tv://
```

----------

## pmam

chithanh,

I added CONFIG_USB_GSPCA_SQ905 and CONFIG_USB_GSPCA_SQ905C to kernel and will compile it right after finish installing cheese software.

Meanwhile please note grep command you did in order to get this info? I need it for next time of such issue... 

 *Quote:*   

> A grep for your device's vendor and product ID in kernel finds one hit:

 

I would not get this info from Ubuntu forums without your advise...

Will be continued...

Thanks

----------

## Jaglover

FYI I put "2770:9120 linux" in google and Ubuntu was the first hit. I'm surprised you didn't see this: $ sudo modprobe -v gspca_sq905

----------

## pmam

After adding CONFIG_USB_GSPCA_SQ905 and CONFIG_USB_GSPCA_SQ905C to kernel it still not working...

EDIT: Just a momant... looks that kernel was not compiled

----------

## pmam

OK - I found out that kernel was old ver and was not compiled (by any mistake...) - 

and now it is after compilation and camera is working ok    :Smile: 

 *Quote:*   

> I'm surprised you didn't see this: $ sudo modprobe -v gspca_sq905

 

I did not see it and not so familiar with modules and drivers,

so I would not figure out the meaning of this data... Now  I learned something for the next time: How to use other Linux's dist for Gentoo issues...

Also it is a good idea to search device's vendor and product ID in kernel like chithanh showed - 

Can you please note the exact grep command for this info?

Thanks

----------

## chithanh

The grep command I used was

```
/usr/src/linux $ grep -r "2770.*9120" drivers/
```

If it doesn't turn up anything, you can search for the product ID individually, but that may return some false positives.

----------

## pmam

chithanh,

It is very helpful

Thanks a lot

----------

## pmam

I want to record webcam streaming and I saw somewhere that cheese can do it but did not find out how -

Please advise if can record with cheese or need another software?

So far i can see webcam picture with cheese and vlc - mplayer or smplayer do not work and I do not have mpv.

Cheese works nice.

----------

## Buffoon

cat /dev/video0 > outfile

----------

## pmam

```
cat /dev/video0 > outfile
```

It copies video to file but can not play the file with vlc or any player - any other solution?

BTW: I would prefer such recorder with motion detector...

----------

## NeddySeagoon

pmam,

mplayer can record.  See the encode option.

Be aware that raw video wants a lot of space and real time 30 FPS compression wants a lot of CPU power.

Neither are very attractive options.

----------

## pmam

NeddySeagoon,

 *Quote:*   

> mplayer can record. See the encode option.

 

My webcam does not work with mplayer at all (only with cheese and vlc) - need to figure out the right command?

 *Quote:*   

> Be aware that raw video wants a lot of space and real time 30 FPS compression wants a lot of CPU power.

 

That's why I am looking for recording with motion detector..

Thanks

----------

## pilla

I have some students that are doing motion capture using Python. I will ask about it.

----------

## pmam

pilla,

 *Quote:*   

> I have some students that are doing motion capture using Python. I will ask about it.

 

Nice to know! I see some info regarding motion detector (motion, gmotionlive) in this old link for example:

http://ubuntuforums.org/showthread.php?t=1223011

There are two Gentoo's packages - someone have any experience with them?

```
* media-video/motion

     Available versions:  3.2.12-r2 3.2.12-r3 {ffmpeg libav mysql postgres +v4l}

     Homepage:            http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome

     Description:         A software motion detector

* media-video/motiontrack

     Available versions:  ~0.1.3 {debug gd imagemagick multiprocess}

     Homepage:            http://motiontrack.sourceforge.net

     Description:         A set of tools that detect motion between two images
```

Thanks

----------

## pilla

pman, my students are using Python and OpenCV. They said it is pretty straightforward.

----------

## pmam

pilla,

 *Quote:*   

> pman, my students are using Python and OpenCV. They said it is pretty straightforward.

 

Do you mean that we are going to see it in the near future? I am not a programmer, however it would be interesting to see this algorithm... 

Here e.g a stand alone NVR - Embedded LINUX operating system -

'Support manual, auto, dynamic detection, alarm trigger  record mode(Partly needs IPC Support)' -

Maybe they use available software or have their own software:

http://www.banggood.com/ESCAM-Mini-NVR-K208-8-Channel-P2P-HD-Network-Video-Recorder-for-Security-Onvif-Protocol-IP-Camera-p-1050418.html

----------

## pilla

pmam, 

What they are doing involves some programming, but they said it is pretty easy from the tutorials provided by OpenCV.

----------

