### Frontend End-to-End (E2E) Testing Setup Source: https://github.com/blakeblackshear/frigate/blob/dev/CLAUDE.md Commands for setting up and running end-to-end tests for the frontend. This includes installing dependencies, installing browser binaries, and running tests. ```bash # E2E: first-time setup npm install npx playwright install chromium ``` ```bash # E2E: build the app and run all tests npm run e2e:build && npm run e2e ``` ```bash # E2E: interactive UI for debugging npm run e2e:ui ``` ```bash # E2E: run a specific spec npx playwright test --config e2e/playwright.config.ts e2e/specs/live.spec.ts ``` ```bash # E2E: filter by name, or run only desktop/mobile npx playwright test --config e2e/playwright.config.ts --grep="severity tab" ``` ```bash npx playwright test --config e2e/playwright.config.ts --project=desktop ``` -------------------------------- ### Install Frontend Dependencies and Playwright Browsers Source: https://github.com/blakeblackshear/frigate/blob/dev/AGENTS.md Commands for initial setup of the frontend, including installing npm packages and downloading necessary Playwright browsers for E2E testing. ```bash npm install ``` ```bash npx playwright install chromium ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/blakeblackshear/frigate/blob/dev/AGENTS.md Command to start the development server for the frontend. AI agents should not run this directly unless instructed. ```bash npm run dev ``` -------------------------------- ### Install Web Dependencies via NPM Source: https://github.com/blakeblackshear/frigate/blob/dev/web/README.md Run this command in the `/web` directory to install all necessary Node.js packages for the frontend development. ```bash npm install ``` -------------------------------- ### Download Hailo8L installation script Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/installation.md Downloads the official user installation script for the Hailo8L accelerator. This script automates the installation of dependencies, driver, firmware, and udev rules. ```bash wget https://raw.githubusercontent.com/blakeblackshear/frigate/dev/docker/hailo8l/user_installation.sh ``` -------------------------------- ### Raspberry Pi Home Assistant App Configuration (YAML) Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/config.md A complete YAML configuration example for a Raspberry Pi setup with a USB Coral detector, optimized for Home Assistant. This includes MQTT, hardware acceleration, recording, snapshots, and motion masking. ```yaml mqtt: host: core-mosquitto user: mqtt-user password: xxxxxxxxxx ffmpeg: hwaccel_args: preset-rpi-64-h264 detectors: coral: type: edgetpu device: usb record: enabled: True motion: days: 7 alerts: retain: days: 30 mode: motion detections: retain: days: 30 mode: motion snapshots: enabled: True retain: default: 30 cameras: name_of_your_camera: detect: width: 1280 height: 720 fps: 5 ffmpeg: inputs: - path: rtsp://10.0.10.10:554/rtsp roles: - detect motion: mask: timestamp: friendly_name: "Camera timestamp" enabled: true coordinates: "0.000,0.427,0.002,0.000,0.999,0.000,0.999,0.781,0.885,0.456,0.700,0.424,0.701,0.311,0.507,0.294,0.453,0.347,0.451,0.400" ``` -------------------------------- ### Make installation script executable Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/installation.md Grants execute permissions to the downloaded Hailo8L installation script. This is required before the script can be run. ```bash sudo chmod +x user_installation.sh ``` -------------------------------- ### Install sudo Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/guides/getting_started.md Installs the sudo package to manage user privileges. ```bash apt update && apt install -y sudo ``` -------------------------------- ### Run Hailo8L installation script Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/installation.md Executes the Hailo8L installation script to install the necessary components for the accelerator. This includes dependencies, the driver, firmware, and udev rules. ```bash ./user_installation.sh ``` -------------------------------- ### Setup Docker buildx for multi-architecture builds Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/development/contributing.md Configures a Docker buildx builder instance for multi-platform image creation. ```bash docker buildx stop builder && docker buildx rm builder # <---- if existing docker run --privileged --rm tonistiigi/binfmt --install all docker buildx create --name builder --driver docker-container --driver-opt network=host --use docker buildx inspect builder --bootstrap make push ``` -------------------------------- ### Configure Frigate for local testing Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/development/contributing.md Example configuration for testing with a local video file input. ```yaml mqtt: host: mqtt cameras: test: ffmpeg: inputs: - path: /media/frigate/car-stopping.mp4 input_args: -re -stream_loop -1 -fflags +genpts roles: - detect ``` -------------------------------- ### Web Interface Development Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/development/contributing.md Commands for installing dependencies, running the development server, and executing quality checks for the web UI. ```console cd web && npm install ``` ```console cd web && npm run dev ``` ```console npm run lint ``` ```console npm run test ``` -------------------------------- ### Frontend Development Server and Build Source: https://github.com/blakeblackshear/frigate/blob/dev/CLAUDE.md Commands for starting the frontend development server and building the application for production. The dev server should not be run directly unless instructed. ```bash # Start dev server (AI agents should never run this directly unless asked) npm run dev ``` ```bash # Build for production npm run build ``` -------------------------------- ### Install super-gradients and jedi Source: https://github.com/blakeblackshear/frigate/blob/dev/notebooks/YOLO_NAS_Pretrained_Export.ipynb Installs the necessary libraries for using super-gradients and its dependencies. Ensure you are using a compatible Python version (e.g., 3.11). ```shell ! pip install -q "jedi>=0.16" ! pip install -q git+https://github.com/Deci-AI/super-gradients.git ``` -------------------------------- ### Example Docker Compose File for Frigate Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/installation.md A comprehensive Docker Compose configuration for running Frigate. This example includes device mappings for various accelerators (Coral, AMD/Intel GPUs), volume mounts for configuration and storage, and port mappings for access. ```yaml services: frigate: container_name: frigate privileged: true # this may not be necessary for all setups restart: unless-stopped stop_grace_period: 30s # allow enough time to shut down the various services image: ghcr.io/blakeblackshear/frigate:stable shm_size: "512mb" # update for your cameras based on calculation above devices: - /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions - /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://github.com/jnicolson/gasket-builder - /dev/video11:/dev/video11 # For Raspberry Pi 4B - /dev/dri/renderD128:/dev/dri/renderD128 # AMD / Intel GPU, needs to be updated for your hardware - /dev/kfd:/dev/kfd # AMD Kernel Fusion Driver for ROCm - /dev/accel:/dev/accel # AMD / Intel NPU volumes: - /etc/localtime:/etc/localtime:ro - /path/to/your/config:/config - /path/to/your/storage:/media/frigate - type: tmpfs # 1GB In-memory filesystem for recording segment storage target: /tmp/cache tmpfs: size: 1000000000 ports: - "8971:8971" # - "5000:5000" # Internal unauthenticated access. Expose carefully. - "8554:8554" # RTSP feeds - "8555:8555/tcp" # WebRTC over tcp - "8555:8555/udp" # WebRTC over udp environment: FRIGATE_RTSP_PASSWORD: "password" ``` -------------------------------- ### Documentation Development Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/development/contributing.md Commands to manage the documentation lifecycle, including installation, local preview, and production builds. ```shell cd docs && npm install ``` ```shell npm run start ``` ```shell npm run build ``` -------------------------------- ### RKNN Model Conversion Configuration Example Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/object_detectors.md Example configuration file for converting ONNX models to RKNN format using rknn-toolkit2. Adjust parameters based on your specific model and target SoCs. ```yaml soc: ["rk3562", "rk3566", "rk3568", "rk3576", "rk3588"] quantization: false output_name: "{input_basename}" config: mean_values: [[0, 0, 0]] std_values: [[255, 255, 255]] quant_img_RGB2BGR: true ``` -------------------------------- ### Run Development Frontend Server Source: https://github.com/blakeblackshear/frigate/blob/dev/web/README.md Execute this command to start the development server for the Frigate frontend. Optionally, set the PROXY_HOST environment variable to point to your Frigate backend instance. ```bash PROXY_HOST= npm run dev ``` -------------------------------- ### Start Frigate Container Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/updating.md Command to start the Frigate container after an update using Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Minimal Frigate Configuration Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/config.md A basic YAML configuration to start with. This includes MQTT settings and a dummy camera configuration. Remember to replace 'dummy_camera' and its settings with your actual camera details. ```yaml mqtt: enabled: False cameras: dummy_camera: # <--- this will be changed to your actual camera later enabled: False ffmpeg: inputs: - path: rtsp://127.0.0.1:554/rtsp roles: - detect ``` -------------------------------- ### Configure Caddy for Frigate Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/guides/reverse_proxy.md Set up Caddy to proxy requests for `frigate.YOUR_DOMAIN.TLD` to the local Frigate instance. This example includes importing logging and TLS configurations. ```caddy (logging) { log { output file /var/log/caddy/{args[0]}.log { roll_size 10MiB roll_keep 5 roll_keep_for 10d } format json level INFO } } (tls) { tls /var/lib/caddy/wildcard.YOUR_DOMAIN.TLD.fullchain.pem /var/lib/caddy/wildcard.YOUR_DOMAIN.TLD.privkey.pem } frigate.YOUR_DOMAIN.TLD { reverse_proxy http://localhost:8971 import tls import logging frigate.YOUR_DOMAIN.TLD } ``` -------------------------------- ### Custom Role Configuration in YAML Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/authentication.md Example configuration for defining custom roles and assigning camera access permissions. ```yaml cameras: front_door: # ... camera config side_yard: # ... camera config garage: # ... camera config auth: enabled: true roles: operator: # Custom role - front_door - garage # Operator can access front and garage neighbor: - side_yard ``` -------------------------------- ### TensorRT Detector Configuration Example Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/object_detectors.md Example configuration for the TensorRT detector, specifying the model type and device. The 'device' parameter selects the GPU index if multiple GPUs are passed to the container. ```yaml detector: model: tensorrt device: 0 ``` -------------------------------- ### Add Additional Cameras Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/cameras.md Illustrates how to add more cameras to the configuration by defining them under the main 'cameras' section. This allows for multiple camera setups. ```yaml mqtt: ... cameras: back: ... front: ... side: ... ``` -------------------------------- ### Install Frigate on Linux/QNAP with Docker Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/installation.md Use this command to run the Frigate Docker container on Linux or QNAP systems. Ensure volumes and ports are correctly mapped for your environment. ```bash docker run \ --name=frigate \ --shm-size=256m \ --restart=unless-stopped \ --env=TZ=America/New_York \ --volume=/share/Container/frigate/config:/config:rw \ --volume=/share/share_vol2/frigate/media:/media/frigate:rw \ --network=bridge \ --privileged \ --workdir=/opt/frigate \ -p 8971:8971 \ -p 8554:8554 \ -p 8555:8555 \ -p 8555:8555/udp \ --label='com.qnap.qcs.network.mode=nat' \ --label='com.qnap.qcs.gpu=False' \ --memory="4g" \ --cpus="2" \ --detach=true \ -t \ ghcr.io/blakeblackshear/frigate:stable ``` -------------------------------- ### Configure Annke C800 Camera Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/camera_specific.md Full configuration example for the H.265-only Annke C800, including Apple compatibility settings. ```yaml cameras: annkec800: # <------ Name the camera ffmpeg: # highlight-next-line apple_compatibility: true # <- Adds compatibility with MacOS and iPhone output_args: record: preset-record-generic-audio-aac inputs: - path: rtsp://USERNAME:PASSWORD@CAMERA-IP/H264/ch1/main/av_stream # <----- Update for your camera roles: - detect - record detect: width: # <- optional, by default Frigate tries to automatically detect resolution height: # <- optional, by default Frigate tries to automatically detect resolution ``` -------------------------------- ### Example Search Query with Filters Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/usage/explore.md Demonstrates a combined natural-language and structured filter query. Use this to narrow down search results by camera, object label, date, and time. ```text cameras:front_door label:person before:01012024 time_range:3:00PM-4:00PM ``` -------------------------------- ### RTSP URL Template Example (Different Port) Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/integrations/home-assistant.md Use this template to specify a different port for the RTSP stream when Frigate is behind a reverse proxy or has non-default port access. ```text rtsp://:2000/front_door ``` -------------------------------- ### GET /api/profile Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/authentication.md Example of an authorized request using the Bearer token. ```APIDOC ## GET /api/profile ### Description Retrieves the user profile using the Bearer token in the Authorization header. ### Method GET ### Endpoint /api/profile ### Parameters #### Headers - **Authorization** (string) - Required - Bearer ### Request Example curl -H "Authorization: Bearer " https://frigate_ip:8971/api/profile ``` -------------------------------- ### Run script help Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/scripts/README.md Execute the script with the --help flag to see available options and usage instructions. Ensure you are in the repository root. ```bash python3 docs/scripts/generate_ui_tabs.py --help ``` -------------------------------- ### AXERA Accelerator Docker Setup Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/installation.md Add these lines to your docker-compose.yml to grant Docker access to AXERA hardware. Ensure the AXCL driver is installed first. ```yaml devices: - /dev/axcl_host - /dev/ax_mmb_dev - /dev/msg_userdev volumes: - /usr/bin/axcl:/usr/bin/axcl - /usr/lib/axcl:/usr/lib/axcl ``` -------------------------------- ### Typical workflow: Preview and inject UI tabs Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/scripts/README.md A common workflow step: preview UI tab generation into a temporary directory, then compare with originals using diff, and finally inject the UI tabs into the actual documentation files. ```bash python3 docs/scripts/generate_ui_tabs.py --inject --outdir /tmp/ui-preview docs/docs/configuration/ ``` ```bash diff -ru docs/docs/configuration/ /tmp/ui-preview/ ``` ```bash python3 docs/scripts/generate_ui_tabs.py --inject docs/docs/configuration/ ``` -------------------------------- ### Board Make File Example Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/development/contributing-boards.md Defines Make targets for building, versioning, and pushing Docker images for community-supported boards. Replace `board` with the specific board suffix and `bake-target` with the target in your `board.hcl` file. ```Makefile BOARDS += board local-rpi: version docker buildx bake --load --file=docker/board/board.hcl --set board.tags=frigate:latest-board bake-target # Replace `board` with the board suffix ex: rpi. Bake target is the target in the board.hcl file ex: board build-rpi: version docker buildx bake --file=docker/board/board.hcl --set board.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-board bake-target # Replace `board` with the board suffix ex: rpi. Bake target is the target in the board.hcl file ex: board push-rpi: build-rpi docker buildx bake --push --file=docker/board/board.hcl --set board.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-board bake-target # Replace `board` with the board suffix ex: rpi. Bake target is the target in the board.hcl file ex: board ``` -------------------------------- ### Install unattended upgrades Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/guides/getting_started.md Installs and configures unattended-upgrades to automatically apply security updates to the system. ```bash sudo apt install -y unattended-upgrades echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | sudo debconf-set-selections sudo dpkg-reconfigure -f noninteractive unattended-upgrades ``` -------------------------------- ### Verify Hailo firmware installation Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/installation.md Checks if the Hailo firmware binary has been correctly installed in the system's firmware directory. This is essential for the proper functioning of the Hailo accelerator. ```bash ls -l /lib/firmware/hailo/hailo8_fw.bin ``` -------------------------------- ### Python unittest TestCase Example Source: https://github.com/blakeblackshear/frigate/blob/dev/AGENTS.md Example of a Python unittest TestCase class for backend testing. Use TestCase classes with descriptive test method names to structure your tests. ```python class TestMotionDetection(unittest.TestCase): def test_detects_motion_above_threshold(self): # Test implementation ``` -------------------------------- ### Build Frontend and Run All E2E Tests Source: https://github.com/blakeblackshear/frigate/blob/dev/AGENTS.md Command to build the frontend application and then execute all end-to-end tests. This is typically used for comprehensive testing before deployment. ```bash npm run e2e:build && npm run e2e ``` -------------------------------- ### Secondary LPR Pipeline Configuration Example Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/license_plate_recognition.md Example configuration for using Frigate's built-in secondary LPR pipeline without a Frigate+ model. This bypasses the standard object detection and uses a local license plate detector. ```yaml cameras: dedicated_lpr_camera: type: "lpr" ffmpeg: ... detect: enabled: True fps: 5 width: 1920 height: 1080 objects: track: - license_plate filters: license_plate: threshold: 0.7 motion: threshold: 30 contour_area: 60 improve_contrast: false mask: 0.704,0.007,0.709,0.052,0.989,0.055,0.993,0.001 record: enabled: True snapshots: enabled: True review: detections: labels: - license_plate ``` -------------------------------- ### Install Frigate on QNAP NAS via Docker CLI Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/installation.md This snippet shows the commands to pull the Frigate Docker image, create necessary directories for configuration and media storage, and run the Frigate container with specified shared memory size and time zone. ```shell # Download Frigate image docker pull ghcr.io/blakeblackshear/frigate:stable # Create directory to host Frigate config file on QNAP file system. # E.g., you can choose to create it under /share/Container. mkdir -p /share/Container/frigate/config # Copy the config file prepared in step 2 into the newly created config directory. cp path/to/your/config/file /share/Container/frigate/config # Create directory to host Frigate media files on QNAP file system. # (if you have a surveillance disk, create media directory on the surveillance disk. # Example command assumes share_vol2 is the surveillance drive mkdir -p /share/share_vol2/frigate/media # Create Frigate docker container. Replace shm-size value with the value from preparation step 3. # Also replace the time zone value for 'TZ' in the sample command. # Example command will create a docker container that uses at most 2 CPUs and 4G RAM. # You may need to add "--env=LIBVA_DRIVER_NAME=i965 " to the following docker run command if you ``` -------------------------------- ### Verify Frigate Logs Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/updating.md Command to check the container logs to ensure the service started correctly. ```bash docker logs frigate ``` -------------------------------- ### Build Frontend for Production Source: https://github.com/blakeblackshear/frigate/blob/dev/AGENTS.md Command to build the frontend application for production deployment. This optimizes assets for performance. ```bash npm run build ``` -------------------------------- ### CI/CD Workflow for Board Builds Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/development/contributing-boards.md An example GitHub Actions workflow snippet for building and pushing Docker images for community-supported boards. Ensure `targets`, `files`, and `set` parameters are updated for the specific board. ```yml - name: Build and push board build uses: docker/bake-action@v3 with: push: true targets: board # this is the target in the board.hcl file files: docker/board/board.hcl # this should be updated with the actual board type # the tags should be updated with the actual board types as well # the community board builds should never push to cache, but it can pull from cache set: | board.tags=ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-board *.cache-from=type=gha ``` -------------------------------- ### Preview UI tab generation for a single file Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/scripts/README.md Use the preview mode to see what UI tabs would be generated for a specific configuration documentation file without modifying it. ```bash python3 docs/scripts/generate_ui_tabs.py docs/docs/configuration/record.md ``` -------------------------------- ### Typical workflow: Check for drift and regenerate UI tabs Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/scripts/README.md Later steps in a typical workflow: check for drift after schema or i18n changes, preview regeneration into a temporary directory, compare with originals, and then apply the regeneration. ```bash python3 docs/scripts/generate_ui_tabs.py --check docs/docs/configuration/ ``` ```bash python3 docs/scripts/generate_ui_tabs.py --regenerate --outdir /tmp/ui-regen docs/docs/configuration/ ``` ```bash diff -ru docs/docs/configuration/ /tmp/ui-regen/ ``` ```bash python3 docs/scripts/generate_ui_tabs.py --regenerate docs/docs/configuration/ ``` -------------------------------- ### Apply FFmpeg Presets for Different Stream Types Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/ffmpeg_presets.md This example demonstrates how to use FFmpeg input presets to configure different stream types for a camera. The `preset-http-reolink` is used for an HTTP stream, while `preset-rtsp-generic` is used for an RTSP stream, showcasing how to handle mixed protocols. ```yaml go2rtc: streams: reolink_cam: http://192.168.0.139/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=password cameras: reolink_cam: ffmpeg: inputs: - path: http://192.168.0.139/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=password input_args: preset-http-reolink roles: - detect - path: rtsp://127.0.0.1:8554/reolink_cam input_args: preset-rtsp-generic roles: - record ``` -------------------------------- ### Preview UI tab generation for all config docs Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/scripts/README.md Generate a preview of UI tabs for all configuration documentation files in a directory. This mode does not alter any files. ```bash python3 docs/scripts/generate_ui_tabs.py docs/docs/configuration/ ``` -------------------------------- ### Environment Variable Substitution for Go2RTC RTSP Credentials Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/config.md Example of using environment variables for Go2RTC RTSP username and password. ```yaml go2rtc: rtsp: username: "{FRIGATE_GO2RTC_RTSP_USERNAME}" password: "{FRIGATE_GO2RTC_RTSP_PASSWORD}" ``` -------------------------------- ### Configure Camera Inputs and Detection Settings Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/cameras.md Define multiple input streams for a camera with specific roles and set detection dimensions. This example shows how to configure RTSP streams for detection and recording. ```yaml mqtt: host: mqtt.server.com cameras: back: enabled: True ffmpeg: inputs: - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2 roles: - detect - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/live roles: - record detect: width: 1280 # <- optional, by default Frigate tries to automatically detect resolution height: 720 # <- optional, by default Frigate tries to automatically detect resolution ``` -------------------------------- ### Get Notifications State MQTT Topic Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/integrations/mqtt.md Topic that publishes the current state of notifications. Published values are 'ON' or 'OFF'. ```text frigate/notifications/state ``` -------------------------------- ### Generate Step-by-Step Instructions from YAML Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/scripts/README.md Used when YAML blocks contain concrete values without comments to define configuration steps. ```markdown Navigate to . - Set **Enable recording** to on - Set **Continuous retention > Retention days** to `3` - Set **Alert retention > Event retention > Retention days** to `30` - Set **Alert retention > Event retention > Retention mode** to `all` ``` -------------------------------- ### Frigate Docker Compose Configuration Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/guides/getting_started.md This is a starter docker-compose.yml file for amd64 devices. Customize it for your specific setup, especially volumes and ports. ```yaml services: frigate: container_name: frigate restart: unless-stopped stop_grace_period: 30s image: ghcr.io/blakeblackshear/frigate:stable volumes: - ./config:/config - ./storage:/media/frigate - type: tmpfs # 1GB In-memory filesystem for recording segment storage target: /tmp/cache tmpfs: size: 1000000000 ports: - "8971:8971" - "8554:8554" # RTSP feeds ``` -------------------------------- ### Create Frigate Directories Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/guides/getting_started.md Use this command to create the minimal directory structure required for Frigate. ```bash mkdir storage config && touch docker-compose.yml ``` -------------------------------- ### OpenAI Configuration Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/genai/config.md Configure Frigate to use OpenAI. Requires an API key and billing setup. Ensure you select a vision-capable model. ```yaml genai: provider: openai api_key: "{FRIGATE_OPENAI_API_KEY}" model: gpt-4o ``` -------------------------------- ### Camera Stream Restream with go2rtc Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/restream.md Configure a camera stream using the exec source with rpicam-vid. This example captures video output to be restreamed. ```yaml go2rtc: streams: stream2: exec:rpicam-vid -t 0 --libav-format h264 -o - ``` -------------------------------- ### Serve Frigate via Tailscale with Custom Path Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/advanced/system.md Example of using Tailscale to serve Frigate, forwarding requests from a custom path to the Frigate instance. This demonstrates using the FRIGATE_BASE_PATH environment variable in conjunction with Tailscale. ```bash tailscale serve --https=443 --bg --set-path /frigate http://localhost:5000/frigate ``` -------------------------------- ### Build Local Docker Image Source: https://github.com/blakeblackshear/frigate/blob/dev/AGENTS.md Command to build a local Docker image for Frigate. AI agents should only run this when instructed. ```bash make local ``` -------------------------------- ### Object Count Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/integrations/mqtt.md Publishes the count of objects detected for a specific camera or zone. The `all` keyword can be used to get the total count of all object types. ```APIDOC ## `frigate//` Publishes the count of objects for the camera for use as a sensor in Home Assistant. `all` can be used as the object_name for the count of all objects for the camera. ## `frigate//` Publishes the count of objects for the zone for use as a sensor in Home Assistant. `all` can be used as the object_name for the count of all objects for the zone. ``` -------------------------------- ### Get Profile State MQTT Topic Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/integrations/mqtt.md Topic that publishes the currently active profile name. Retained value is the profile name or 'none'. ```text frigate/profile/state ``` -------------------------------- ### Docker Compose Configuration for AMD/ROCm GPU Access Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/object_detectors.md Configure device access for AMD GPUs within your Docker Compose setup for Frigate. ```yaml services: frigate: ... devices: - /dev/dri - /dev/kfd ``` -------------------------------- ### Verify Hailo driver version Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/frigate/installation.md Displays the version of the loaded Hailo PCI driver. This is useful for troubleshooting and ensuring the correct driver version is installed. ```bash cat /sys/module/hailo_pci/version ``` -------------------------------- ### Configure Intel QuickSync for H.265 Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/hardware_acceleration_video.md Set this argument to use Intel QuickSync specifically for H.265 video streams. This is configured in the global FFmpeg settings. ```yaml ffmpeg: hwaccel_args: preset-intel-qsv-h265 ``` -------------------------------- ### Perform Database Queries with Peewee ORM Source: https://github.com/blakeblackshear/frigate/blob/dev/AGENTS.md Utilize the Peewee ORM for database access, filtering events by camera name and ordering by start time. ```python from frigate.models import Event # Use Peewee ORM for database access events = ( Event.select() .where(Event.camera == camera_name) .order_by(Event.start_time.desc()) .limit(limit) ) ``` -------------------------------- ### Configure Hardware Acceleration (YAML) Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/hardware_acceleration_video.md Set the `hwaccel_args` to `preset-nvidia` in your `config.yaml` file to enable NVIDIA hardware acceleration for FFmpeg. ```yaml ffmpeg: hwaccel_args: preset-nvidia ``` -------------------------------- ### DeGirum Model Configuration for Local Inference Source: https://github.com/blakeblackshear/frigate/blob/dev/docs/docs/configuration/object_detectors.md Configure the DeGirum detector in config.yml for local inference. Ensure the Frigate docker container has the necessary runtime installed. ```yaml model: path: mobilenet_v2_ssd_coco--300x300_quant_n2x_orca1_1 width: 300 # width is in the model name as the first number in the "int"x"int" section height: 300 # height is in the model name as the second number in the "int"x"int" section input_pixel_format: rgb/bgr # look at the model.json to figure out which to put here ```