Capturing multiple webcams (uvcvideo) with OpenCV on Linux

前端 未结 7 1192
时光取名叫无心
时光取名叫无心 2020-12-03 01:56

I am trying to simultaneously stream the images from 3 Logitech Webcam Pro 900 devices using OpenCV 2.1 on Ubuntu 11.10. The uvcvideo driver gets loaded for these.

C

7条回答
  •  一整个雨季
    2020-12-03 02:19

    Most likely there is USB bandwidth contention reported by the driver of the video capture device. Check if the pixel format is YUYV, which happens to be uncompressed. On the contrary, if the pixel format is MJPG (compressed), it is possible to have multiple devices on the same USB channel.

    v4l2-ctl -d /dev/video0 --list-formats
    

    The output would be something like below:

    ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'YUYV'
        Name        : 16bpp YUY2, 4:2:2, packed
    

    The following are the possible solutions:

    1. Use capture devices from different manufacturers such that the drivers loaded are different. Generally the same driver handling multiple devices need to handle the bandwidth effectively.
    2. Use a PCI USB extension card if available to attach the 2nd USB video capture device. This workaround worked excellently for me when I tried attaching AVerMedia DVD EZMaker 7 that loaded the driver cx231xx.

提交回复
热议问题