# blakeblackshear/frigate architecture

> Architecture diagram of the GitHub repository blakeblackshear/frigate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/blakeblackshear/frigate
- Repository: https://github.com/blakeblackshear/frigate
- Video tour (about a minute): https://gitdiagram.com/blakeblackshear/frigate/video

## Overview

Frigate is a local, AI-enabled NVR for IP cameras, with a web interface and Home Assistant/MQTT integration. The main workflow ingests camera streams, uses motion to focus object detection, tracks activity, and stores recordings and event data for review and live viewing. The graph also preserves documented streaming, recording, and integration capabilities and substantial indexed modules. Some subsystem links rely on README descriptions; unsampled implementations and wiring are not inferred beyond those statements.

Main entry points: [`frigate/app.py`](https://github.com/blakeblackshear/frigate/blob/dev/frigate/app.py) (Application Runtime), [`frigate/video/ffmpeg.py`](https://github.com/blakeblackshear/frigate/blob/dev/frigate/video/ffmpeg.py) (Video and FFmpeg), [`frigate/models.py`](https://github.com/blakeblackshear/frigate/blob/dev/frigate/models.py) (Event and Media Data), [`frigate/events/maintainer.py`](https://github.com/blakeblackshear/frigate/blob/dev/frigate/events/maintainer.py) (Event Processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Camera Ingest"]
  node_video["Video and FFmpeg<br/>[ffmpeg.py]"]
end

subgraph group_analysis["Detection and Events"]
  node_motion["Motion Detection<br/>[frigate_motion.py]"]
  node_detector_config["Detector Setup<br/>[detector_config.py]"]
  node_detectors["Object Detectors"]
  node_tracking["Object Tracking"]
  node_events["Event Processing<br/>[maintainer.py]"]
  node_postprocess["Post Processing"]
  node_genai["GenAI Providers<br/>[__init__.py]"]
  node_embeddings["Embeddings<br/>[embeddings.py]"]
end

subgraph group_media["Media and Storage"]
  node_database[("Event and Media Data<br/>[models.py]")]
  node_recording["Recording<br/>[record.py]"]
  node_storage["Retention and Usage<br/>[storage.py]"]
  node_live_output["Live Output<br/>[output.py]"]
end

subgraph group_interfaces["User Interfaces"]
  node_api["HTTP API<br/>[fastapi_app.py]"]
  node_web["Web Interface<br/>[App.tsx]"]
end

subgraph group_platform["Configuration and Integrations"]
  node_config["Configuration<br/>[config.py]"]
  node_runtime["Application Runtime<br/>[app.py]"]
  node_camera_config["Camera Config Updates<br/>[updater.py]"]
  node_interprocess["Process Messaging<br/>[inter_process.py]"]
  node_mqtt["MQTT Integration<br/>[mqtt.py]"]
  node_analytics["Usage Analytics<br/>[reporter.py]"]
end

node_operator(("NVR Operator"))
node_camera(("IP Cameras"))
node_mqtt_service(("MQTT Broker"))
node_home_assistant(("Home Assistant"))

node_operator -->|"configures"| node_camera
node_camera -->|"sends streams"| node_video
node_config -.->|"configures"| node_runtime
node_runtime -->|"updates"| node_camera_config
node_camera_config -->|"publishes updates"| node_interprocess
node_runtime -.->|"starts services"| node_video
node_video -->|"provides frames"| node_motion
node_motion -->|"focuses detection"| node_detectors
node_detector_config -->|"configures"| node_detectors
node_detectors -.->|"detects objects"| node_tracking
node_tracking -.->|"tracks activity"| node_events
node_events -.->|"stores event data"| node_database
node_events -.->|"dispatches processing"| node_postprocess
node_postprocess -->|"requests descriptions"| node_genai
node_postprocess -->|"updates embeddings"| node_embeddings
node_embeddings -->|"stores vectors"| node_database
node_video -->|"records video"| node_recording
node_recording -.->|"stores recording metadata"| node_database
node_storage -->|"reads recording data"| node_database
node_video -->|"restreams"| node_live_output
node_operator -->|"uses"| node_web
node_web -.->|"requests data"| node_api
node_api -.->|"serves event data"| node_database
node_runtime -->|"starts API"| node_api
node_runtime -->|"starts integration"| node_mqtt
node_mqtt -->|"publishes messages"| node_mqtt_service
node_mqtt_service -->|"integrates with"| node_home_assistant
node_runtime -->|"starts reporting"| node_analytics

click node_config "https://github.com/blakeblackshear/frigate/blob/dev/frigate/config/config.py"
click node_runtime "https://github.com/blakeblackshear/frigate/blob/dev/frigate/app.py"
click node_camera_config "https://github.com/blakeblackshear/frigate/blob/dev/frigate/config/camera/updater.py"
click node_interprocess "https://github.com/blakeblackshear/frigate/blob/dev/frigate/comms/inter_process.py"
click node_mqtt "https://github.com/blakeblackshear/frigate/blob/dev/frigate/comms/mqtt.py"
click node_video "https://github.com/blakeblackshear/frigate/blob/dev/frigate/video/ffmpeg.py"
click node_motion "https://github.com/blakeblackshear/frigate/blob/dev/frigate/motion/frigate_motion.py"
click node_detector_config "https://github.com/blakeblackshear/frigate/blob/dev/frigate/detectors/detector_config.py"
click node_detectors "https://github.com/blakeblackshear/frigate/tree/dev/frigate/detectors/plugins"
click node_tracking "https://github.com/blakeblackshear/frigate/blob/dev/frigate/track/object_processing.py"
click node_events "https://github.com/blakeblackshear/frigate/blob/dev/frigate/events/maintainer.py"
click node_postprocess "https://github.com/blakeblackshear/frigate/tree/dev/frigate/data_processing/post"
click node_genai "https://github.com/blakeblackshear/frigate/blob/dev/frigate/genai/__init__.py"
click node_embeddings "https://github.com/blakeblackshear/frigate/blob/dev/frigate/embeddings/embeddings.py"
click node_database "https://github.com/blakeblackshear/frigate/blob/dev/frigate/models.py"
click node_recording "https://github.com/blakeblackshear/frigate/blob/dev/frigate/record/record.py"
click node_storage "https://github.com/blakeblackshear/frigate/blob/dev/frigate/storage.py"
click node_live_output "https://github.com/blakeblackshear/frigate/blob/dev/frigate/output/output.py"
click node_api "https://github.com/blakeblackshear/frigate/blob/dev/frigate/api/fastapi_app.py"
click node_web "https://github.com/blakeblackshear/frigate/blob/dev/web/src/App.tsx"
click node_analytics "https://github.com/blakeblackshear/frigate/blob/dev/frigate/analytics/reporter.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_video toneBlue
class node_motion,node_detector_config,node_detectors,node_tracking,node_events,node_postprocess,node_genai,node_embeddings toneAmber
class node_database,node_recording,node_storage,node_live_output toneMint
class node_api,node_web toneRose
class node_config,node_runtime,node_camera_config,node_interprocess,node_mqtt,node_analytics,node_operator,node_camera,node_mqtt_service,node_home_assistant toneIndigo
```

## Components

### Camera Ingest

- [Video and FFmpeg](https://github.com/blakeblackshear/frigate/blob/dev/frigate/video/ffmpeg.py): `frigate/video/ffmpeg.py`

### Detection and Events

- [Motion Detection](https://github.com/blakeblackshear/frigate/blob/dev/frigate/motion/frigate_motion.py): `frigate/motion/frigate_motion.py`
- [Detector Setup](https://github.com/blakeblackshear/frigate/blob/dev/frigate/detectors/detector_config.py): `frigate/detectors/detector_config.py`
- [Object Detectors](https://github.com/blakeblackshear/frigate/tree/dev/frigate/detectors/plugins): `frigate/detectors/plugins`
- [Object Tracking](https://github.com/blakeblackshear/frigate/blob/dev/frigate/track/object_processing.py): `frigate/track/object_processing.py`
- [Event Processing](https://github.com/blakeblackshear/frigate/blob/dev/frigate/events/maintainer.py): `frigate/events/maintainer.py`
- [Post Processing](https://github.com/blakeblackshear/frigate/tree/dev/frigate/data_processing/post): `frigate/data_processing/post`
- [GenAI Providers](https://github.com/blakeblackshear/frigate/blob/dev/frigate/genai/__init__.py): `frigate/genai/__init__.py`
- [Embeddings](https://github.com/blakeblackshear/frigate/blob/dev/frigate/embeddings/embeddings.py): `frigate/embeddings/embeddings.py`

### Media and Storage

- [Event and Media Data](https://github.com/blakeblackshear/frigate/blob/dev/frigate/models.py): `frigate/models.py`
- [Recording](https://github.com/blakeblackshear/frigate/blob/dev/frigate/record/record.py): `frigate/record/record.py`
- [Retention and Usage](https://github.com/blakeblackshear/frigate/blob/dev/frigate/storage.py): `frigate/storage.py`
- [Live Output](https://github.com/blakeblackshear/frigate/blob/dev/frigate/output/output.py): `frigate/output/output.py`

### User Interfaces

- [HTTP API](https://github.com/blakeblackshear/frigate/blob/dev/frigate/api/fastapi_app.py): `frigate/api/fastapi_app.py`
- [Web Interface](https://github.com/blakeblackshear/frigate/blob/dev/web/src/App.tsx): `web/src/App.tsx`

### Configuration and Integrations

- [Configuration](https://github.com/blakeblackshear/frigate/blob/dev/frigate/config/config.py): `frigate/config/config.py`
- [Application Runtime](https://github.com/blakeblackshear/frigate/blob/dev/frigate/app.py): `frigate/app.py`
- [Camera Config Updates](https://github.com/blakeblackshear/frigate/blob/dev/frigate/config/camera/updater.py): `frigate/config/camera/updater.py`
- [Process Messaging](https://github.com/blakeblackshear/frigate/blob/dev/frigate/comms/inter_process.py): `frigate/comms/inter_process.py`
- [MQTT Integration](https://github.com/blakeblackshear/frigate/blob/dev/frigate/comms/mqtt.py): `frigate/comms/mqtt.py`
- [Usage Analytics](https://github.com/blakeblackshear/frigate/blob/dev/frigate/analytics/reporter.py): `frigate/analytics/reporter.py`

### Other components

- **NVR Operator**
- **IP Cameras**
- **MQTT Broker**
- **Home Assistant**

## Connections

- NVR Operator → IP Cameras: configures (evidence: `README.md`)
- IP Cameras → Video and FFmpeg: sends streams (evidence: `README.md`)
- Configuration → Application Runtime: configures (evidence: `frigate/app.py`)
- Application Runtime → Camera Config Updates: updates (evidence: `frigate/app.py`)
- Camera Config Updates → Process Messaging: publishes updates (evidence: `frigate/config/camera/updater.py`)
- Application Runtime → Video and FFmpeg: starts services
- Video and FFmpeg → Motion Detection: provides frames (evidence: `README.md`)
- Motion Detection → Object Detectors: focuses detection (evidence: `README.md`)
- Detector Setup → Object Detectors: configures (evidence: `frigate/detectors/detector_config.py`)
- Object Detectors → Object Tracking: detects objects
- Object Tracking → Event Processing: tracks activity
- Event Processing → Event and Media Data: stores event data
- Event Processing → Post Processing: dispatches processing
- Post Processing → GenAI Providers: requests descriptions (evidence: `frigate/data_processing/post/review_descriptions.py`)
- Post Processing → Embeddings: updates embeddings (evidence: `frigate/data_processing/post/review_descriptions.py`)
- Embeddings → Event and Media Data: stores vectors (evidence: `frigate/embeddings/embeddings.py`)
- Video and FFmpeg → Recording: records video (evidence: `README.md`)
- Recording → Event and Media Data: stores recording metadata
- Retention and Usage → Event and Media Data: reads recording data (evidence: `frigate/storage.py`)
- Video and FFmpeg → Live Output: restreams (evidence: `README.md`)
- NVR Operator → Web Interface: uses (evidence: `README.md`)
- Web Interface → HTTP API: requests data
- HTTP API → Event and Media Data: serves event data
- Application Runtime → HTTP API: starts API (evidence: `frigate/app.py`)
- Application Runtime → MQTT Integration: starts integration (evidence: `frigate/app.py`)
- MQTT Integration → MQTT Broker: publishes messages (evidence: `README.md`)
- MQTT Broker → Home Assistant: integrates with (evidence: `README.md`)
- Application Runtime → Usage Analytics: starts reporting (evidence: `frigate/app.py`)
