Centralized Security Camera Preprocessing

centralized preprocessing architecture

Centralized Security Camera Preprocessing: Sounds neat, right? Lets start with the backstory. Shortly after starting work at my new company, we discovered that the company had been infiltrated by a hacker some time before I started, and spread ransomware throughout the network. This naturally necessitated a complete overhaul of the network, and a wipe of almost everything. On the plus side, this allowed us to clean up a lot of poorly-designed infrastructure and recreate it all in a much more sane manner.

One issue presented itself. The CEO had security cameras streaming in his office, coming in through in-wall HDMI cables from the server room. These computers were streaming from the old analog camera system that we were discontinuing as part of the overhaul. There was no equivalent offering for the digital system.

I thought long and hard about how to resolve this. I tried deploying RaspberryPis running FFMPEG to stream the camera streams directly as required. They couldn’t handle the processing load no matter what I tried. After a couple months of trying everything I could think of to squeeze enough performance out of the PIs, I decided to try an alternative approach.

RESOLUTION: Camera Preprocessing

I realized that the RaspberryPi, though a very capable little computer, simply couldn’t handle the workload. They had to handle streaming and processing multiple streams and recombining those streams into a grid, like it was with the old system. Since they couldn’t, I decided to create something new. I called it the camera preprocessing VM. What does it do? Well, to put it simply, it receives the camera streams and does whatever needs to be done to those streams. It then sends the final result to a target raspberry pi. The pi only needs to sit there and receive the stream! Simple, right? This allowed me to do basically anything I wanted with the camera streams. Stitch together 6 streams? Easy. De-warp multiple 360 degree fish eye cameras? No problem. The cam preprocessing VM simply runs multiple instances of FFMPEG. It does the work, then sends the final stream to the pi over SSH.