What is the problem?
I have a Pi 3B+ and an old raspberry pi camera. I get weird behavior with OctoPi on both the old and new camera stacks. I'm currently on the new stack and using the latest Camera Streamer Control plugin. All the tests here are with WebRTC. MJPEG doesn't even seem to load at the higher resolutions for me at this point. The camera seems to get cropped with no way to use a lower resolution with the full frame output.
What did you already try to solve it?
I've tried different combinations of settings in /boot/camera-streamer/libcamera.conf
Here is some info from libcamera-hello about the camera:
libcamera-hello --list-cameras
Available cameras
-----------------
0 : imx219 [3280x2464] (/base/soc/i2c0mux/i2c@1/imx219@10)
Modes: 'SRGGB10_CSI2P' : 640x480 [30.00 fps - (0, 0)/0x0 crop]
1640x1232 [30.00 fps - (0, 0)/0x0 crop]
1920x1080 [30.00 fps - (0, 0)/0x0 crop]
3280x2464 [30.00 fps - (0, 0)/0x0 crop]
'SRGGB8' : 640x480 [30.00 fps - (0, 0)/0x0 crop]
1640x1232 [30.00 fps - (0, 0)/0x0 crop]
1920x1080 [30.00 fps - (0, 0)/0x0 crop]
3280x2464 [30.00 fps - (0, 0)/0x0 crop]
This seems to imply that I can specify something like 640x480 and have no crop. So here is the config for that:
PORT=8080
# The resolution to request on the camera sensor. Defaults to 1280x720.
WIDTH=640
HEIGHT=480
# The height to use for the video stream. Defaults to 720.
VIDEO_HEIGHT=720
# The height to use for the snapshots. Defaults to 1080.
SNAPSHOT_HEIGHT=1080
# The framerate to set on the camera. Defaults to 15fps.
FRAMERATE=30
# Additional options. By default enables continuous auto focus (if possible).
OPTIONS='--camera-options="AfMode=2" --camera-options="AfRange=2" --camera-hflip=1 --camera-vflip=1'
That leads to a deep crop:
Now I try with the largest resolution. Only difference to config:
WIDTH=3280
HEIGHT=2464
It loads maybe half of one frame then crashes:
Refreshing can't get more to load generally.
Notice though how much wider this larger resolution is. I'd like to use that resolution to get a non-cropped image but then stream it at a lower resolution.
Here is another try with 1920x1080:
PORT=8080
# The resolution to request on the camera sensor. Defaults to 1280x720.
WIDTH=1920
HEIGHT=1080
# The height to use for the video stream. Defaults to 720.
VIDEO_HEIGHT=1080
# The height to use for the snapshots. Defaults to 1080.
SNAPSHOT_HEIGHT=1080
# The framerate to set on the camera. Defaults to 15fps.
FRAMERATE=30
# Additional options. By default enables continuous auto focus (if possible).
OPTIONS='--camera-options="AfMode=2" --camera-options="AfRange=2" --camera-hflip=1 --camera-vflip=1'
It works, but is cropped:
I just want the full FOV at a lower resolution via OctoPi
Have you tried running in safe mode?
Yes
Did running in safe mode solve the problem?
Not really, no.
Systeminfo Bundle
octoprint-systeminfo-20230919192711.zip (112.6 KB)
Additional information about your setup
uname -a
Linux 3dprinter 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l GNU/Linux
cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 44.80
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4
Hardware : BCM2835
Revision : a020d3
Serial : 00000000bd5ea946
Model : Raspberry Pi 3 Model B Plus Rev 1.3
cat /boot/octopi.txt
### IMPORTANT: Looking for the camera settings? Those are now located
### in the camera-streamer directory! libcamera.conf to configure the Raspberry Pi
### camera and usb-default.conf to configure USB cameras. Read more about it here:
### https://faq.octoprint.org/camera-streamer-config
### Windows users: To edit this file use Notepad++, VSCode or SublimeText.
### Do not use Notepad or WordPad.
### MacOSX users: If you use Textedit to edit this file make sure to use
### "plain text format" and "disable smart quotes" in "Textedit > Preferences"
# Configuration of network monitoring
#
# This enables network monitoring for wifi connections with a simple ping test.
# If connection terminates by variable reasons system tries to restart the wifi connection to reestablish a connection.
# The connection test is done every minute.
# By default it is disabled (0 = off / 1 = on)
# destination_host can be an ip address or a hostname (for hostname ensure dns resosultion is working correctly)
enable_network_monitor=0
# Be sure to change this to match your network!
destination_host=192.168.1.1
### EXPERIMENTAL
# Support for different streamer types.
#
# Available options:
# mjpeg [default] - camera-streamer
# hls - FFMPEG HLS streamer
#camera_streamer=mjpeg
cat /etc/octopi_buildbase
2022-09-22-raspios-bullseye-armhf-lite.img
cat /etc/octopi_version
1.0.0
vcgencmd get_camera
supported=1 detected=0, libcamera interfaces=1
libcamera-hello --list-cameras -v
Available cameras
-----------------
0 : imx219 [3280x2464] (/base/soc/i2c0mux/i2c@1/imx219@10)
Modes: 'SRGGB10_CSI2P' : 640x480 [30.00 fps - (0, 0)/0x0 crop]
1640x1232 [30.00 fps - (0, 0)/0x0 crop]
1920x1080 [30.00 fps - (0, 0)/0x0 crop]
3280x2464 [30.00 fps - (0, 0)/0x0 crop]
'SRGGB8' : 640x480 [30.00 fps - (0, 0)/0x0 crop]
1640x1232 [30.00 fps - (0, 0)/0x0 crop]
1920x1080 [30.00 fps - (0, 0)/0x0 crop]
3280x2464 [30.00 fps - (0, 0)/0x0 crop]
Available controls for 3280x2464 SRGGB10_CSI2P mode:
----------------------------------------------------
AeConstraintMode : [0..3]
AeEnable : [false..true]
AeExposureMode : [0..3]
AeMeteringMode : [0..3]
AnalogueGain : [1.000000..16.000000]
AwbEnable : [false..true]
AwbMode : [0..7]
Brightness : [-1.000000..1.000000]
ColourGains : [0.000000..32.000000]
Contrast : [0.000000..32.000000]
ExposureTime : [0..66666]
ExposureValue : [-8.000000..8.000000]
FrameDurationLimits : [33333..120000]
NoiseReductionMode : [0..4]
Saturation : [0.000000..32.000000]
ScalerCrop : [(0, 0)/0x0..(65535, 65535)/65535x65535]
Sharpness : [0.000000..16.000000]
cat /boot/config.txt
arm_64bit=0
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Automatically load overlays for detected cameras
camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Disable compensation for displays with overscan
disable_overscan=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[all]
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
[all]
# enable raspicam
start_x=1
gpu_mem=128
I used imgur for some photos since new folks can only have one embedded media.