Open geerlingguy opened 3 weeks ago
I found this thread: https://github.com/AlexxIT/go2rtc/issues/881 — it recommends using:
streams:
picam_h264: exec:rpicam-vid -t 0 --inline --libav-format h264 -o -
picam_mjpeg: exec:rpicam-vid -t 0 --codec mjpeg --libav-format mpegts -o -
But there was no difference. Still got the same result as above. I'm running Safari... could there be a weird issue there? Edit: Nope, same thing in Chrome and Firefox.
If I try opening the MJPEG stream (http://10.0.2.204:1984/api/stream.mjpeg?src=picam_mjpeg
) directly from VLC, I get:
18:41:06.303 ERR [api.mjpeg] add consumer error="streams: exec/pipe: %!w(<nil>)\n[0:01:09.318561982] [940] \x1b[1;32m INFO \x1b[1;37mCamera \x1b[1;34mcamera_manager.cpp:284 \x1b[0mlibcamera v0.2.0+120-eb00c13d\n[0:01:09.328919040] [945] \x1b[1;32m INFO \x1b[1;37mRPI \x1b[1;34mpisp.cpp:695 \x1b[0mlibpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)\n[0:01:09.434117733] [945] \x1b[1;32m INFO \x1b[1;37mRPI \x1b[1;34mpisp.cpp:1154 \x1b[0mRegistered camera /base/axi/pcie@120000/rp1/i2c@88000/imx708@1a to CFE device /dev/media0 and ISP device /dev/media1 using PiSP variant BCM2712_C0\nPreview window unavailable\n[0:01:09.43900..."
And formatted:
18:41:06.303 ERR [api.mjpeg] add consumer error="streams: exec/pipe: %!w(<nil>)
[0:01:09.318561982] [940] \x1b[1;32m INFO \x1b[1;37mCamera \x1b[1;34mcamera_manager.cpp:284 \x1b[0mlibcamera v0.2.0+120-eb00c13d
[0:01:09.328919040] [945] \x1b[1;32m INFO \x1b[1;37mRPI \x1b[1;34mpisp.cpp:695 \x1b[0mlibpisp version v1.0.5 999da5acb4f4 17-04-2024 (14:29:29)
[0:01:09.434117733] [945] \x1b[1;32m INFO \x1b[1;37mRPI \x1b[1;34mpisp.cpp:1154 \x1b[0mRegistered camera /base/axi/pcie@120000/rp1/i2c@88000/imx708@1a to CFE device /dev/media0 and ISP device /dev/media1 using PiSP variant BCM2712_C0
Preview window unavailable
[0:01:09.43900..."
Testing on a fresh Pi OS 12 install with picamera2-WebUI-Lite instead:
# Install dependencies.
sudo apt install -y git python3-pip
sudo apt install -y python3-picamera2 --no-install-recommends
# Make Python not hate me.
sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
# Clone the project.
git clone https://github.com/monkeymademe/picamera2-WebUI-Lite.git
cd picamera2-WebUI-Lite
pip3 install Flask Pillow
# Run the app.
export PATH=$PATH:/home/pi/.local/bin
python app.py
And that works! Nice level of control (though the UI could be simplified and have like a 'beginner' mode with just a few focus, exposure, and WB controls).
It's only using about 30% CPU load too:
That's at 720p resolution. If I kick it up to 1080p, it jumps to 50-60% CPU. 1440p(ish) hits 80% CPU, and 4K gets stuttery and pushes 250% CPU.
To debug, I just set up a brand new Pi 5 with a brand new Pi OS Bookworm 64-bit Lite install.
@geerlingguy - I had to use Install Raspberry Pi OS Bookworm (Full Install). Full Install required for all components to run properly. Lite is missing H.264 codec for libcamera.
Lite is missing H.264 codec for libcamera.
Ah... do you know what package installs it?
I think you'd have to build rpicam-apps source code, and rpi docs. I opted to do the Full Install vs. the build, so I couldn't help you beyond that.
I'm setting up a new Pi 5 with OctoPrint—well, hopefully—but I've run into a snag. I have a Camera Module 3 attached, but the latest nightly (6-7-2024) image build isn't working out of the box.
I started debugging over in this issue: https://github.com/guysoft/OctoPi/issues/823#issuecomment-2155646805
But rather than use that issue for rubber-duck-debugging, I'll use this issue to not pollute the OctoPi repo further, until I have more to report.
To debug, I just set up a brand new Pi 5 with a brand new Pi OS Bookworm 64-bit Lite install.
I ran apt update/upgrade, and installed the libcamera-apps suite:
sudo apt install libcamera-apps -y
. I rebooted, and verified I could see the camera:Then I tried using
go2rtc
to stream to my browser:In the browser, I opened http://10.0.2.204:1984 and opened one of the two streams. I end up with a window like:
or for mjpeg: