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 },
};
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
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:
- 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?
- 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.
@PrintedWeezl thank you for answer, but it not what I want. I think that the service should work all time but if has no requests by http from octo, camera shoud be disabled until new request will income
That's not possible with mjpg streamer.
It might be worth documenting the --softfps
option, which limits FPS by dropping frames. It works for camera_usb_options
, not sure about camera_raspi_options
(I don't have one; a quick source search suggests it is not supported).
For my use, I'm more interested in resolution than frame rate. It seems that the -f
option simply attempts to set the camera frame rate; my camera (Wyze Cam v2 with webcam firmware) seems to ignore that, and I always get the same frame rate (15fps). These frame rates overwhelm my Pi3 at higher resolutions. The --softfps
option drops frames to achieve a target framerate (per the documentation), and achieves for me what I was hoping -f
would do, limiting framerate to limit performance impact of using higher resolution.
The option isn't listed on the linked documentation page, but is described in the source:
Do you know if there's an option to disabe the fish eye?
Hi, what should I do to make it possible to have a screen display on octoprint after the usb camera is plugged into the laptop? Thank you very much!
Just install a streamer on the laptop
Thank you for your reply! I would like to ask how exactly streamer should be downloaded and used? I found mjpg-streamer on github and downloaded it before, I didn't find anything like a setup, so I don't know how I should use it, and I'd appreciate some guidance. Thanks a million!
Oh the laptop is running windows
Mjpeg streamer is a Linux application. You could probably get it running via wsl, but that could be a bit of work.
Check out the "install webcam server" part of the OctoPrint on windows guide