5

Building a Pi Frigate NVR with Axzez's Interceptor 1U Case

 1 year ago
source link: https://www.jeffgeerling.com/blog/2024/building-pi-frigate-nvr-axzezs-interceptor-1u-case
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Building a Pi Frigate NVR with Axzez's Interceptor 1U Case

April 19, 2024
Axzez 1U Interceptor Case with Raspberry Pi NVR

In today's video, I walked through setting up Axzez's Interceptor 1U case with a Raspberry Pi as a Frigate NVR, or Network Video Recorder.

Doing so allows me to plug multiple PoE security cameras straight into the back of the device, and record their IP video streams to disk (the case has space for up to 3 hard drives or SSDs). And by adding on a USB Coral TPU, I can also run inference on frames where motion is detected, and identify people, cars, bikes, and more using built-in object recognition models.

Axzez 1U Interceptor Case with network and Coral TPU plugged in

The video makes use of my open source pi-nvr project, which uses Ansible to install NVR software on a Raspberry Pi. A Raspberry Pi isn't a strict requirement—Frigate and other open source NVR apps run great on a wide variety of computers—but it is efficient and well-supported. And, nowadays you can find a Pi 4 or Pi 5 most anywhere.

The Axzez Interceptor makes use of the Compute Module 4, which exposes PCI Express through it's board-to-board connector. This lets the Interceptor use up to 5 SATA connections for the hard drives, meaning using disks in RAID is more reliable than if you were to plug them in using USB.

A Pi 5 or future Compute Module 5 could increase bandwidth and likely support 2-4x more cameras than the Compute Module 4, but I am only planning on deploying four or five HD (1080p) cameras for now.

Optimizing Frigate on the Raspberry Pi

Unless you've been under a rock, the past few years have changed a lot regarding the Raspberry Pi's value proposition as a tiny homelab PC. Between shortages and the first-ever price increase for the Pi 5 base model ($35 for 1 GB Pi 4 to $60 for 4GB Pi 5), there are a lot of times when a used mini PC could be a better value, even if it uses 1.5-2x more power at idle.

Especially considering the iGPUs built into more modern Intel mini PCs, they are a great value for a simple router, a small VM server running Proxmox, or even as a Frigate NVR box. You could even skip the Coral TPU if the built-in iGPU is fast enough.

But the Pi is still a decent value—and you don't need a more expensive Pi 5 to run Frigate well.

I have been exploring ways to optimize Frigate's performance on the Compute Module 4 and other Pi models, and here are a few quick wins—which also help on faster computers, but may not be as necessary:

  • Don't use the camera's main stream for the detect role; you can use a 480p substream (some cameras even output 360p), and it will still have enough resolution for the Pi to process.
  • Only use the full resolution stream (1080p or 4K) for the record role. It will be recorded in the background (if you choose), and any detected objects will save off clips using that raw recorded footage.
  • Configure Frigate's storage to use NVMe or disk-based storage, don't have it write to eMMC memory or any kind of microSD card. Ideally, get NVR-ready hard drives, like WD's Purple / Surveillance line. They're designed for constant writes and some reads, and should work a little better for the purpose.

I'm still trying to figure out how to speed up operations like exporting footage either as timelapses or the realtime clips. Some things are limited by the I/O of the Pi itself, and would benefit from running on a Pi 5 vs a Pi 4 or CM4.

Watch the full video with my build process and a bit more on Frigate setup on the Raspberry Pi here:


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK