Configuring explicit webcam with two webcams

Camera models
Logitech C920 and Logitech C310

What is the problem?
When I set camera_usb_options with a -d in the configuration file, the log reports that it is not set ("USB device was not set in options")

For example in my octopi.txt file, I have:

camera_usb_options="-r 640x480 -f 10 -d usb-046d_HD_Pro_Webcam_C920_C364D97F-video-index0"

In the log, it states that:

config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0

When mjpg streamer is run, the log shows -d twice

Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n --listen 127.0.0.1 -i input_uvc.so -r 640x480 -f 10 -d usb-046d_HD_Pro_Webcam_C920_C364D97F-video-index0 -d /dev/video0

What did you already try to solve it?
1.) I am following the multiple camera tutorial:

2.) I ran ls /dev/v4l/by-id/ to get my devices:

usb-046d_081b_B709CD50-video-index0
usb-046d_081b_B709CD50-video-index1
usb-046d_HD_Pro_Webcam_C920_C364D97F-video-index0
usb-046d_HD_Pro_Webcam_C920_C364D97F-video-index1

3.) I modified /boot/octopi.txt and created /boot/octopi.conf.d/webcam2.txt using nano
[I renamed the files from .txt to .log because the website is preventing me from uploading .txt files]
octopi.log (2.9 KB)
webcam2.log (2.9 KB)

4.) The log files show that mjpg_streamer is trying to run two -d commands

Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n -p 8081 -i input_uvc.so -r 640x480 -d usb-046d_081b_B709CD50-video-index0 -d /dev/video1

The -d /dev/video1 is overriding the -d usb-046d_081b_B709CD50-video-index0
My second camera is using /dev/video2.

5.) Running v4l2-ctl --list-devices shows the following:

HD Pro Webcam C920 (usb-3f980000.usb-1.2):
/dev/video0
/dev/video1

UVC Camera (046d:081b) (usb-3f980000.usb-1.4):
/dev/video2
/dev/video3

6.) Currently only the main camera works because it defaults to /dev/video0. The second camera defaults to /dev/video1 which is the wrong /dev. I cannot figure out why octopi is not recognizing my -d commands in my configuration files.

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
webcamd.log (3.8 KB)

Additional information about your setup (OctoPrint version, OctoPi version, ...)
OctoPrint version : 1.7.3
OctoPi version : 0.18.0

Comments
I feel like I am missing something small or simple, but I cannot pinpoint it. Thanks in advance for the help!

You have not followed the guide correctly - you need the full path to the device. You've not given it a valid path when you put -d usb-046d_HD_Pro_Webcam_C920_C364D97F-video-index0.

In the guide:

1 Like

Thanks for your quick response! I got it working!