Capturing multiple webcams (uvcvideo) with OpenCV on Linux

前端 未结 7 1177
时光取名叫无心
时光取名叫无心 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:44

    With kernel 4.15.0-34-generic on Ubuntu 18.04 and OpenCV 3.4 compiled with gstreamer/v4l support I am able to stream 3x720p on a single USB port using a powered hub using MJPG compression with gstreamer in python (using 2xC922 and 1xC920 cameras - the 10fps framerate isn't necessary for this to work):

    def open_cam_usb(dev, width, height):
        gst_str = (
            "v4l2src device=/dev/video{} ! "
            "image/jpeg,widh=(int){},height=(int){},framerate=10/1,"
            "format=(string)RGB ! "
            "jpegdec ! videoconvert ! appsink"
        ).format(dev, width, height)
        return cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER)
    
    0 讨论(0)
提交回复
热议问题