OctoPrint in Docker, snapshot works, stream doesn't

Camera model: Logitech c920

What is the problem?: I'm running OctoPrint in docker (works great) on my Raspberry Pi (that is running Raspbian and serves DHCP through pinhole, also works great).

I've plugged my Logitech c920 into the Pi, and the system recognizes it. I can even preview a snapshot in OctoPrint. However, I cannot get the stream to work.

What did you already try to solve it? Read every forum post and solution this side of the internet to see if I could figure out what's wrong. Tried changing ports and address listed in the stream settings in OctoPrint to the IP my Pi is sitting on (local_ip:5000), and a bunch of other little things like that, but have reverted back to the stock settings.

This the docker-compose.yml file I'm using; I believe I've enabled all the suggested settings for the webcam to work:

version: '2.4'

services:
  octoprint:
    image: octoprint/octoprint
    restart: unless-stopped
    ports:
      - 5000:5000
    devices:
    # use `python -m serial.tools.miniterm` to see what the name is of the printer
     - /dev/ttyUSB0:/dev/ttyUSB0
     - /dev/video0:/dev/video0
    volumes:
     - octoprint:/octoprint
    # uncomment the lines below to ensure camera streaming is enabled when
    # you add a video device
    environment:
     - ENABLE_MJPG_STREAMER=true

  ####
  # 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=America/Chicago
  #  volumes:
  #    - octoprint:/octoprint

volumes:
  octoprint:

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support): Tried to find webcamd.log, but I don't see it where it's supposed to be.

Tried to use SCP to save syslog to my local machine (accessing everything on the Pi headless using ssh/zsh on my Mac), but the file came over blank. Couldn't select-all and copy from Terminal, so not sure how to get that to everyone.

Additional information about your setup (OctoPrint version, OctoPi version, ...): OctoPrint v. 1.73 running in Docker; everything on the system is updated as of this morning.

What's configured as the stream URL?

In the background of the screenshot it looks like it is webcam/?action=stream. This needs a leading slash - /webcam/action=stream or the browser will not know what to do with it.

Thanks! It did not have a /, so thanks for that catch. Sadly, I've added it but there seems to be no change. These are the settings now. (I've saved and tried to preview again to no avail.)

Ok, I spotted another thing, in the docker-compose.yml file you have posted you are mapping 5000:5000. The webcam server is running on port 8080 inside the container, but there is also haproxy running on port 80 that's needed to use OctoPrint & the webcam on the same port. So if you want it to be accessible on port 5000 outside the container, then you must map port 80 internal to 5000 external. If I remember docker right that's 5000:80? If not it is the other way around.

1 Like

That was it! What a mensch; thank you for swooping in and saving the day, you are a true hero.

1 Like