Skip to main content

Fix the stream

· One min read
Ludovico Ferrara
Maintainer of Security-Cam

Fixing old issues

In my previous setup, I used picamera for recording and streaming video on the Raspberry Pi. However, I noticed a recurring issue: the video stream would consistently freeze whenever a recording started, only resuming after the recording was complete. While this wasn't a big problem, it was frustrating enough to warrant a closer look.

To address this, I decided to explore an alternative approach using OpenCV. I wrote a small test script that streams frames to a Flask endpoint. After modifying the ClientVideoPlayer component in our placeholder dashboard, I successfully established a stable video stream. The next step was to test whether the video could be recorded while maintaining a continuous and stable feed to the dashboard—and I'm happy to report that this was a success.

As a result, we're transitioning from using picamera and WebSockets for streaming to using Flask and OpenCV. While I still have a few more tests to conduct before finalizing this decision, resolving the most frustrating issue from the old code feels like a significant step forward.