Unable to change the webcam address

Camera model
Logitech C270
What is the problem?
I'm using crowsnest with provide support for camera-streamer but for some reason I'm unable to change the address in Octoprint settings it only shows Classic Webcams

What did you already try to solve it?
I try to change it in the config.yaml which shows the correct address in the error that it's unable to open the stream and even when I clicked on the link that shows the error it open the camera stream perfectly in a new tab. If I changed the protocol of crowsnest to ustreamer instead of camera-stream I can see it in octoprint. What is more strange is the camera configure as camera-streamer I'm able to see it in obico. It's like the interface of octoprint don't support camera-streamer

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

Starting up webcamDaemon...

--- Configuration: ----------------------------
cfg_file:      /home/pi/klipper_config/webcam.txt
camera:        auto
usb options:   -r 640x480 -f 10
raspi options: -fps 10
http options:  -w ./www-mjpgstreamer -n

Explicitly USB device: 
-----------------------------------------------

Found video devices:
/dev/video0
/dev/video10
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
/dev/video18
/dev/video19
/dev/video20
/dev/video21
/dev/video22
/dev/video23
/dev/video31
config file='/home/pi/klipper_config/webcam.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
/usr/local/bin/webcamd: line 184: printf: 0x: invalid hex number
/usr/local/bin/webcamd: line 184: printf: 0x: invalid hex number
<13>Aug 30 23:59:42 pi: Starting USB webcam
Checking for VL805 (Raspberry Pi 4)...
  - It seems that you don't have VL805 (Raspberry Pi 4).
    There should be no problems with USB (a.k.a. select() timeout)
Running ./mjpg_streamer -o output_http.so -w ./www-mjpgstreamer -n -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 10
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
 i: Could not obtain the requested pixelformat: MJPG , driver gave us: YUYV
    ... will try to handle this by checking against supported formats. 
    ... Falling back to YUV mode (consider using -yuv option). Note that this requires much more CPU power
Unable to query that the FPS change is supported
: Inappropriate ioctl for device
UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
 o: www-folder-path......: ./www-mjpgstreamer/
 o: HTTP TCP port........: 8080
 o: HTTP Listen Address..: (null)
 o: username:password....: disabled
 o: commands.............: disabled
libv4l2: error turning on stream: Invalid argument
Unable to start capture: Invalid argument
 i: Can't enable video in first time
 i: cleaning up resources allocated by input thread
Done bring up all configured video device

Goodbye...

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

Hello @nocturno !

Goto OctoPrint Settings -> Plugins -> Classic Webcam

There you can select the webcam URL.

Thank you I missed that but still not working The same address work in the web browser but for some reason It's not working in Octoprint.


You may try without the port:

With me it is:

http://192.168.2.19/webcam/?action=stream

Already try that one with and without port but my streamer it's not the default octoprint use. The streaming is coming from another service in the Pi, that's why I changed it to webrtc at the end.

To net get confused: The port is the :8080, not the webrtc

I can see, the the 10.1.10.6:8080/webrtc works obviously somehow.

Have you tried by adding /?action=stream ?

Yes with port and without port same issue. The only way it work with the address you mention is if I changed from camera-stream to ustream. But I prefer camera-stream since it takes less CPU.

In this combination you have nothing won. It is still the same Pi (as far as I understand).

I has a similar issue with my Klipper-Pi.
I took a RasPi 3B, installed OctoPi/OctoPrint on it, attached the USB- camera to that and took the IP of that Pi for the use with the Klipper-Pi.

I think that Octoprint it's not compatible with camera-stream but I hope someone can confirm it or provide a solution. Thanks

Can you post an output from the CLI on the Pi showing the results of
sudo netstat -tulnp
You are looking for the line which starts: tcp 0 127.0.0.1:8080 and ends with mjpg_streamer

If you don't see that line then your camera isn't detected, or the server running...

Serving the camera stream on the loopback address means it can ONLY be accessed from an application/web gui running on the Pi [for security purposes]. Changing the listening IP address is tricky and half an hour's searching hasn't revealed WHERE its set. But changing it to the IP address of your Pi isn't recommended, webcams are a common attack vector for hackers.

This is why if you click on the Snapshot Stream link it takes you to 127.0.0.1:8080, which is NOT the Pi, but the device you are using to access the Pi - shouldn't work for anyone AFAIK.

The link with /webcam/?action=stream? works on my test machine fine, but I only put this together to try to find out if your problem was simple, or complex..
HTH. Roger

OctoPrint is definitely compatible with viewing streams from camera-streamer - it's what the new webcam stack for OctoPi is based on.

In OctoPrint, you'll need to put the mjpg stream URL into the settings.

If you go to http://10.1.10.6:8080 you should find a page with a lot of links to stream formats. Follow the one for that should be /stream , for the mjpg stream. If this works, copy and past the URL from your browser into OctoPrint and try this there. There should also be one that is /?action=stream that also works, but click on the links from that page to see what works and what doesn't

That did the trick but my main problem was Safari. Changing the address to http://10.1.10.6:8080/stream works at least in Chrome. Thank You