USB webcam no longer video0, but video1 - how to make use of it in OctoPrint?

Camera model
Wyze Cam V2 (converted to USB) - works on my PC

Connected to Raspi 4

What is the problem?

When checking why cam is not working on OctoPrint any more, I realized it's no longer video0, but video1.

mpeg-streamer does not seem to recognize it

What did you already try to solve it?

Checked that my RPi4 recognizes the camera (v4l2-ctl --list-devices) - yes, it does

Changed camera_usb_options="-r 1920x1080 -f 15" - no luck

Although I don't know if I can specify the video id within the camera_usb_options string. Is that possible?

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

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

OctoPi v0.17

Any help for getting my USB cam recognized by OctoPrint?

-d should do it.

Thank you.

Do I need to put in the -d option in the input_uvc.so file, or in octopi.txt at the camera_usb_options string there?

camera_usb_options

Thank you. Is there any way to test it's working?

OK, added video1 at camera_usb_options, but it doesn't work in OctoPi.

Error there, when testing the web cam, is "### Snapshot test failed. Could not retrieve snapshot URL, please double check the URL".

How to trace that down to the root cause and fix it?

upload a picture your octopi.txt - just to be sure there is no typo or formatting error.

Here is the content of my octopi.txt:

# Defaults to auto
#
#camera="auto"

### Additional options to supply to MJPG Streamer for the USB camera
#
# See https://faq.octoprint.org/mjpg-streamer-config for available options
#
# Defaults to a resolution of 640x480 px and a framerate of 10 fps
#
camera_usb_options="-d /dev/video1 -r 1280x720 -f 10"

### Additional options to supply to MJPG Streamer for the RasPi Cam
#
# See https://faq.octoprint.org/mjpg-streamer-config for available options
#
# Defaults to 10fps
#
#camera_raspi_options="-fps 10"

### Configuration of camera HTTP output
#
# Usually you should NOT need to change this at all! Only touch if you
# know what you are doing and what the parameters mean.
#
# Below settings are used in the mjpg-streamer call like this:
#
#   -o "output_http.so -w $camera_http_webroot $camera_http_options"
#
# Current working directory is the mjpg-streamer base directory.
#
#camera_http_webroot="./www-octopi"
#camera_http_options="-n"

Also, this is to check that the Wyze v2 cam is successfully recognized by my Raspberry:

xx@octopi:~ $ sudo v4l2-ctl --device=/dev/video0 --all

Driver Info:
        Driver name      : uvcvideo
        Card type        : HD USB Camera: HD USB Camera
        Bus info         : usb-0000:01:00.0-1.1
        Driver version   : 5.10.17
        Capabilities     : 0x84a00001
                Video Capture
                Metadata Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : uvcvideo
        Model            : HD USB Camera: HD USB Camera
        Serial           : Ucamera001
        Bus info         : usb-0000:01:00.0-1.1
        Media version    : 5.10.17
        Hardware revision: 0x00000310 (784)
        Driver version   : 5.10.17
Interface Info:
        ID               : 0x03000002
        Type             : V4L Video
Entity Info:
        ID               : 0x00000001 (1)
        Name             : HD USB Camera: HD USB Camera
        Function         : V4L2 I/O
        Flags         : default
        Pad 0x01000007   : 0: Sink
          Link 0x0200000d: from remote pad 0x100000a of entity 'Processing 2': Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
        Width/Height      : 640/360
        Pixel Format      : 'MJPG' (Motion-JPEG)
        Field             : None
        Bytes per Line    : 0
        Size Image        : 921600
        Colorspace        : Default
        Transfer Function : Default (maps to Rec. 709)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Full Range)
        Flags             :
Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 640, Height 360
        Default     : Left 0, Top 0, Width 640, Height 360
        Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 640, Height 360, Flags:
Selection: crop_bounds, Left 0, Top 0, Width 640, Height 360, Flags:
Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: 30.000 (30/1)
        Read buffers     : 0
                     brightness 0x00980900 (int)    : min=1 max=255 step=1 default=128 value=128
                       contrast 0x00980901 (int)    : min=1 max=255 step=1 default=128 value=128
                     saturation 0x00980902 (int)    : min=1 max=255 step=1 default=128 value=128

And here is the output of the webcam log:

pi@octopi:~ $ journalctl -u webcamd

