revbem
March 1, 2023, 1:53pm
1
Camera model
Raspberry Pi Camera Module 2.1 connected to an Raspberry Pi Zero 2 W
What is the problem?
I get an video stream in OctoPrint. But it is only in resolution 640x480.
I can not change it to 1920x1080.
What did you already try to solve it?
I tried severall instructions from different forum posts here:
Hi,
OctoPrint newbie here.
I have a Raspberry Pi Camera Module V2.1 connected to the latest version of OctoPrint (1.8.4) running on a Raspberry Pi 4B. The camera is attached with a 60cm long ribbon cable.
Although the camera works within OctoPrint the resolution only appears to be 640 x 480 and in 4:3 format. From the specifications of the camera module, I believe it should be possible to go to full 1080p HD quality.
Also, the Camera Settings OctoPrint add-in doesn't seem to be recognising tβ¦
What is the problem? Trying to increase resolution and quality of web cam and OctoLapse videos. I would like the web cam image to be of better quality when I full size the dashboard and would like OctoLapse to render either 720p or 1080p (preferred) video with better image quality.
[OctoLapsePic.PNG]
What did you already try to solve it?
Referencing these articles
I'm using a PiCamv2.
As documented I changed the octopi.txt file to camera_raspi_options="-x 1280 -y 720 -fps 10"
β¦
I've run into the "same" issue: the camera_raspi_options in the /boot/octopi.txt is not respected.
camera_raspi_options="-fps 10 -rot 180 -x 1280 -y 1024"
pi@octopi:/boot $ sudo service webcamd restart
pi@octopi:/boot $ sudo service webcamd status
β webcamd.service - the OctoPi webcam daemon with the user specified config
Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-10-28 21:10:28 GMT; 7s ago
Process: 1475β¦
opened 06:07AM - 03 Sep 20 UTC
closed 03:21PM - 31 Jan 21 UTC
#### What were you doing?
1. Connect a Raspberry Pi Camera (both the v1 and v⦠2 have the problem) to the Pi running OctoPi
2. Change the `camera_raspi_options` in `/boot/octopi.txt`
3. Changes have no effect after restarting `webcamd`
#### What did you expect to happen?
Changes to `camera_raspi_options` change the output of `mjpg_streamer` in the OctoPrint UI.
#### What happened instead?
Camera picture was not affected by the options.
#### Did the same happen when running OctoPrint in safe mode?
Did not test, as this is not a problem of OctoPrint.
#### Version of OctoPi
0.17.0
#### Relevant output of `journalctl -u webcamd`
```
Sep 03 06:53:41 octopii webcamd[26541]: Starting up webcamDaemon...
Sep 03 06:53:41 octopii webcamd[26541]: --- Configuration: ----------------------------
Sep 03 06:53:41 octopii webcamd[26541]: cfg_file: /boot/octopi.txt
Sep 03 06:53:41 octopii webcamd[26541]: camera: auto
Sep 03 06:53:41 octopii webcamd[26541]: usb options: -r 640x480 -f 10
Sep 03 06:53:41 octopii webcamd[26541]: raspi options: -fps 10 -ISO 800 -mm backlit -br 100 -hf
Sep 03 06:53:41 octopii webcamd[26541]: http options: -w ./www-octopi -n
Sep 03 06:53:41 octopii webcamd[26541]: Explicitly USB device:
Sep 03 06:53:41 octopii webcamd[26541]: -----------------------------------------------
Sep 03 06:53:41 octopii webcamd[26541]: Found video devices:
Sep 03 06:53:41 octopii webcamd[26541]: /dev/video0
Sep 03 06:53:41 octopii webcamd[26541]: /dev/video10
Sep 03 06:53:41 octopii webcamd[26541]: /dev/video11
Sep 03 06:53:41 octopii webcamd[26541]: /dev/video12
Sep 03 06:53:41 octopii webcamd[26541]: /dev/video13
Sep 03 06:53:41 octopii webcamd[26541]: /dev/video14
Sep 03 06:53:41 octopii webcamd[26541]: /dev/video15
Sep 03 06:53:41 octopii webcamd[26541]: /dev/video16
Sep 03 06:53:41 octopii webcamd[26541]: raspi
Sep 03 06:53:41 octopii webcamd[26541]: config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
Sep 03 06:53:41 octopii root[26553]: Starting USB webcam
Sep 03 06:53:41 octopii webcamd[26541]: <13>Sep 3 06:53:41 root: Starting USB webcam
Sep 03 06:53:41 octopii webcamd[26541]: Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
Sep 03 06:53:41 octopii mjpg_streamer[26554]: MJPG-streamer [26554]: starting application
Sep 03 06:53:41 octopii mjpg_streamer[26554]: MJPG-streamer [26554]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Sep 03 06:53:41 octopii webcamd[26541]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Sep 03 06:53:41 octopii webcamd[26541]: i: Using V4L2 device.: /dev/video0
Sep 03 06:53:41 octopii webcamd[26541]: i: Desired Resolution: 640 x 480
Sep 03 06:53:41 octopii webcamd[26541]: i: Frames Per Second.: 10
Sep 03 06:53:41 octopii webcamd[26541]: i: Format............: JPEG
Sep 03 06:53:41 octopii webcamd[26541]: i: TV-Norm...........: DEFAULT
Sep 03 06:53:41 octopii mjpg_streamer[26554]: MJPG-streamer [26554]: Using V4L2 device.: /dev/video0
Sep 03 06:53:41 octopii mjpg_streamer[26554]: MJPG-streamer [26554]: Desired Resolution: 640 x 480
Sep 03 06:53:41 octopii mjpg_streamer[26554]: MJPG-streamer [26554]: Frames Per Second.: 10
Sep 03 06:53:41 octopii mjpg_streamer[26554]: MJPG-streamer [26554]: Format............: JPEG
Sep 03 06:53:41 octopii mjpg_streamer[26554]: MJPG-streamer [26554]: TV-Norm...........: DEFAULT
```
#### Workaround
Set `camera="raspi"` instead of `camera="auto"` in `/boot/octopi.txt` results in the changes to `camera_raspi_options` to be applied and the log of `webcamd` changes to the following:
```
Sep 03 06:54:55 octopii webcamd[26717]: Starting up webcamDaemon...
Sep 03 06:54:55 octopii webcamd[26717]: --- Configuration: ----------------------------
Sep 03 06:54:55 octopii webcamd[26717]: cfg_file: /boot/octopi.txt
Sep 03 06:54:55 octopii webcamd[26717]: camera: raspi
Sep 03 06:54:55 octopii webcamd[26717]: usb options: -r 640x480 -f 10
Sep 03 06:54:55 octopii webcamd[26717]: raspi options: -fps 10 -ISO 800 -mm backlit -br 100 -hf
Sep 03 06:54:55 octopii webcamd[26717]: http options: -w ./www-octopi -n
Sep 03 06:54:55 octopii webcamd[26717]: Explicitly USB device:
Sep 03 06:54:55 octopii webcamd[26717]: -----------------------------------------------
Sep 03 06:54:55 octopii webcamd[26717]: Found video devices:
Sep 03 06:54:55 octopii webcamd[26717]: /dev/video0
Sep 03 06:54:55 octopii webcamd[26717]: /dev/video10
Sep 03 06:54:55 octopii webcamd[26717]: /dev/video11
Sep 03 06:54:55 octopii webcamd[26717]: /dev/video12
Sep 03 06:54:55 octopii webcamd[26717]: /dev/video13
Sep 03 06:54:55 octopii webcamd[26717]: /dev/video14
Sep 03 06:54:55 octopii webcamd[26717]: /dev/video15
Sep 03 06:54:55 octopii webcamd[26717]: /dev/video16
Sep 03 06:54:55 octopii webcamd[26717]: raspi
Sep 03 06:54:55 octopii webcamd[26717]: config file='/boot/octopi.txt':Start MJPG-streamer with video device: raspi
Sep 03 06:54:55 octopii root[26728]: Starting Raspberry Pi camera
Sep 03 06:54:55 octopii webcamd[26717]: <13>Sep 3 06:54:55 root: Starting Raspberry Pi camera
Sep 03 06:54:55 octopii webcamd[26717]: Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_raspicam.so -fps 10 -ISO 800 -mm backlit -br 100 -hf
Sep 03 06:54:55 octopii mjpg_streamer[26729]: MJPG-streamer [26729]: starting application
Sep 03 06:54:55 octopii mjpg_streamer[26729]: MJPG-streamer [26729]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Sep 03 06:54:55 octopii webcamd[26717]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Sep 03 06:54:56 octopii webcamd[26717]: i: fps.............: 10
Sep 03 06:54:56 octopii webcamd[26717]: i: resolution........: 640 x 480
Sep 03 06:54:56 octopii webcamd[26717]: i: camera parameters..............:
Sep 03 06:54:56 octopii webcamd[26717]: Sharpness 0, Contrast 0, Brightness 100
Sep 03 06:54:56 octopii webcamd[26717]: Saturation 0, ISO 800, Video Stabilisation No, Exposure compensation 0
Sep 03 06:54:56 octopii webcamd[26717]: Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Sep 03 06:54:56 octopii webcamd[26717]: Metering Mode 'backlit', Colour Effect Enabled No with U = 128, V = 128
Sep 03 06:54:56 octopii webcamd[26717]: Rotation 0, hflip Yes, vflip No
Sep 03 06:54:56 octopii webcamd[26717]: ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
Sep 03 06:54:56 octopii webcamd[26717]: o: www-folder-path......: ./www-octopi/
Sep 03 06:54:56 octopii webcamd[26717]: o: HTTP TCP port........: 8080
Sep 03 06:54:56 octopii webcamd[26717]: o: HTTP Listen Address..: (null)
Sep 03 06:54:56 octopii webcamd[26717]: o: username:password....: disabled
Sep 03 06:54:56 octopii webcamd[26717]: o: commands.............: disabled
Sep 03 06:54:56 octopii mjpg_streamer[26729]: MJPG-streamer [26729]: fps.............: 10
Sep 03 06:54:56 octopii webcamd[26717]: i: Starting Camera
```
Note: There was not USB webcam connected at any time to the Pi, it always uses the Raspberry Pi Camera!
`wecamd` seems to choose `/dev/video0` when available, which is also true when using the Raspberry Pi camera. There should be a more sophisticated detection that checks if `/dev/video0` is actually the Raspberry Pi camera and use that one instead of handling `/dev/video0` like a USB webcam.
I changed in octopi.txt parameter: camera_usb_options="-r 1920x1080" but it only seems to zoom in the original 640x480 stream.
I tried also camera_raspi_options="-x 1920 -y 1080 -fps 10 quality 100" but it seems to be ignored.
That's why I swichted camera mode from auto to raspi (camera="raspi") but then no stream at all arrives at OctoPrint
Logs (/var/log/webcamd.log
, syslog, dmesg, ... no logs, no support )
Starting up webcamDaemon...
--- Configuration: ----------------------------
cfg_file: /boot/octopi.txt
camera: raspi
usb options: -r 640x480 -f 10
raspi options: -x 1920 -y 1080
http options: -w ./www
Explicitly set USB device:
Found video devices:
/dev/video0
/dev/video10
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
/dev/video18
/dev/video20
/dev/video21
/dev/video22
/dev/video23
/dev/video31
raspi
config file='/boot/octopi.txt':Starting MJPG-streamer with video device: raspi
<13>Mar 1 14:50:57 root: Starting Raspberry Pi camera
Checking for VL805 (Raspberry Pi 4)...
It seems that you don't have VL805 (Raspberry Pi 4).
There should be no problems with USB (a.k.a. select() timeout)
Running ./mjpg_streamer -o output_http.so -w ./www -i input_raspicam.so -x 1920 -y 1080
MJPG Streamer Version.: 2.0
ERROR: could not find input plugin
Perhaps you want to adjust the search path with:
export LD_LIBRARY_PATH=/path/to/plugin/folder
dlopen: input_raspicam.so: cannot open shared object file: No such file or directory
Done bringing up all configured video devices
Scanning again in two minutes
Additional information about your setup (OctoPrint version, OctoPi version, ...)
OctoPrint version : 1.8.6
OctoPi version : 1.0.0
I believe most of the topics you mentioned probably were from Buster (or earlier) based operating systems (OctoPi 0.18.0 is based on Buster). OctoPi 1.0.0 is based on Bullseye and the camera support is entirely different.
See my suggestion in https://community.octoprint.org/t/raspberry-pi-camera-setup-in-latest-stable-octopi-build/50231/4 . I got my RPi camera V2 working with the information in the topic mentioned there.
revbem
March 2, 2023, 7:37am
3
OK thx. I'll give that a try
revbem
March 6, 2023, 8:50am
4
thanks a lot. Your hint worked for me.
The new video plugin seems to be so much better than the old one.
Hope it will be part of the official OctoPi image soon.