mainsail-crew / crowsnest

Webcam Service for multiple Cams
GNU General Public License v3.0
324 stars 77 forks source link

Octoprint video stream issue #82

Closed robustini closed 1 year ago

robustini commented 1 year ago

What happened

I am ascertaining that unfortunately this system does not work with Octoprint, while with Mainsail and Repetier Server it does, and it is quite strange, only snapshot works correctly Same issue also with Repetier Server, only snapshot. I am aware that this was born for Mainsail or Fluidd, but it would be helpful if it could work with others as well. Tried with:

192.168.0.220:8080/?action=stream <-- (even in the browser there is no preview of the stream)

127.0.0.1:8080/?action=stream

What did you expect to happen

I cannot rule out the possibility that it is an Octoprint problem, but with MJPG-Streamer it works.

How to reproduce

I think it is easily reproducible, I read that someone else has the same problem on the Octoprint forum.

Additional information

Video stream immagine

Snapshop immagine

robustini commented 1 year ago

Also with Repetier Server work fine! immagine

KwadFan commented 1 year ago

I am unsure about octoprint or repetier server, but in Mainsail and Fluidd we use nginx as reverse proxy. Afaik, octoprint uses HAProxy as reverse Proxy.

My guess is that the ports ar simply not redirected to it. Try to add the no_proxy: true option to section [crowsnest]

Maybe that helps

robustini commented 1 year ago

I am unsure about octoprint or repetier server, but in Mainsail and Fluidd we use nginx as reverse proxy. Afaik, octoprint uses HAProxy as reverse Proxy.

My guess is that the ports ar simply not redirected to it. Try to add the no_proxy: true option to section [crowsnest]

Maybe that helps

Thanks for the reply! Correct, I use haproxy with Octoprint and this is its configuration file. I can't interpret the final part, with the webcam port on 8084, i.e. what do you mean by that port.

global maxconn 4096 user haproxy group haproxy daemon log 127.0.0.1 local0 debug

defaults log global mode http option httplog option dontlognull retries 3 option redispatch option http-server-close option forwardfor maxconn 2000 timeout connect 5s timeout client 15min timeout server 15min

frontend public bind :::80 v4v6 use_backend webcam if { path_beg /webcam/ } default_backend octoprint

backend octoprint reqrep ^([^\ :])\ /(.) \1\ /\2 option forwardfor server octoprint1 127.0.0.1:5000

backend webcam reqrep ^([^\ :])\ /webcam/(.) \1\ /\2 server webcam1 127.0.0.1:8084

KwadFan commented 1 year ago

Well, hard to tell what that exactly does but it looks to me, that it uses the URL /webcam/ for it.

So if you set, port 8084 in your crowsnest.conf and use the URL http://_printerip_/webcam/?action=stream it might work.

Also make sure mjpg streamer isnt running!

robustini commented 1 year ago

Same issue without the proxy with localhost 127.0.0.1, but work fine with the LAN IP.

KwadFan commented 1 year ago

Well, I cant tell how octo or repetier work, I will let this Issue open, but if you set no_proxy then it shouldnt have any restriction.

I think would be an option to ask a octo dev how they are setup. If you install crowsnest on a blank RaspiOS, you could use that with noproxy out of the box.

joshua76y commented 1 year ago

no_proxy: true

Great work! I have the same issues and that helps, thanks a lot!

KwadFan commented 1 year ago

I think due the fact Octoprint uses the same backend as the current "release" this could be closed. Regards Kwad