-- Logs begin at Fri 2021-05-07 21:18:04 BST, end at Sat 2021-05-15 20:14:14 BST. --
May 07 21:18:07 octopi systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
May 07 21:18:08 octopi webcamd[354]: Starting up webcamDaemon...
May 07 21:18:08 octopi webcamd[354]: --- Configuration: ----------------------------
May 07 21:18:08 octopi webcamd[354]: cfg_file:      /boot/octopi.txt
May 07 21:18:08 octopi webcamd[354]: camera:        auto
May 07 21:18:08 octopi webcamd[354]: usb options:   -d /dev/video1 -r 1280x720 -f 10
May 07 21:18:08 octopi webcamd[354]: raspi options: -fps 10
May 07 21:18:08 octopi webcamd[354]: http options:  -w ./www-octopi -n
May 07 21:18:08 octopi webcamd[354]: Explicitly USB device: /dev/video1
May 07 21:18:08 octopi webcamd[354]: -----------------------------------------------
May 07 21:18:08 octopi webcamd[354]: Found video devices:
May 07 21:18:08 octopi webcamd[354]: /dev/video0
May 07 21:18:08 octopi webcamd[354]: /dev/video1
May 07 21:18:08 octopi webcamd[354]: /dev/video10
May 07 21:18:08 octopi webcamd[354]: /dev/video11
May 07 21:18:08 octopi webcamd[354]: /dev/video12
May 07 21:18:08 octopi webcamd[354]: /dev/video13
May 07 21:18:08 octopi webcamd[354]: /dev/video14
May 07 21:18:08 octopi webcamd[354]: /dev/video15
May 07 21:18:08 octopi webcamd[354]: /dev/video16
May 07 21:18:08 octopi webcamd[354]: config file='/boot/octopi.txt':USB device was set in options and found in devices,
May 07 21:18:08 octopi root[509]: Starting USB webcam
May 07 21:18:08 octopi webcamd[354]: <13>May  7 21:18:08 root: Starting USB webcam
May 07 21:18:09 octopi webcamd[354]: Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 128
May 07 21:18:09 octopi mjpg_streamer[519]: MJPG-streamer [519]: starting application
May 07 21:18:09 octopi webcamd[354]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
May 07 21:18:09 octopi mjpg_streamer[519]: MJPG-streamer [519]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f9
May 07 21:18:09 octopi webcamd[354]:  i: Using V4L2 device.: /dev/video1
May 07 21:18:09 octopi webcamd[354]:  i: Desired Resolution: 1280 x 720
May 07 21:18:09 octopi webcamd[354]:  i: Frames Per Second.: 10
May 07 21:18:09 octopi webcamd[354]:  i: Format............: JPEG
May 07 21:18:09 octopi webcamd[354]:  i: TV-Norm...........: DEFAULT
May 07 21:18:09 octopi mjpg_streamer[519]: MJPG-streamer [519]: Using V4L2 device.: /dev/video1
May 07 21:18:09 octopi mjpg_streamer[519]: MJPG-streamer [519]: Desired Resolution: 1280 x 720
May 07 21:18:09 octopi mjpg_streamer[519]: MJPG-streamer [519]: Frames Per Second.: 10
May 07 21:18:09 octopi mjpg_streamer[519]: MJPG-streamer [519]: Format............: JPEG
May 07 21:18:09 octopi mjpg_streamer[519]: MJPG-streamer [519]: TV-Norm...........: DEFAULT
May 07 21:18:09 octopi webcamd[354]: Unable to set format: 1196444237 res: 1280x720
May 07 21:18:09 octopi webcamd[354]: Init v4L2 failed !! exit fatal
May 07 21:18:09 octopi webcamd[354]:  i: init_VideoIn failed
May 07 21:18:09 octopi mjpg_streamer[519]: MJPG-streamer [519]: init_VideoIn failed
May 07 21:18:10 octopi webcamd[354]: Done bring up all configured video device
May 07 21:18:10 octopi webcamd[354]: Goodbye...
May 07 21:18:10 octopi systemd[1]: webcamd.service: Succeeded.
May 07 21:18:10 octopi systemd[1]: Started the OctoPi webcam daemon with the user specified config.
May 07 21:18:10 octopi systemd[1]: webcamd.service: Service RestartSec=100ms expired, scheduling restart.
May 07 21:18:10 octopi systemd[1]: webcamd.service: Scheduled restart job, restart counter is at 1.
May 07 21:18:10 octopi systemd[1]: Stopped the OctoPi webcam daemon with the user specified config.