Setting up multiple webcams in OctoPi the right way

hi thanks this is brilliant , it works a treat , just trying to use it with multicam in octoprint ? not sure if thats possible ?

sure
just put the url with the port you assigned into the second cam field

Hi here is what I put

http// :8081 but this did not work ..
Thanks

It should have read
Http://pi IP address :8081

yep :slight_smile:

Yea I put that but says webcam stream error,guessing I am doing something wrong LOL but can’t figure it out ,if I put that into a browser I can see the camera feed from camera but in octoprint I just get that error

does http://IP-OF-THE-PI:8081/?action=stream work?

1 Like

Hi
Will try that in morn ,thanks for your help

1 Like

.that worked A treat thank so much,

1 Like

Thank you!

This really works, simple and easy.
Looking forward to that Haproxy guide ^.^

@PrintedWeezl , Yes. it show up very nice.

3 Likes

Hello @Charlie_Powell,

I am searching for a way to connect two cameras to my octoprint docker container. Unfortunately there is no Octoprint.txt-file. There is just a config.yaml, but I wasn't able to make this work.

Can you give me any advices on this topic?

Thanks!

Hi, this guide only works on OctoPi installs since it takes advantage of the code for multiple cameras that already exists.

If you are already using docker, why not create another dedicated streamer container? There's loads out there that use mjpg streamer, or some of the other streamers. Using containers is designed to split up tasks rather than one container to do everything (which would be a whole OS I guess.... :wink:)

Hi there,

Thank you for that tip. I was wondering to find something easy for set up my second usb camera but seems to do not work...
I have strictly followed your instructions but the second camera seems to do some issues.

On the Rpi3b i have one picam that works well. I wanted to add some more with an usb camera.
when i try to go to http://mypi:8080 there is blank page but i got the stream on the 8081 withe the picam ?!

Any idea for get it out of there ?

By default on OctoPi, the first instance of mjpg streamer (on port 8080) is only available through haproxy, so under /webcam/ there.

What i understood is to go http://ipofpi:8080 for see the picam and going further to http://ipofpi:8081 for get the stream from my webcam ...
I just roll back the whole thing and try to setup again ... passed my whole day on it ...

This setup does not change the original camera you had setup. So don't change the URL it is using. Nowhere in this guide does it say use :8080 for the first camera, just for the second. I suppose I could make it clearer that the existing camera streaming does not change.

Use http://ipofpi/webcam

Correct

noway it gave me the same as before ...
when I go on http:/ipofpi/webcam i get this :

The webcam server is currently not running

on the navigator ...

I guess i will make a fresh install and do it again ...

I just feel a little bit dumb right now ... :smiley:
But thank you for that advice, I managed it to setup two camera streams and embed it into OctoPrint with the MultiCam-Plugin and a dockerized version of the ustreamer.

Here is my docker-compose.yml-file, I just added one ustreamer-instance for every camera and used different ports:

version: '2.4'

services:
  octoprint:
    image: octoprint/octoprint:latest
    restart: unless-stopped
    ports:
      - 80:80
    devices:
     - /dev/ttyACM0:/dev/ttyACM0
    # - /dev/video0:/dev/video0
    volumes:
     - octoprint:/octoprint
    #environment:
    # - ENABLE_MJPG_STREAMER=true
    # - MJPG_STREAMER_INPUT=-r 1080x720 -fps 20 -rot 180

  ####
  # uncomment if you wish to edit the configuration files of octoprint
  # refer to docs on configuration editing for more information
  ####

  config-editor:
    image: linuxserver/code-server
    ports:
      - 8443:8443
    depends_on:
      - octoprint
    restart: unless-stopped
    environment:
      - PUID=0
      - GUID=0
      - TZ=Europe/Vienna
    volumes:
      - octoprint:/octoprint

  ustreamer_USB_Cam:
    image: beholderrpa/ustreamer:latest
    ports:
      - 8080:8080
    devices:
      - "/dev/video0"
    entrypoint: [ "./ustreamer", "--device=/dev/video0", "--host=0.0.0.0", "--slowdown", "--format=JPEG", "--resolution=1080x720", "--desired-fps=20"]

  ustreamer_Pi_Cam:
    image: beholderrpa/ustreamer:latest
    ports:
      - 8090:8080
    devices:
      - "/dev/video2"
    entrypoint: [ "./ustreamer", "--device=/dev/video2", "--host=0.0.0.0", "--slowdown", "--format=JPEG", "--resolution=1080x720", "--desired-fps=20"]

volumes:
  octoprint:

Further, I just adapted the IP-Adresses in the config.yaml-file. I don't know if this is good practice, but it works for me.
I still have problems to work on:

  • I have to rotate the Pi-Camera 180 degree. Unfortunately, the rotation function from the MultiCam-Plugin is delayed and I wasn't able to make the ustreamer do the rotation.
  • I want to expose the camera stream just in a docker network and not in my local network (this is just for educational reasons, I want to expand my docker-skills :smiley:).
3 Likes

Fresh install do the thing :slight_smile: :slight_smile:
Thank you !

1 Like