cp2004 / OctoPrint-CameraStreamer-Control

Embed WebRTC (& more) streams provided by camera-streamer in OctoPrint
GNU Affero General Public License v3.0
17 stars 0 forks source link

Can´t configure webrtc stream URL right #2

Closed triton-nereide closed 1 year ago

triton-nereide commented 1 year ago

If I put the following URL in a new browser tab (firefox) it shows the webrtc stream in perfect quality:

http://192.168.0.222:8080/webrtc

Pleas note that it needs to be NOT https, and that it needs the ip adress of the raspberry pi/octoprint and the port number of the camera stream, followed by "webrtc".

When I try to configure this URL in your plugin I fail, because in your plugin the part: http://192.168.0.222/ (ip adress with a trailing slash) is hardcoded, so I can´t change it, and only can append something. So if I put :8080/webrtc in the field for the webcam URL it makes the following out of it:

http://192.168.0.222/:8080/webrtc

which will obviously not work, because it pus a hardcoded slash before the port number. If the slash would not be hardcoded I would be able to put what I need here to get the right URL for the stream. Those who maybee need a slash here could put it manually, and get this to work this way. The input similar to the ones you have now will change from

"webrtc" to "/webrtc"

same applies to the snapshot URL. here I would need to get It to work (testet in a firefox tab):

http://192.168.0.222:8080/snapshot

If you put the following:

http://192.168.0.222:8080

you will get a list of functions for the new camera streamer. Every single option listed here works perfectly, as long as it has a leading string like:

http://(ip adress of octoprint/raspi):Port(/option)

and only this syle works, every else fails, despite the fallback to mjpeg stream.

Is it possible to change the hardcoded part in your plugin like so, that the trailing slash is not hardcoded anymore, and has to be put by the user, if necessary? regards C

cp2004 commented 1 year ago

The default settings are for an OctoPi setup where the streamer is behind haproxy. So the webcam URL is normally configured as /webcam/ in this plugin. It's not hard coded, but it is configurable.

It sounds like you want to change this to be an IP/port. Don't change the webrtc URL (this is always going to be webrtc in camera-streamer). But if you change the 'Webcam URL' to http://192.168.0.222:8080/, then the URLs will build correctly.

cp2004 commented 1 year ago

Seeing as the associated forum thread seems to have progressed & the stream is somewhat working, I'll close this now.