Setting up multiple webcams in OctoPi the right way

this.........

edited my post to be clearer, but like @Charlie_Powell said, you need to remove that part.

(For @jneilliii and @Charlie_Powell):

Okay, got that out of there. I guess it was late night with tired eyes, since I had read that line over a few times and did see I had the right path for it, but never saw I still had that in it!

On the Multicam setup page, when I look at the setup for the 1st webcam, it looks like it's using a relative URL, since it's just /webcam/?action=stream (well, I can't see it all, but I can see enough that's what I figure that is the value). For the 2nd webcam, I had to put the full URL in as http://erebor:8081/?action=stream to get it to work. Should it work with just ":8081/?action=stream" in that text field?

(From just looking at it, it seems that first field should be the URL relative to http://<your-ip>, which, in my case, is http://erebor. Then the 2nd should be the URL using local http://127.0.0.1 as the address, with the port and option after that.)

Am I missing something or should the value for the 2nd cam be the full URL?

Also, totally extra question - how many cams can Multicam support?

No, you can't use a port number as a relative URL. If you need to use port 8081, then it must be the full URL, including the IP address.

If you would like the 2nd webcam to also have a relative URL, then you just have to read the guide - it's right there, in the 'Haproxy configuration' setup.

I think in theory the 'Multicam' plugin supports as many cameras as you would like, as does the server-side streaming that this guide deals with. However, in practice, you will have limits on the available processing power & bandwidth to handle many webcams, but I can't say at what point those are hit as it depends on many things like resolution and frame rate.

Okay. It's not a problem. I just wanted to make sure I wasn't making some mistake that would cause issues later on.

I didn't see anything on the Multicam home page, so I was wondering, since there's the '+' button to add more and there doesn't seem to be a limit, but yes, I can see the limits on resources as being a problem. I have seen posts in some places indicating that some power supplies even had problems providing power for as few as 2 cameras.

At this point I have two printers. I didn't expect to, but it happened. My printers are in the workshop in the barn, a 500' walk from my house. I do most of my design work in the study - much easier to work at the computer there than in the workshop. So being able to use OctoPrint to send files down to the printers and start printing (and to monitor them) without having to make an extra trip down is a big help!

Thanks for the help!

Read the OPTIONAL: Haproxy configuration section in the guide.

Went through it. That's now on my list. (After getting Home Assistant working again and adding control of my 2nd printer to OctoPrint.)

Is everyone that is getting this / the multiple webcam setup just plugging directly into your Pi, or using a powered hub? Just tried setting this up with c920 and USB endoscope directly to pi 3b+ and doesn't se to work. Sometimes the c920 blacks out the bottom half of the image. I'm assuming too much power draw.

Did you ever figure this out? Having similar issues

Yes, I did. What was here helped me get things up and working.

Sorry for not returning to provide an update later. I made the change that I overlooked (removing <device long id> ) and it worked. Then I used the haproxy info and that helped me with making an easier to use URL for each one.

My plan, originally, was to add a 2nd camera and 2nd printer, since I've heard about people doing it, but now I see they're doing it with methods like using containers and putting 2 Octoprint instances on one system. I don't know if a Pi4 can handle controlling 2 printers at once, so I'm going to do more research on that before I do it. (I had seen concerns about if a Pi power supply could handle 2 cameras, but I don't seem to be having any trouble with it.)

I'm using the Pi cam and a USB cam, with no hub, and it's working. That's on a Pi 4. I don't know if there are enough differences between the 3 and 4, in the power supply and usage areas, to make it possible on the 4 and make the 3 not powerful enough.

I stumbled across some random thread in my troubleshoot/searching and all it took was me dropping the resolution from 1920x1080 on my main webcam (octopi.txt) to 1280x720 and restarting webcamd and it worked. I guess there's too much bandwidth/resources needed to drive a 1080 + 720 camera without using a powered hub.

The formatting is very broken in your post as it is rendered by Discourse. If you would like to post code, then you should use 3 backticks to create code blocks.

```
Like this
```

Which will render

Like this

Anyway, from what I can gather part of your post is about duplicating the webcamd files and suggesting editing the lines where right above it says:

DO NOT EDIT, USE /boot/octopi.conf.d/*.txt INSTEAD!

Which is what this guide is explaining how to do. There is no need to manually duplicate and edit the service files to get multiple webcams up and running.

@g.j.b_kosterink

As @Charlie_Powell already mentioned in his post:

Please format your code snippets with

grafik

Else it's quite a mess and also letters get lost...

So you are suggesting to edit the bits that say DO NOT EDIT on them? For what reason?