Skip to content

[Request] Enhance webcamd & /boot/octopi.txt to allow for multiple cameras #677

@kazooless

Description

@kazooless

Hello,

I have figured out how to get mjpg_streamer to run 4 instances with just one command line. I am too much of a beginner when it comes to Bash scripting though, so I personally am not able to edit the webcamd script to handle the logic to see if there are more than 1 video devices to use. So as a feature request I am suggesting enhancing the scripts to handle more than one.

Chris Riley has a video series explaining how to setup multiple instances of Octoprint using Octopi but he says in it no matter what he tries, he can't get 4 webcam instances. This would be an alternate way (and I suspect it would use up fewer resources too). The important part though is using UDEV rules to permanently call the same camera for its assigned printer. So generic logic looking to see if multiple cameras exist isn't enough.

Here is the command line that works for me:

sudo ./mjpg_streamer -o "output_http.so -l octopi4.local -p 8083 -w ./www" -i "input_raspicam.so -fps 10 -x 1920 -y 1080" -i "input_uvc.so -d /dev/wcam-1080 -fps 10 -r 1920x1080" -i "input_uvc.so -d /dev/wcam-Logitech -fps 10 -r 1920x1080" -i "input_uvc.so -d /dev/wcam-ARC -fps 10 -r 1920x1080”

I am successfully using 1 raspberry pi camera & 3 USB cameras with this one command line.

I would suggest changing /boot/octopi.txt to have 4 sections with only the first one uncommented. Sections 2-4 could then be uncommented as needed, and filled out with the new device path for each camera. Then in the webcamd script, I would imagine a for loop of some sort to check for how many cameras are uncommented and then going from there to form the command line in the startcamera function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions