go2rtc
go2rtc copied to clipboard
USB Camera, Add device with by-id
I am running go2rtc on an Ubuntu 22.04 device with multiple USB cameras plugged in.
When using the /dev/video# option provided by FFMPEG in the Add tab I have an issue where the cameras will randomly change when the system reboots.
I attempted to set it to the /dev/v4l/by-id/ property instead but I always receive this error.
undefined error=streams: exec/rtsp
[video4linux2,v4l2 @ 0x7039b849b600] Cannot open video device /dev/v4l/by-id/usb-046d_HD_Webcam_C525_B994AB20-video-index0: No such file or directory
[in#0 @ 0x7039b85918c0] Error opening input: No such file or directory
Error opening input file /dev/v4l/by-id/usb-046d_HD_Webcam_C525_B994AB20-video-index0.
Error opening input files: No such file or directory
caller=github.com/AlexxIT/go2rtc/internal/hls/hls.go:76
This is an example of my config with one camera as by-id and the other by video#. Only the IMX219 works in this example.
streams:
C525: ffmpeg:device?video=/dev/v4l/by-id/usb-046d_HD_Webcam_C525_B994AB20-video-index0&input_format=yuyv422&video_size=1184x656#video=h264#hardware
IMX219: ffmpeg:device?video=/dev/video0&input_format=yuyv422&video_size=1024x768#video=h264#hardware