Contributing To The Main Code Base
Getting the source
Core, Web, Docker, and Documentation
This repository holds the main Frigate application and all of its dependencies.
Fork blakeblackshear/frigate to your own GitHub profile, then clone the forked repo to your local machine.
From here, follow the guides for:
Frigate Home Assistant Addon
This repository holds the Home Assistant Addon, for use with Home Assistant OS and compatible installations. It is the piece that allows you to run Frigate from your Home Assistant Supervisor tab.
Fork blakeblackshear/frigate-hass-addons to your own Github profile, then clone the forked repo to your local machine.
Frigate Home Assistant Integration
This repository holds the custom integration that allows your Home Assistant installation to automatically create entities for your Frigate instance, whether you run that with the addon or in a separate Docker instance.
Fork blakeblackshear/frigate-hass-integration to your own GitHub profile, then clone the forked repo to your local machine.
Core
Prerequisites
- GNU make
- Docker
- An extra detector (Coral, OpenVINO, etc.) is optional but recommended to simulate real world performance.
A Coral device can only be used by a single process at a time, so an extra Coral device is recommended if using a coral for development purposes.
Setup
1. Open the repo with Visual Studio Code
Upon opening, you should be prompted to open the project in a remote container. This will build a container on top of the base Frigate container with all the development dependencies installed. This ensures everyone uses a consistent development environment without the need to install any dependencies on your host machine.
2. Modify your local config file for testing
Place the file at config/config.yml
in the root of the repo.
Here is an example, but modify for your needs:
mqtt:
host: mqtt
cameras:
test:
ffmpeg:
inputs:
- path: /media/frigate/car-stopping.mp4
input_args: -re -stream_loop -1 -fflags +genpts
roles:
- detect
These input args tell ffmpeg to read the mp4 file in an infinite loop. You can use any valid ffmpeg input here.
3. Gather some mp4 files for testing
Create and place these files in a debug
folder in the root of the repo. This is also where recordings will be created if you enable them in your test config. Update your config from step 2 above to point at the right file. You can check the docker-compose.yml
file in the repo to see how the volumes are mapped.
4. Run Frigate from the command line
VSCode will start the docker compose file for you and open a terminal window connected to frigate-dev
.
- Run
python3 -m frigate
to start the backend. - In a separate terminal window inside VS Code, change into the
web
directory and runnpm install && npm run dev
to start the frontend.
5. Teardown
After closing VSCode, you may still have containers running. To close everything down, just run docker-compose down -v
to cleanup all containers.