Multicam connection of 2 SAME model usb-webcams

Hi,

Quick question....

I am using ocoptint in my Raspberry pi. I have 2 webcams, and I want to plug in both and see them with multicam.

  1. So I go to cd /boot/camera-streamer.
  2. plug in the usb webcam
  3. run sudo add-usb-camera
    and I add it.

THE PROBLEM IS THAT WHEN I DO THE SAME FOR THE SECOND WEBCAM, I DON'T SEE IT BECAUSE THE 2 CAMERAS HAVE THE SAME NAME: such as /dev/v10/by-ip/usb-CAM-video-index0

I already try to change the name of one, but every time I reboot it reset... so the 2 webcams collide in to one.
I also tried to assign to one index0 and the other index1.
BUT I CAN ONLY SEE ONE CAMERA... ONLY BECAUSE THEY HAVE THE SAME "NAME" IN /dev/.../by-ip

How can I solve it? did someone had similar problem?

I know that my procedure is correct because as soon as I change the second camera to a camera with diffrent name that shows up when I do sudo add-usb-camera then in octopring interfaces I can see both cameras using http://AP_ADDRES:8081/?action=stream and http://AP_ADDRES/webcam/?action=stream

Send command:
sudo v4l2-ctl --list-devices

At the bottom it should give you the index of each camera, mine;
USB2.0 PC CAMERA: USB2.0 PC CAM (usb-3f980000.usb-1.1.3):
/dev/video2
/dev/video3
/dev/media4

USB2.0 PC CAMERA: USB2.0 PC CAM (usb-3f980000.usb-1.2):
/dev/video0
/dev/video1
/dev/media3

video0 and video2 worked for me...

Note: if you plug them into a different usb port, things will change.

Let us know how it goes,
-JC

I pointed out that this would be an issue with the new camera stack way back when.
I solved this in octoprint_deploy by having an option that forces detection by USB port and writing a udev rule.
Something like: SUBSYSTEM=="video4linux",KERNELS=="YOURUSBPORT", SUBSYSTEMS=="usb", ATTR{index}=="0", DRIVERS=="uvcvideo", SYMLINK+="camera_name"
Where YOURUSBPORT is the physical address the port you are going to keep your camera plugged in. Then your camera will always be at /dev/camera_name (change that for both, obviously)

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.