I want to access both cameras as webcam camera feeds using OpenCV. Is that possible? Do I need to separately run teo rgb_uvc.py or can I access it both together?

    Hi SadiaC
    Not sure actually, maybe instantiating two UVC nodes might be able to achieve that. I'll check.

    Thanks,
    Jaka

    Hi, thank you! I generally wanted to access video stream from two cameras. Is there any other option to access it without the uvc node? I just want the raw video footage thats it

      SadiaC
      UVC node makes it so the host recognizes the device as a USB webcam. The only other option you have is standard frame streaming method using xlink. But as you wish to use the device as webcam, there is no other way of doing it (maybe rtsp streaming or something similar could work).

      Thanks,
      Jaka

        jakaskerl Okay thank you! So do you think two uvc nodes would work to access them as two different webcams from two different cameras?

          Hi SadiaC
          Checked, and no, you can't use two UVC nodes.

          [19443010513F4D1300] [0.1.2] [0.809] [UVC(3)] [warning] More than one UVC instance is not properly supported - all packets will be sent to the same USB UVC interface

          Thanks,
          Jaka

          Hi is there any other way i would be able to access both the cameras? How about by using xlink to access both the camera? Or can i do one each? One with uvc node and another with xlink node?

            Hi SadiaC
            Streaming with Xlink node is the standard way of accessing frames/messages from the device. You can create as many streams as you wish as long as there is bandwidth available on your usb cable.
            But it won't function as a webcam.

            EDIT: Just re-reading through, we are talking about two cameras on a single Oak-D-lite, not one camera on two OAK-D-lite devices right?

            Thanks,
            Jaka

            Hi, thank you for your reply. Sorry I wasn't clear, I am using a Jetson Nano as a host and I want to access videos from two different Oak D lite cameras. Since I only want the video footage and not the depth or detection stuff, I thought the approach should be to access the two cameras as webcams. But now that you mention it, I can use Xlink nodes instead, right?

              Thank you! I have tried using XLink and following the instructions that you sent. I only get one camera to be recognized and the other one gives this error

              with dai.Device(pipeline, device_info) as device:

              RuntimeError: Device already closed or disconnected: io error

                Yes, I am using the latest depthai. I have depthai-2.23.0.0. I tried the script again, I got these errors:

                [ WARN:2@5.574] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (464) `anonymous-namespace'::SourceReaderCB:😮nReadSample videoio(MSMF): OnReadSample() is called with error status: -2147024809

                [ WARN:2@5.577] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (476) `anonymous-namespace'::SourceReaderCB:😮nReadSample videoio(MSMF): async ReadSample() call is failed with error status: -2147024809

                [ WARN:1@5.580] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (1752) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147024809

                Error: Could not read frame.

                I have now changed the usb cables, it now works if I try to open it separately but when running the script that you sent for multiple devices, ( luxonis/depthai-experiments/blob/master/gen2-multiple-devices/main.py), I get the following errors. It does recognise two devices but only shows one of them:

                Found 2 devices

                C:\Users\sadia\depthai-python\depthai-python\examples\ColorCamera\MultiCamera.py:31: DeprecationWarning: Use constructor taking 'UsbSpeed' instead

                device: dai.Device = stack.enter_context(dai.Device(openvino_version, dev_info, False))

                === Connected to 1844301021AD0E1300

                MXID: 1844301021AD0E1300

                Cameras: CAM_A CAM_B CAM_C

                USB speed: SUPER

                C:\Users\sadia\depthai-python\depthai-python\examples\ColorCamera\MultiCamera.py:19: DeprecationWarning: RGB is deprecated, use CAM_A or address camera by name instead.

                cam_rgb.setBoardSocket(dai.CameraBoardSocket.RGB)

                Exception in thread Thread-2:

                Traceback (most recent call last):

                File "C:\Users\sadia\anaconda3\envs\v7\lib\threading.py", line 980, in _bootstrap_inner

                self.run()

                File "C:\Users\sadia\anaconda3\envs\v7\lib\threading.py", line 917, in run

                self._target(\*self._args, \*\*self._kwargs)

                File "C:\Users\sadia\depthai-python\depthai-python\examples\ColorCamera\MultiCamera.py", line 31, in worker

                device: dai.Device = stack.enter_context(dai.Device(openvino_version, dev_info, False))

                RuntimeError: Device already closed or disconnected: io error

                  Hi SadiaC
                  Do you have access to a PC/laptop that has depthai installed, and that you could try running the script on? Maybe the Jetson has a weird way of handling multiple devices.

                  Thanks,
                  Jaka

                    jakaskerl Hi, I have done this on a laptop before trying it on the jetson. So the issues I am facing are on the laptop currently