Available mjpg-streamer configuration options

'Control.html' is a typo. Octolapse does use control.htm when making these requests. I fixed this :slight_smile:

What do you have for your base address in your Octolapse webcam profile? If it's not equal to the following, please try changing your setting:

http://127.0.0.1/webcam/

or maybe

https://127.0.0.1/webcam/

The current value is the default; http://127.0.0.1:8080/

Changing the value to http://127.0.0.1/webcam/ doesn't allow me to check the "Enable And Apply Preferences Before Print" checkbox.

Hey GlenH, I have been reviewing the code that throws the exception you reported, and the error code is 'Not Implemented'. This leads me to believe that the parameters that I'm sending to test the streaming server might not be compatible with your camera. I will try to create a URL that you can use to test my theory after work. FYI, I just ordered a second camera (raspicam) so maybe I'll see some differences with that too which might lead to a solution. FYI, I've put a lot of effort into the camera settings page in the dev branch, so I'm very interested in making this process work on more cameras without too much setup.

I appreciate the effort you put into this. If it would help, I can send you my cam for testing. I also have a Logitech C615 and it throws the same error.

I appreciate your offer, but if you're getting the same error on the C615 this is probably not related to your other camera :frowning:.

Can you tell me a bit about your Octoprint setup? Did you install from an OctoPi image? If so, what version. Also, what version of OctoPrint and MJpegstreamer are you running? Have you made any security/proxy changes to your server?

I broke my old installation, so I re-installed from Octopi 0.16.0. I’m not sure which version of mjpg-streamer I’m running; probably the one that came with the Octopi 0.16.0 distribution.

I haven’t made any changes to my networking configuration from default. No proxy for remote access or anything like that.

I have installed a 3.5” touch screen and TouchUI. I can try rebuilding with just the default 0.16.0 plus Octolapse and see if it works that way.

Definitely disable all of your other plugins at least. I need to try a fresh install with 0.16.0 as well. Perhaps something has changed with mjpegstreamer (shudder... lol!).

I'm running octoprint 1.3.10 on image 4.14.98-v7+ with a Raspberry pi 3B+, my webcam is a Logitech C615. I'm unable to change the webcam resolution. Any change I made in /boot/octopi.txt simply makes the webcam unavailable because of an error, the log says:

Starting up webcamDaemon...
--- Configuration: ----------------------------
camera: usb
usb options: -r 1920x1080 -f 5 -y
raspi options: -fps 10
http options: -w ./www
Explicitly set USB device was found in options: -r 1920x1080 -f 5 -y
Found video devices:
/dev/video0
Configured USB camera was not detected, trying again in two minutes

When I check the webcam log, with default parameters, I see:

Running ./mjpg_streamer -o output_http.so -w ./www -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
MJPG Streamer Version: git rev: 821c330ea6bbb5fbed98d48e00aac156e923161b
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 10
i: Format............: JPEG
i: TV-Norm...........: DEFAULT

Now, I just kill the mjpg thread, cd to /home/pi/mjpg-streamer and run the same command again: this fails.

./mjpg_streamer: invalid option -- 'w'
When I strip the "faulty" arguments:
./mjpg_streamer: invalid option -- 'd'
./mjpg_streamer: invalid option -- 'f'

I already lost a stupid amount of time on this. Anyone can tell me what's going wrong?

You might try v4l2-ctl -D and v4l2-ctl --list-formats-ext as shown in this thread.

Searching for "logitech C615 mjpg_streamer raspberry pi" may find other useful resources.

It might be useful to note that the plugin TheSpaghettiDetective bypasses the octopi.txt file and changes are not applied, as stated in this thread:

This issue still persists.
The -q setting is not being read at boot.
When doing a "sudo service webcamd restart" it is being read, and image is changed accordingly.

I added this to my txt file
camera_usb_options="-r 1280x720 -f 30 -hf"

ps aux | grep stream
root 473 1.9 0.5 58592 5360 ? Sl 19:38 0:03 ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 1280x720 -f 30 -hf -d /dev/video0

I have a Logitech C720

The image is still upp side down

Not all cameras support all the options. There's options in the UI for flipping/rotating if your camera doesn't support it.

okay, I was planing to stream the "raw" stream without needing anything that changes the settings.

There's also v4l2-ctrl that you could use (which the Camera Settings plugin uses).

Run the command v4l2-ctrl -d /dev/video0 --list-ctrls-menus and see what is reported - you may be able to flip it that way, but no guarantees.

I've seen some confusion about the -r switch with the input_uvc plugin: you can also specify some mode names, but they don't appear to be documented outside of the source code: mjpg-streamer/utils.c at 310b29f4a94c46652b20c4b7b6e5cf24e532af39 Β· jacksonliam/mjpg-streamer Β· GitHub

static const struct {
    const char *string;
    const int width, height;
} resolutions[] = {
    { "QQVGA", 160,  120  },
    { "QCIF",  176,  144  },
    { "CGA",   320,  200  },
    { "QVGA",  320,  240  },
    { "CIF",   352,  288  },
    { "PAL",   720,  576  },
    { "VGA",   640,  480  },
    { "SVGA",  800,  600  },
    { "XGA",   1024, 768  },
    { "HD",    1280, 720  },
    { "SXGA",  1280, 1024 },
    { "UXGA",  1600, 1200 },
    { "FHD",   1920, 1280 },
};
1 Like

If nothing works try the -y and with smallers resolution! On my webcam the musb just crashes with higher resolution than 176x144.
Check dmesg if you got a problem
Also check the supported resolution using v4l2-ctl -d /dev/video0 --list-formats-ext

I spend a lot of time trying to figure out that

1 Like

Hello, when I enabled the Custom Image Preferences, it only shows option to change JPEG quality (0-100) and nothing else. Anyone know how can I have the full settings instead? Camera is generic 1080P webcam that is shown as supported in Octoprint's list.

Hi all!
I start to configure webcam streaming and now I have choice of a soft for streaming from usb webcam.
I trayed the mjpg-streaming and it don't like me by several reason:

  1. I start service and webcam work all time even if i do not look at picture in octo. Can I disable a camera in idle time with mjpg-streaming?
  2. mjpg-streaming always make convert a picture, it take enough cpu time. can mjpg-streaming just copy picture from v4l2 driver to http?

I made small python script (based on fork) that use ffmpeg and send pictures through http. the ffmpeg has enough options to made every needed convertation. The script stops the ffmpeg process if a http client is disconnected.
But now I want to use v4l2 driver directly to copy the driver buffer content to the http socket (without ffmpeg).

Yeah but you have to do at by hand
ssh into the pi and run

sudo service webcamd stop

to disable the cam an

sudo service webcamd start

to start the cam again.

I'm not sure if that can be done - or if it is already done that way - but the cpu utilization is pretty low for me. Less than 5% on my Pi 3+. I would guess about 3% on average.