Multicam and new Camera Stack

Is Multicam compatible with the new Stack? New stack is working and can see both camers with http://octopi2:8081/stream and http://octopi2:8082/stream (with OPTIONS="--http-listen=0.0.0.0"). Also an wget on octopi works. Multicam plugin shows:

**Webcamstream nicht geladen**
It might not be configured correctly or require authentication. You can change the URL of the stream under "Settings" > "Classic Webcam" > "Stream URL". If you don't have a webcam you can also just disable webcam support there.
Aktuell konfigurierte Stream-URL: http://octopi2:8081/stream

This is a new installation with new camera stack. On my older installation I got multicam running with the old camera stack.

haproxy.cfg has only oe entry for webcam:

backend webcam
        http-request replace-path /webcam/(.*) /\1
        server webcam1  127.0.0.1:8080
        errorfile 503 /etc/haproxy/errors/503-no-webcam.http

Is this correct?

Any Ideas?
octoprint-systeminfo-20240301143351.zip (132.0 KB)

You already ask on an ongoing thread. There is no need to open a new one.

I've used the wrong topic. It was proposed to create a new topic for support.

I have the solution. Before I've searchg hours to get it. I thought the haproxy.cfg will be automaticly changed to use two webcams when using the new camera stack. But it isn't. It seems the multicam plugin need the haproxy. Using a direct URL does work.with multicam. After editing the haproxy.cfg, multicam working.

Not true.

You merely need to force camera-streamer to listen on all of the local interfaces as per the documentation.

e.g. this works for each camera WITHOUT making any changes to haproxy when using the new camera stack.

OPTIONS='--http-listen="0.0.0.0" --camera-format="MJPEG" --camera-auto_focus="0"'

What should I use for the streaming and snapshot URL in multicam?

I think for more than one camera, you still have to change the haproxy.cfg, because only port 8081 (the first camera) is used in haproxy. For the second camera you need some entries for Port 8082 and /webcam2/.

I've configured in multicam plugin the following URLs:

For Webcam1:
/webcam/?action=stream
/webcam/?action=snapshot

For Webcam2:
/webcam2/?action=stream
/webcam2/?action=snapshot

http-listen is set to "0.0.0.0" for both camera configs, the Port differs: 8081 for the first camera and 8082 for the second camers

To clear up the misunderstanding here,

OctoPi ships with one camera configured out of the box. The streamer uses port 8080, and haproxy is configured to serve this under /webcam/, and it is not accessible just with the port.

For adding other cameras, you can either:

  • Configure http-listen="0.0.0.0", and address each camera with it's respective port (8081, 8082 etc. whatever you set it to). Downside here is you have to use a fully qualified URL including IP address/octopi.local etc. eg. http://192.168.1.100:8081/?action=stream which means that if this changes, you have to update your configuration. Fine for many, can be an inconvenience.
  • OR, you can configure haproxy by duplicating the rules for /webcam/ & 8080. Then you don't need to touch http-listen, and you can access the cameras just with the relative URLs /webcam2/ or whatever you set it to. I prefer this option.

Hope that helps.

1 Like

Thank you. Yes, this was very helpful. It seems, this is nowhere documentated.