Skip to content

USB UVC webcam

Frank Bauernöppel edited this page Jul 16, 2017 · 3 revisions

Many USB cameras can be used instead of the CSI camera, but:

  • expect more latency because of larger USB software stack
  • expect less performane because of the limited USB 2.0 bus performance

USB has a device class for webcams: UVC. Linux supports UVC, see http://www.ideasonboard.org/uvc/. UVC support is included in the RasPi image and works plug-and-play.

Tested with Microsoft LifeCam Studio webcam, when V4L2 driver for CSI camera was also loaded

Connect webcam to USB, check kernel log:

root@raspberrypi3:~# dmesg | tail
[ 4016.669518] usb 1-1.4: New USB device found, idVendor=045e, idProduct=0772
[ 4016.673681] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4016.677794] usb 1-1.4: Product: Microsoft\xffffffc2\xffffffae LifeCam Studio(TM)
[ 4016.681753] usb 1-1.4: Manufacturer: Microsoft
[ 4016.694515] hid-generic 0003:045E:0772.0001: hiddev0,hidraw0: USB HID v1.01 Device [Microsoft Microsoft\xffffffc2\xffffffae LifeCam Studio(TM)] on usb-3f980000.usb-1.4/input4
[ 4016.724801] uvcvideo: Found UVC 1.00 device Microsoft\xffffffc2\xffffffae LifeCam Studio(TM) (045e:0772)
[ 4016.788227] input: Microsoft\xffffffc2\xffffffae LifeCam Studio(TM) as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/input/input0
[ 4016.796404] usbcore: registered new interface driver uvcvideo
[ 4016.800554] USB Video Class driver (1.1.1)
[ 4017.154916] usbcore: registered new interface driver snd-usb-audio

A new video device was created: /dev/video1. This video device works similar to the CSI cam /dev/video0, but there will be differences because different cameras might handle different image sizes, pixel formats, etc.. Check this with video for linux tools.

There may even be differences between different UVC cams, i.e. some might natively support H.264.