mikedmor / OctoPrint_MultiCam

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

Support for WebRTC? #69

Open thomasvnl opened 6 months ago

thomasvnl commented 6 months ago

Hi,

Just found this plugin. It seems really handy, but it does not want to work with the new libcamera stack which features webrtc on "host/webcam/webrtc", which is a shame as that is a far superior and slimmer streaming methodology compared to mjpeg. Could this plugin be modified to also allow for WebRTC streams to be loaded?

With kind regards, Thomas

jacopotediosi commented 3 months ago

As per #55, Multicam should already support WebRTC.

The implementation was copied from the classicwebcam plugin, and allows you to use webrtc:// or webrtcs:// as the protocol in stream URLs.

Unfortunately, I imagine the current WebRTC implementation is broken, at least for those using the new camera stack, in both this and the classicwebcam plugins. By entering webrtcs://192.168.1.26/nozzlecam/webrtc as the stream url, I notice a ton of errors in the JavaScript console, while visiting https://192.168.1.26/nozzlecam/webrtc from my browser just works.

I suggest @mikedmor to look at the WebRTC implementation adopted by the CameraStreamer-Control plugin, which instead works correctly, despite not supporting multiple cameras (yet?).