id: contributing
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:
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.
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.
For x86 machines, use make amd64_frigate
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
- rtmp
detect:
height: 1080
width: 1920
fps: 5
These input args tell ffmpeg to read the mp4 file in an infinite loop. You can use any valid ffmpeg input here.
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.
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.
VSCode will start the docker compose file for you and open a terminal window connected to frigate-dev
.
python3 -m frigate
to start the backend.web
directory and run npm install && npm start
to start the frontend.After closing VSCode, you may still have containers running. To close everything down, just run docker-compose down -v
to cleanup all containers.
The Web UI requires an instance of Frigate to interact with for all of its data. You can either run an instance locally (recommended) or attach to a separate instance accessible on your network.
To run the local instance, follow the core development instructions.
If you won't be making any changes to the Frigate HTTP API, you can attach the web development server to any Frigate instance on your network. Skip this step and go to 3a.
cd web && npm install
cd web && npm run start
To run the development server against a non-local instance, you will need to provide an environment variable, SNOWPACK_PUBLIC_API_HOST
that tells the web application how to connect to the Frigate API:
cd web && SNOWPACK_PUBLIC_API_HOST=http://<ip-address-to-your-frigate-instance>:5000 npm run start
The Web UI is built using Snowpack, Preact, and Tailwind CSS.
Light guidelines and advice:
lint
passes. This command will ensure basic conformance to styles, applying as many automatic fixes as possible, including Prettier formatting.npm run lint
npm run test
npm install
npm run start
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
The docs are built using Docusaurus v2. Please refer to the Docusaurus docs for more information on how to modify Frigate's documentation.
npm run build
This command generates static content into the build
directory and can be served using any static contents hosting service.