All-in-One Frigate AI NVR
examples/frigate/ turns a single Pixel 6 / 6 Pro into a ~0.8–1.3 W self-contained AI NVR running upstream, unprivileged ghcr.io/blakeblackshear/frigate:stable (verified live on Frigate 0.18.3) — with no custom Docker image, no --privileged flag, no /dev/abrolhos container passthrough, and no external model downloads.
Architecture
Section titled “Architecture”frigate-tpu.serviceruns/usr/local/lib/headless-frigate/tpu-zmq-bridge.pyoveripc:///run/headless-frigate/zmq_detector(0600). On first startup, Frigate uploads its bundled/cpu_model.tflite(320×320 INT8 MobileDet COCO) over the local socket; the bridge strips CPU post-processing, compiles it on-device to an Abrolhos.dgcin 0.71 s, caches it under/var/lib/headless-frigate/models/, and runs inference at ~272 FPS burst (3.68 ms) with 0.15 ms vectorized NumPy SSD decoding & NMS.frigate-camera.service(optional) runs/usr/local/lib/headless-frigate/camera-mfc-publisher.py, capturing 1–2 internal lenses viacamera-ctl, hardware-encoding H.264 on Exynos MFC (/dev/video7), and remuxing withffmpeg -c:v copy(zero CPU re-encoding) into Frigate’s loopbackgo2rtcserver (rtsp://127.0.0.1:8554/<name>).
Verified Live Performance (Pixel 6 Pro raven)
Section titled “Verified Live Performance (Pixel 6 Pro raven)”| Workload | Total SoC Power (ODPM) | TPU Rail | Detect Speed | Temperature |
|---|---|---|---|---|
1 camera (front 720p → MFC → Frigate + TPU @ 5 FPS) |
0.78 W (782 mW) |
4.5 mW |
~14 ms | 28.0 °C |
2 simultaneous cameras (ultrawide + telephoto 720p → 2× MFC → Frigate + TPU) |
1.30 W (1305 mW) |
4.5 mW |
14.6 ms (0.0 skipped FPS) |
34.1 °C |
Deployment
Section titled “Deployment”Copy examples/frigate/ to the phone (or clone the repo on the phone) and run setup.sh with your desired camera topology:
sudo bash examples/frigate/setup.sh --cameras ultrawide,telephoto# Works on both Pixel 6 Pro (raven) and Pixel 6 (oriole)sudo bash examples/frigate/setup.sh --cameras rear,frontsudo bash examples/frigate/setup.sh \ --cameras yard=ultrawide,gate=telephoto \ --width 1280 --height 720 --fps 15 --bitrate 2000000 \ --night-mode auto --max-exposure-ms 200 --max-iso 4800 \ --focus-distance 0# Skips internal camera publisher; uses Tensor Edge TPU for LAN IP camerassudo bash examples/frigate/setup.sh --no-cameraThen add your external LAN RTSP camera streams under cameras: in /var/lib/headless-frigate/config/config.yml (see the commented front_door template in examples/frigate/config.yml) and restart Frigate:
sudo docker compose -f /var/lib/headless-frigate/docker-compose.yml restart frigateBecause the Tensor Edge TPU sustains ~270 FPS on MobileDet COCO, a single Pixel 6 / 6 Pro can serve object detection for dozens of 5 FPS LAN camera feeds.
(You can also pre-enable Frigate bootstrap directly during first-boot provisioning in the WebUSB Installer.)
Accessing the Frigate Web UI
Section titled “Accessing the Frigate Web UI”- Open
https://<phone-hostname>.local:8971(ports exposed:8971HTTPS UI/API,8555/tcp+8555/udpWebRTC;8554is bound to127.0.0.1only; unauthenticated port5000is intentionally not published). - Retrieve the auto-generated initial
adminpassword:Terminal window docker logs frigate | grep -A4 'Created a default user'
Camera Aliases & Topology Rules
Section titled “Camera Aliases & Topology Rules”| Alias | HAL Spec | Default Frigate Name | Sensor (raven) |
|---|---|---|---|
wide |
0.2 |
pixel_wide |
Samsung GN1 (50 MP, 6.81 mm) |
ultrawide |
0.3 |
pixel_ultrawide |
Sony IMX386 (12 MP, 2.35 mm) |
telephoto / tele |
0.4 |
pixel_telephoto |
Sony IMX586 (48 MP 4× periscope, 19.00 mm) |
rear |
0 |
pixel_rear |
Rear logical multi-cam |
front |
1 |
pixel_front |
Sony IMX663 (11 MP, 2.74 mm) |
Complete setup.sh Option Reference
Section titled “Complete setup.sh Option Reference”| Flag | Default | Bounds / Notes |
|---|---|---|
--cameras <LIST> |
(choose one) | 1–2 comma-separated aliases, raw specs (N/N.P), or name=spec pairs. |
--camera <SPEC> |
(choose one) | Single-camera shorthand. |
--no-camera |
(choose one) | External LAN RTSP cameras only; disables internal publisher blocks in existing config.yml while preserving external go2rtc streams. |
--width / --height |
1280 / 720 |
Even integers: 160..4096 and 120..3072. |
--fps |
15 |
1..60 (also sets encoder --gop $((FPS * 2))). |
--bitrate |
2000000 |
Target H.264 bitrate in bps (> 0). |
--night-mode |
off |
off, auto, or on slow-shutter color night vision. |
--max-exposure-ms |
200 |
33..500 ms. |
--max-iso |
4800 |
400..10000. |
--night-target-luma |
75 |
20..180. |
--ev-comp |
0 |
-24..24 (1/6 EV steps). |
--focus-distance |
(auto AF) | 0 (infinity) or 0.000001..15.0 diopters (pre-validated against min_focus_distance). |
--power-state |
6 |
0..7 Edge TPU DarwiNN DVFS state. |
--force-config |
Off | Overwrite an existing /var/lib/headless-frigate/config/config.yml. |
--teardown |
Off | Stops & removes systemd services, brings down Docker Compose, removes /usr/local/lib/headless-frigate, while preserving /var/lib/headless-frigate (config, recordings, compiled models). |
Interaction with Brownout Guard
Section titled “Interaction with Brownout Guard”By default, brownout-guard.service sets SHED_UNITS=frigate-camera.service. Regardless of charger type, if active battery drain reaches <= 15% SOC (sustained 60 s) or battery voltage sags <= 3450 mV (sustained 15 s) — for example on an unplugged phone or a weak 5 V / 500 mA USB-SDP port — the guard gracefully stops the camera/MFC publisher to prevent hardware brownout and automatically resumes it once power recovers.
If you want to shed the TPU bridge too, add both to /etc/headless-phone/brownout-guard.conf:
SHED_UNITS=frigate-camera.service,frigate-tpu.service