OctoPi Camera resolution won't change

What is the problem?
When trying to change the resolution in the octopi.txt file, the resolution doesn't change and stays on the default 640x480 resolution.
Changing is done according this manual:

One of the 'configurations' i've tried is as follows:

#Defaults to a resolution of 640x480 px and a framerate of 10 fps

camera_usb_options="-r 1280x720 -f 30"
#camera_usb_options="-r 1920x1080 -f 10"

###Additional webcam devices known to cause problems with -f

What did you already try to solve it?
When looking in lsusb, the camera is listed, see:

lsusb
Bus 001 Device 053: ID 046d:0821 Logitech, Inc. HD Webcam C910
Bus 001 Device 018: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 017: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 016: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)
I'm using a C910 camera
Versions:
OctoPrint 1.3.11 running on OctoPi 0.16.0 (Raspberry Pi 3+)

1 Like

Try to change the resolution with ssh: sudo raspi-config. this will change settings in /boot/config.txt and reboot. If it is not working give the application "motion" or "mjpg-streamer" a try.

A LOT depends on the output Pixels of the Camera:

Lot's of camera's are OVERRATED on eBay :frowning_face: like mine was said to be 5MP but when it arrived it say 3MP around the lens, it is still good though

Well,
I've found that the octoPi does change/notice/read the new settings, as they are also mentioned in the Webcam log ( sudo nano /var/log/webcamd.log )

Running ./mjpg_streamer -o output_http.so -w ./www -i input_uvc.so -r 1920x1080 -f 24 -d /dev/video0
MJPG Streamer Version: git rev: ddb69b7b4f114f3c2ca01adf55712792ca8aed43
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1920 x 1080
i: Frames Per Second.: 24
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
ERROR opening V4L interface: Device or resource busy
i: init_VideoIn failed
Found video devices:
/dev/video0
USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>May 26 15:55:55 pi: Starting USB webcam
Running ./mjpg_streamer -o output_http.so -w ./www -i input_uvc.so -r 1920x1080 -f 24 -d /dev/video0
MJPG Streamer Version: git rev: ddb69b7b4f114f3c2ca01adf55712792ca8aed43
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1920 x 1080
i: Frames Per Second.: 24
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
ERROR opening V4L interface: Device or resource busy
i: init_VideoIn failed

So, anyone abled to help with the problem described in the log?

Tried several more times, but the camera only wants to open when on the default 640x480 resolution, despite the camera should be able to at least run at HD (1280x720) resolution.

Who can help me in fixing this issue and have my camera run at a higher then VGA resolution?

Thanks in advance!

Hi there!

i'm using octopi 0.17 (raspi 2) and a raspberry pi v1.3 camera and the video is working fine, but only in 640x480. I tried different ways to raise the resolution, unfortunately most of them don't work out:

  1. change boot/octopi.txt
    • camera="raspi"
    • camera_raspi_options="-x 1280 -y 720 -fps 5"

-> no effect on webstream

  1. manually edit mjpeg-streamer
    • -i "./input_raspicam.so -fps 15 -x 1280 -y 720" -o "./output_http.so -w ./www"

-> no effect

  1. so i disabled wedcamd service and build my own mjpeg-stream service and tada, this works and webcam shows my 1280x720 HD stream (1920x1080 leads to zoomed in picture and strange colors). Unfortunately setting up a manual stream kills the webcam connection for spaghetti-detective-plugin.

any hints and guesses welcome :wink:

-

I tried to reproduce this behavior of octoprint and did a clean install (0.16 image and op 1.3.10):

  • After fresh install everything works as expected and i can modify resolution of raspi_cam in octopi.txt
    (btw i found a usefull overview about raspi-camera limits, FoV and resolution here: https://picamera.readthedocs.io/en/release-1.12/fov.html#camera-modes)

  • after upgrading to 1.3.12, installing spaghetti detective, apt upgrade -> camera resolution switches to 640x480 and can't be modified in octopi.txt anymore. Actually, editing camera-settings has no impact at all on video streming.

  • during reboot i can see a ./mjpg[...] process popping up with correct settings in htop, but this process is gone quiet soon.

-> after all, camera works and connection is solid (no lag, spaghetti detector getting the stream). But i have no idea who and what is providing the stream and how to modify settings. anyways, i'm gonne stick with good old 640x480 video stream remembering good old VGA i386 times :wink:

ok, it's Spaghetti Detector, which is responsible for taking control over Raspi-cam and bypassing octopi.txt camera settings... disabling the plugin brings back mjpg-streamer video. I'm gonne ask the guys over at spaghetti for help ;).

1 Like

Hey what did you find out from those guys? I'm having the same annoyance.

the guys at Shaghetti know about this issue and they are trying to implement options for mjpg streamer. But it's gone take some time and is not going to happen in near future. For now i disabled "webcam streaming" in spaghettig detector plugin and i can use manual settings from octopi.txt again. Spaghetti is still working fine tho, just no live stream on spaghetti web page...

I uninstalled Spaghetti Detector and I am still stuck at 640x480 10fps. I tried copying the "camera_raspi_options="-x 1280 -y 720 -fps 20" directly from the how-to. The # has been deleted, the file saved, and the raspberry pi rebooted twice. Still seeing 640x480 in the mjpeg command in htop.

Maybe it is Octopi Anywhere? I need to start a print in order to be done in time so can't test now. Just a thought for anyone else.

sounds reasonable since Spaghetti and Octoprint anywhere are developed by the same guy.
There is already a feature request on github (https://github.com/TheSpaghettiDetective/OctoPrint-TheSpaghettiDetective/issues/37).

Btw you can check where the stream is coming from in htop:
-> any mjpg-streamer process is started by octoprint (with octopi.txt configuration)
-> otherwise it's Spaghetti or OcAnywhere which takes control of the web stream (i think some python process

I uninstalled Octoprint Anywhere and disabled all non default plugins and I am still only getting the default resolution and frame rate.

htop
./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 640x480 -f 10 -d /dev/video0

octoprint.txt
camera_raspi_options="-x 1280 -y 720 -fps 20"

Edit: Fixed it....

In octoprint.txt also change...
#camera="auto"
to
camera="raspi"

3 Likes

Someone should edit the FAQ on this because my Pi-3 and Pi-cam needed the camera="raspi" in order to change from 640x480 to 720p

2 Likes

as of Feb 16, 2020, this is FAQ from Spaghetti Detective:

I'm having problems with octopi.txt being ignored as well. I had the spaghetti detective and polar3d installed, so I removed those plugins. camera="raspi" is set, the only change I made was to the rotation, the current setup looks like camera_ras-rot 180pi_options= "-fps 10 -rot 180". This is being completely ignored. I have tried to set rotation to every multiple of 90 just to make sure it's not just me missing it in the stream, lol.

1 Like