Pi camera streaming with picamera2-WebUI

Picamera-WebUI is still in development but very useful for setting up, testing and controlling streaming from a Raspberry Pi. It also can capture photos and had an image gallery to view, delete or download images. Haven’t tried photo capture or the image gallery. Not needed for the project I’m working on.

Simple installation. Update the Pi OS. Clone the repository, change to the app directory then run the app in python. Details on the github page in the Getting Started section.

You may encounter a “Cannot allocate memory” failure on first running. This is a known problem reported on Pi 4B, 3B+ and 2B+. Will be fixed in future releases. The problem appears to be that the video configuration call creates 6 buffers by default and that takes up too much memory. I had to add buffer_count=3 to the create_video_configuration call; that was the maximum for my 3B+. A count of 5 reportedly worked for a 4B. buffer_count does not appear in the source code, you have to add it in 3 places that call create_video_configuration.
video_config = picam2.create_video_configuration(buffer_count=3, main={…………………

Really good for first test of streaming. You can modify camera parameters and save them for the next start. The web image covers a much smaller area than seen with the initial static test; I’m not sure why that is. Someone else can chase it down.