mikedmor / OctoPrint_MultiCam

Extends the Control tab of OctoPrint, allowing the ability to switch between multiple webcam feeds.
45 stars 19 forks source link

Webcamd Error - Unable to set format #50

Closed QuePID closed 1 year ago

QuePID commented 1 year ago

Second webcam produces an error from webcamd, below is a snippet of the webcamd.log

Running ./mjpg_streamer -o output_http.so -w ./www -n -p 8081 -i input_uvc.so -r 1920x1080 -f 20 -y -d /dev/video1 MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34 i: Using V4L2 device.: /dev/video1 i: Desired Resolution: 1920 x 1080 i: Frames Per Second.: 20 i: Format............: YUYV i: JPEG Quality......: 80 i: TV-Norm...........: DEFAULT Unable to set format: 1448695129 res: 1920x1080 Init v4L2 failed !! exit fatal i: init_VideoIn failed Done bring up all configured video device

I am running the latest release of Octopi (0.18.0) on a Raspberry Pi 4B (8gb).

I followed this guide for setting up multiple webcams on Octopi: https://community.octoprint.org/t/setting-up-multiple-webcams-in-octopi-the-right-way/32669

Both webcams are connected to a powered USB 3 hub.

Here is my lsusb output: Bus 001 Device 006: ID 1bcf:284d Sunplus Innovation Technology Inc. Bus 001 Device 004: ID 1bcf:284d Sunplus Innovation Technology Inc.

Here is my /dev/v4l/by-id/ output: lrwxrwxrwx 1 root root 12 Dec 14 04:38 usb-SunplusIT_Inc_USB_2.0_Camera_20201211V0-video-index0 -> ../../video0 lrwxrwxrwx 1 root root 12 Dec 14 04:38 usb-SunplusIT_Inc_USB_2.0_Camera_20201211V0-video-index1 -> ../../video1

Here is a snippet of my octopi.txt file: camera_usb_options="-r 1920x1080 -f 30 -d /dev/v4l/by-id/usb-SunplusIT_Inc_USB_2.0_Camera_20201211V0-video-index0" camera_http_webroot="./www" camera_http_options="-n -p 8080"

Here is a snippet of my /boot/webcam2.txt file: camera_usb_options="-r 1920x1080 -f 20 -d /dev/v4l/by-id/usb-SunplusIT_Inc_USB_2.0_Camera_20201211V0-video-index1 -y" camera_http_webroot="./www" camera_http_options="-n -p 8081"

Both webcams work fine as a single webcam in Octopi indicating the webcams themselves are functional.

I have tried changing resolutions to 640x480, and adding the -y parameter to camera_usb_options without success.

Any help would be greatly appreciated.

config.txt dmesg.txt ls_al_dev_v4l_by-id.txt ls_al_dev_v4l_by-path.txt lsusb_output.txt v4l_by-id.txt webcam2.txt webcamd.log

QuePID commented 1 year ago

I resolved this issue.

Instead of using the usb devices listed in /dev/v4l/by-id (to which only one index-0 was listed), I switched to using the data from /dev/v4l/by-path which showed my two usb devices as index-0.

platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2.2:1.0-video-index0 platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2.4.2:1.0-video-index0'

I now have 3 webcams working with multicam (2 usb, 1 raspi).