mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-30 20:06:51 +03:00
Compare commits
2
Commits
master
..
4e1a68cfee
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e1a68cfee | ||
|
|
8ea5eb6bd1 |
@@ -8,7 +8,6 @@ amdgpu
|
|||||||
analyzeduration
|
analyzeduration
|
||||||
Annke
|
Annke
|
||||||
apexcharts
|
apexcharts
|
||||||
Aqara
|
|
||||||
arange
|
arange
|
||||||
argmax
|
argmax
|
||||||
argmin
|
argmin
|
||||||
@@ -65,7 +64,6 @@ dsize
|
|||||||
dtype
|
dtype
|
||||||
ECONNRESET
|
ECONNRESET
|
||||||
edgetpu
|
edgetpu
|
||||||
Eufy
|
|
||||||
facenet
|
facenet
|
||||||
fastapi
|
fastapi
|
||||||
faststart
|
faststart
|
||||||
@@ -84,7 +82,6 @@ frontdoor
|
|||||||
fstype
|
fstype
|
||||||
fullchain
|
fullchain
|
||||||
fullscreen
|
fullscreen
|
||||||
gatekeep
|
|
||||||
genai
|
genai
|
||||||
generativeai
|
generativeai
|
||||||
genpts
|
genpts
|
||||||
|
|||||||
@@ -10,11 +10,8 @@ body:
|
|||||||
|
|
||||||
Before submitting, read the [beta documentation][docs].
|
Before submitting, read the [beta documentation][docs].
|
||||||
|
|
||||||
By posting here you agree to follow our [AI policy][ai-policy]. Posts that appear to be written by an AI on your behalf may be closed without a response.
|
|
||||||
|
|
||||||
[docs]: https://docs-dev.frigate.video/
|
[docs]: https://docs-dev.frigate.video/
|
||||||
[discussions]: https://github.com/blakeblackshear/frigate/discussions
|
[discussions]: https://github.com/blakeblackshear/frigate/discussions
|
||||||
[ai-policy]: https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ body:
|
|||||||
|
|
||||||
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
||||||
|
|
||||||
By posting here you agree to follow our [AI policy][ai-policy]. Posts that appear to be written by an AI on your behalf may be closed without a response.
|
|
||||||
|
|
||||||
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
||||||
[docs]: https://docs.frigate.video
|
[docs]: https://docs.frigate.video
|
||||||
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
||||||
[ai-policy]: https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ body:
|
|||||||
|
|
||||||
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
||||||
|
|
||||||
By posting here you agree to follow our [AI policy][ai-policy]. Posts that appear to be written by an AI on your behalf may be closed without a response.
|
|
||||||
|
|
||||||
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
||||||
[docs]: https://docs.frigate.video
|
[docs]: https://docs.frigate.video
|
||||||
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
||||||
[ai-policy]: https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ body:
|
|||||||
|
|
||||||
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
||||||
|
|
||||||
By posting here you agree to follow our [AI policy][ai-policy]. Posts that appear to be written by an AI on your behalf may be closed without a response.
|
|
||||||
|
|
||||||
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
||||||
[docs]: https://docs.frigate.video
|
[docs]: https://docs.frigate.video
|
||||||
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
||||||
[ai-policy]: https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ body:
|
|||||||
|
|
||||||
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
||||||
|
|
||||||
By posting here you agree to follow our [AI policy][ai-policy]. Posts that appear to be written by an AI on your behalf may be closed without a response.
|
|
||||||
|
|
||||||
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
||||||
[docs]: https://docs.frigate.video
|
[docs]: https://docs.frigate.video
|
||||||
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
||||||
[ai-policy]: https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ body:
|
|||||||
|
|
||||||
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
Before submitting your support request, please [search the discussions][discussions], read the [official Frigate documentation][docs], and read the [Frigate FAQ][faq] pinned at the Discussion page to see if your question has already been answered by the community.
|
||||||
|
|
||||||
By posting here you agree to follow our [AI policy][ai-policy]. Posts that appear to be written by an AI on your behalf may be closed without a response.
|
|
||||||
|
|
||||||
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
||||||
[docs]: https://docs.frigate.video
|
[docs]: https://docs.frigate.video
|
||||||
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
||||||
[ai-policy]: https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -10,12 +10,9 @@ body:
|
|||||||
|
|
||||||
**If you are looking for support, start a new discussion and use a support category.**
|
**If you are looking for support, start a new discussion and use a support category.**
|
||||||
|
|
||||||
By posting here you agree to follow our [AI policy][ai-policy]. Posts that appear to be written by an AI on your behalf may be closed without a response.
|
|
||||||
|
|
||||||
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
||||||
[docs]: https://docs.frigate.video
|
[docs]: https://docs.frigate.video
|
||||||
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
||||||
[ai-policy]: https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -12,14 +12,11 @@ body:
|
|||||||
|
|
||||||
**If you are unsure if your issue is actually a bug or not, please submit a support request first.**
|
**If you are unsure if your issue is actually a bug or not, please submit a support request first.**
|
||||||
|
|
||||||
By posting here you agree to follow our [AI policy][ai-policy]. Posts that appear to be written by an AI on your behalf may be closed without a response.
|
|
||||||
|
|
||||||
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
[discussions]: https://www.github.com/blakeblackshear/frigate/discussions
|
||||||
[prs]: https://www.github.com/blakeblackshear/frigate/pulls
|
[prs]: https://www.github.com/blakeblackshear/frigate/pulls
|
||||||
[docs]: https://docs.frigate.video
|
[docs]: https://docs.frigate.video
|
||||||
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
[faq]: https://github.com/blakeblackshear/frigate/discussions/12724
|
||||||
[ai]: https://docs.frigate.video
|
[ai]: https://docs.frigate.video
|
||||||
[ai-policy]: https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md
|
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
attributes:
|
attributes:
|
||||||
label: Checklist
|
label: Checklist
|
||||||
|
|||||||
@@ -7,13 +7,6 @@ assignees: ''
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
|
||||||
By posting here you agree to follow our AI policy:
|
|
||||||
https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md
|
|
||||||
|
|
||||||
Requests that appear to be written by an AI on your behalf may be closed without a response.
|
|
||||||
-->
|
|
||||||
|
|
||||||
**Describe what you are trying to accomplish and why in non technical terms**
|
**Describe what you are trying to accomplish and why in non technical terms**
|
||||||
I want to be able to ... so that I can ...
|
I want to be able to ... so that I can ...
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
_Please read the [contributing guidelines](https://github.com/blakeblackshear/frigate/blob/dev/CONTRIBUTING.md) and the [AI policy](https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md) before submitting a PR. Every PR must be read and submitted by a person, and PRs that appear to be unreviewed AI output will be closed without review._
|
_Please read the [contributing guidelines](https://github.com/blakeblackshear/frigate/blob/dev/CONTRIBUTING.md) before submitting a PR._
|
||||||
|
|
||||||
## Proposed change
|
## Proposed change
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ config/*
|
|||||||
models
|
models
|
||||||
*.mp4
|
*.mp4
|
||||||
*.db
|
*.db
|
||||||
*.db-*
|
|
||||||
*.csv
|
*.csv
|
||||||
frigate/version.py
|
frigate/version.py
|
||||||
web/build
|
web/build
|
||||||
|
|||||||
-126
@@ -1,126 +0,0 @@
|
|||||||
# Frigate AI Policy
|
|
||||||
|
|
||||||
## TL;DR
|
|
||||||
|
|
||||||
- **Use AI tools if they help you.** We do too. This is about what you post, not which tools you use to write it.
|
|
||||||
- **A person has to read it and send it.** Don't wire a bot or an agent up to post on your behalf.
|
|
||||||
- **Write your posts yourself.** Your own words, the template filled in, and you answering maintainers rather than your assistant.
|
|
||||||
- **Don't paste an AI's guess at the cause as though it were a diagnosis.** Tell us what you actually observed.
|
|
||||||
- **Read your code before you submit it.** Disclose that AI was used, and be ready to explain every line.
|
|
||||||
- **If we misjudge something you wrote, just say so.** We'll take you at your word.
|
|
||||||
|
|
||||||
The rest of this document explains each of these, and why.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
AI tools are a reality of modern development and we're not opposed to their use. You are responsible for anything you submit, however it was produced, and we are responsible for anything we merge and release. We hold a high bar for both.
|
|
||||||
|
|
||||||
This policy applies everywhere this project is discussed: issues, discussions, pull requests, code reviews, and commit comments.
|
|
||||||
|
|
||||||
## Why this exists
|
|
||||||
|
|
||||||
Frigate is built and supported by a small group of maintainers and a community of volunteers who read every post and review every pull request. Nobody here is paid to do it, and time spent reading a post is time not spent fixing bugs or building features.
|
|
||||||
|
|
||||||
We're not opposed to AI tools. We use them too. But content generated by an AI and submitted without review costs a real person real time, and usually gives them less to work with than a few honest sentences would have. That is the problem this policy addresses.
|
|
||||||
|
|
||||||
## A person has to be in the loop
|
|
||||||
|
|
||||||
Every issue, discussion, comment, and pull request here must be read and submitted by a person. Using an AI tool to help you write is fine. Wiring one up to post on your behalf is not.
|
|
||||||
|
|
||||||
Specifically, do not:
|
|
||||||
|
|
||||||
- Connect a bot or agent to GitHub that opens issues, discussions, or pull requests without you reading them first
|
|
||||||
- Post output from a tool you have not read
|
|
||||||
- Use tooling to file bulk or drive-by contributions across the repository
|
|
||||||
|
|
||||||
We will close anything we believe was posted without a person reading it, and we may mark it as spam. Posts that skip the templates are the most common sign of this.
|
|
||||||
|
|
||||||
## Issues, discussions, and comments
|
|
||||||
|
|
||||||
We do not mind if you use AI tools to help you write. Do not have tools post unreviewed content on your behalf. We may hide any comment we believe to be unreviewed AI output.
|
|
||||||
|
|
||||||
Keep posts to what is needed to communicate your point. A long, confidently written, AI-padded post is harder to help with than a short direct one, not easier, and it is usually obvious.
|
|
||||||
|
|
||||||
**Describe your actual problem in your own words.** Tell us what you did, what you expected, and what actually happened. That is the information we need, and only you have it.
|
|
||||||
|
|
||||||
**Do not paste an AI's guess at the cause as though it were a diagnosis.** It is frequently wrong in ways that send everyone down the wrong path, and it buries the details that would have led to the real answer. We would rather see what you observed than what a model inferred.
|
|
||||||
|
|
||||||
**Fill in the template completely.** The templates ask for logs, config, version, and hardware because those are the things needed to help you. An AI cannot supply them for you, and a post missing them cannot be acted on.
|
|
||||||
|
|
||||||
**Answer maintainers yourself.** If we ask you a question, we are asking _you_, not your AI assistant. These are the spaces where we build trust and understanding with the community, and that only works if we're talking to each other. Using AI to fix your grammar or clarity is fine, but the substance has to be yours.
|
|
||||||
|
|
||||||
This applies to pull request descriptions and review replies as much as it does to bug reports and discussions.
|
|
||||||
|
|
||||||
### Quoting AI output
|
|
||||||
|
|
||||||
If you want to include something an AI told you, it must be:
|
|
||||||
|
|
||||||
- In a quote block, using `>`
|
|
||||||
- Disclosed as AI output, saying which tool it came from
|
|
||||||
- Accompanied by your own comment explaining why you think it is relevant
|
|
||||||
|
|
||||||
Keep the excerpt short. Do not paste long transcripts.
|
|
||||||
|
|
||||||
### Non-native English speakers
|
|
||||||
|
|
||||||
AI is genuinely useful for participating in a project that operates in English, and we would rather hear from you through a translation tool than not hear from you at all. Using AI to improve the grammar or clarity of something you wrote yourself is fine.
|
|
||||||
|
|
||||||
If you are translating your posts, make sure the translation says what you meant. Including your original text in a `<details>` block helps us verify the translation if something reads oddly, and keeps the thread readable.
|
|
||||||
|
|
||||||
## Code contributions
|
|
||||||
|
|
||||||
We need to understand your relationship with the code you're submitting. The more AI was involved, the more important it is that you've genuinely reviewed, tested, and understood what it produced.
|
|
||||||
|
|
||||||
Because of the long-term maintenance burden every merged change creates, we require a human in the loop who understands the work the AI produced. Pull requests that appear to be unreviewed AI output will be closed without review.
|
|
||||||
|
|
||||||
### Requirements when AI is used
|
|
||||||
|
|
||||||
If AI is used to generate any portion of the code, contributors must adhere to the following requirements:
|
|
||||||
|
|
||||||
1. **Explicitly disclose the manner in which AI was employed.** The PR template asks for this. Be honest, this won't automatically disqualify your PR. We'd rather have an honest disclosure than find out later. Trust matters more than method.
|
|
||||||
2. **Perform a comprehensive manual review prior to submitting the pull request.** Don't submit code you haven't read carefully and tested locally.
|
|
||||||
3. **Be prepared to explain every line of code you submitted when asked about it by a maintainer.** If you can't explain why something works the way it does, you're not ready to submit it.
|
|
||||||
4. **Check for an existing pull request addressing the same change.** If one exists, comment there and work with its author instead of opening a duplicate.
|
|
||||||
5. **It is strictly prohibited to use AI to write your posts for you** (bug reports, feature requests, pull request descriptions, GitHub discussions, responding to humans, etc.). We need to hear from _you_, not your AI assistant. These are the spaces where we build trust and understanding with contributors, and that only works if we're talking to each other.
|
|
||||||
|
|
||||||
### Established contributors
|
|
||||||
|
|
||||||
Contributors with a long history of thoughtful, quality contributions to Frigate have earned trust through that track record. The level of scrutiny we apply to AI usage naturally reflects that trust. This isn't a formal exemption, it's just how trust works. If you've been around, we know how you think and how you work. If you're new, we're still getting to know you, and clear disclosure helps build that relationship.
|
|
||||||
|
|
||||||
### What this means in practice
|
|
||||||
|
|
||||||
We're not trying to gatekeep how you write code. Use whatever tools make you productive. But there's a difference between using AI as a tool to implement something you understand and handing a feature request to an AI and submitting whatever comes back. The former is fine. The latter creates maintenance risk for the project.
|
|
||||||
|
|
||||||
Some honest context: when we review a PR, we're not just evaluating whether the code works today. We're evaluating whether we can maintain it, debug it, and extend it long-term, often without the original author's involvement. Code that the author doesn't deeply understand is code that nobody understands, and that's a liability.
|
|
||||||
|
|
||||||
One more thing worth saying directly: most maintainers already have access to the same AI tools you do. A PR that's entirely AI-generated, where the author can't explain the design, debug issues independently, or engage substantively in design discussions, doesn't offer something we couldn't produce ourselves. What makes a contribution genuinely valuable is the human judgment and domain understanding behind it, as well as the engagement during review that shapes it into something we can confidently take on long-term.
|
|
||||||
|
|
||||||
## Our use of AI
|
|
||||||
|
|
||||||
The Frigate documentation site has an "Ask AI" search that answers questions from the docs, and we may use AI tooling to help with triage and project management. Like any automated tooling, it is not always right.
|
|
||||||
|
|
||||||
If an AI tool leaves a comment on your contribution, treat it the way you would any other comment. If you think it is wrong, say so, and a brief explanation is enough. Maintainers always have the final say.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Contributions and posts that do not follow this policy will be closed. Depending on the situation, maintainers may also:
|
|
||||||
|
|
||||||
- Hide or delete comments that appear to be unreviewed AI output
|
|
||||||
- Mark automated content as spam
|
|
||||||
- Close an issue, discussion, or pull request without further review
|
|
||||||
- Lock a conversation
|
|
||||||
- Temporarily or permanently block an account from participating in the project
|
|
||||||
|
|
||||||
Repeated violations may result in being blocked from contributing to Frigate.
|
|
||||||
|
|
||||||
### When we get it wrong
|
|
||||||
|
|
||||||
There is no reliable way to detect this, and we're not going to pretend otherwise. Whether something reads as unreviewed AI output is a judgment call, usually made quickly, by a volunteer with limited time and no way to know for certain. These calls are subjective and we won't always get them right.
|
|
||||||
|
|
||||||
If it happens to you, just say so. A short reply telling us you wrote it yourself is enough, and we'll take you at your word and pick the conversation back up. We would much rather occasionally reopen something we misjudged than treat everyone who posts here as a suspect.
|
|
||||||
|
|
||||||
We'd ask for some understanding in return. These calls get made quickly because the volume is real, and time spent second-guessing them is time not spent helping the person in the next thread.
|
|
||||||
|
|
||||||
## Attribution
|
|
||||||
|
|
||||||
Portions of this policy are adapted from the [Open Home Foundation AI Policy](https://developers.home-assistant.io/docs/ai_policy/).
|
|
||||||
+19
-9
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
Thank you for your interest in contributing to Frigate. This document covers the expectations and guidelines for contributions. Please read it before submitting a pull request.
|
Thank you for your interest in contributing to Frigate. This document covers the expectations and guidelines for contributions. Please read it before submitting a pull request.
|
||||||
|
|
||||||
All participation in this project, including pull requests, issues, and discussions, is covered by our [AI policy](AI_POLICY.md).
|
|
||||||
|
|
||||||
## Before you start
|
## Before you start
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
@@ -23,16 +21,28 @@ Before writing code for a new feature:
|
|||||||
|
|
||||||
## AI usage policy
|
## AI usage policy
|
||||||
|
|
||||||
AI tools are a reality of modern development and we're not opposed to their use. But we need to understand your relationship with the code you're submitting, and we need to hear from you rather than from your AI assistant.
|
AI tools are a reality of modern development and we're not opposed to their use. But we need to understand your relationship with the code you're submitting. The more AI was involved, the more important it is that you've genuinely reviewed, tested, and understood what it produced.
|
||||||
|
|
||||||
**Read the [AI policy](AI_POLICY.md) before you open a pull request.** It is short, and it applies to everything you post here. The parts that most often catch people out:
|
### Requirements when AI is used
|
||||||
|
|
||||||
- A person has to be in the loop. Don't wire a bot or agent up to open pull requests, issues, or discussions on your behalf.
|
If AI is used to generate any portion of the code, contributors must adhere to the following requirements:
|
||||||
- Disclose how AI was used. The PR template asks for this. Be honest, it won't automatically disqualify your PR.
|
|
||||||
- Review and test everything you submit, and be prepared to explain every line when asked.
|
|
||||||
- Don't use AI to write your PR description or your replies to maintainers.
|
|
||||||
|
|
||||||
Pull requests that appear to be unreviewed AI output will be closed without review.
|
1. **Explicitly disclose the manner in which AI was employed.** The PR template asks for this. Be honest — this won't automatically disqualify your PR. We'd rather have an honest disclosure than find out later. Trust matters more than method.
|
||||||
|
2. **Perform a comprehensive manual review prior to submitting the pull request.** Don't submit code you haven't read carefully and tested locally.
|
||||||
|
3. **Be prepared to explain every line of code they submitted when asked about it by a maintainer.** If you can't explain why something works the way it does, you're not ready to submit it.
|
||||||
|
4. **It is strictly prohibited to use AI to write your posts for you** (bug reports, feature requests, pull request descriptions, GitHub discussions, responding to humans, etc.). We need to hear from _you_, not your AI assistant. These are the spaces where we build trust and understanding with contributors, and that only works if we're talking to each other.
|
||||||
|
|
||||||
|
### Established contributors
|
||||||
|
|
||||||
|
Contributors with a long history of thoughtful, quality contributions to Frigate have earned trust through that track record. The level of scrutiny we apply to AI usage naturally reflects that trust. This isn't a formal exemption — it's just how trust works. If you've been around, we know how you think and how you work. If you're new, we're still getting to know you, and clear disclosure helps build that relationship.
|
||||||
|
|
||||||
|
### What this means in practice
|
||||||
|
|
||||||
|
We're not trying to gatekeep how you write code. Use whatever tools make you productive. But there's a difference between using AI as a tool to implement something you understand and handing a feature request to an AI and submitting whatever comes back. The former is fine. The latter creates maintenance risk for the project.
|
||||||
|
|
||||||
|
Some honest context: when we review a PR, we're not just evaluating whether the code works today. We're evaluating whether we can maintain it, debug it, and extend it long-term — often without the original author's involvement. Code that the author doesn't deeply understand is code that nobody understands, and that's a liability.
|
||||||
|
|
||||||
|
One more thing worth saying directly: most maintainers already have access to the same AI tools you do. A PR that's entirely AI-generated — where the author can't explain the design, debug issues independently, or engage substantively in design discussions — doesn't offer something we couldn't produce ourselves. What makes a contribution genuinely valuable is the human judgment and domain understanding behind it, as well as the engagement during review that shapes it into something we can confidently take on long-term.
|
||||||
|
|
||||||
## Pull request guidelines
|
## Pull request guidelines
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
default_target: local
|
default_target: local
|
||||||
|
|
||||||
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
|
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
|
||||||
VERSION = 0.18.1
|
VERSION = 0.18.0
|
||||||
IMAGE_REPO ?= ghcr.io/blakeblackshear/frigate
|
IMAGE_REPO ?= ghcr.io/blakeblackshear/frigate
|
||||||
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
BOARDS= #Initialized empty
|
BOARDS= #Initialized empty
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ yell
|
|||||||
sigh
|
sigh
|
||||||
singing
|
singing
|
||||||
choir
|
choir
|
||||||
yodeling
|
sodeling
|
||||||
chant
|
chant
|
||||||
mantra
|
mantra
|
||||||
child_singing
|
child_singing
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ RUN --mount=type=bind,source=docker/main/install_tempio.sh,target=/deps/install_
|
|||||||
FROM base_host AS ov-converter
|
FROM base_host AS ov-converter
|
||||||
ARG DEBIAN_FRONTEND
|
ARG DEBIAN_FRONTEND
|
||||||
|
|
||||||
# Install OpenVINO for model conversion
|
# Install OpenVino Runtime and Dev library
|
||||||
COPY docker/main/requirements-ov.txt /requirements-ov.txt
|
COPY docker/main/requirements-ov.txt /requirements-ov.txt
|
||||||
RUN apt-get -qq update \
|
RUN apt-get -qq update \
|
||||||
&& apt-get -qq install -y wget python3 python3-distutils \
|
&& apt-get -qq install -y wget python3 python3-dev python3-distutils gcc pkg-config libhdf5-dev \
|
||||||
&& wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
|
&& wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
|
||||||
&& sed -i 's/args.append("setuptools")/args.append("setuptools==77.0.3")/' get-pip.py \
|
&& sed -i 's/args.append("setuptools")/args.append("setuptools==77.0.3")/' get-pip.py \
|
||||||
&& python3 get-pip.py "pip" \
|
&& python3 get-pip.py "pip" \
|
||||||
|
|||||||
@@ -1,106 +1,11 @@
|
|||||||
"""Convert the default SSDLite MobileNet v2 model to OpenVINO IR.
|
|
||||||
|
|
||||||
Replaces the legacy openvino-dev Model Optimizer conversion. The TensorFlow
|
|
||||||
frontend translates the Object Detection API pre and post processors literally,
|
|
||||||
producing per-class NonMaxSuppression, NonZero ops and map loops with data
|
|
||||||
dependent shapes that the GPU plugin handles very badly. Both are cut out the
|
|
||||||
way ssd_v2_support.json used to do it: the preprocessor is an identity at the
|
|
||||||
native 300x300 input, and the postprocessor becomes a single fused
|
|
||||||
DetectionOutput. The result is the [1, 1, 100, 7] tensor that Frigate's
|
|
||||||
OpenVINO detector expects, with the input flipped to BGR to match the legacy
|
|
||||||
reverse_input_channels behavior.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import numpy as np
|
|
||||||
import openvino as ov
|
import openvino as ov
|
||||||
from openvino import opset8 as ops
|
from openvino.tools import mo
|
||||||
from openvino.preprocess import PrePostProcessor
|
|
||||||
|
|
||||||
MODEL_DIR = "/models/ssdlite_mobilenet_v2_coco_2018_05_09"
|
ov_model = mo.convert_model(
|
||||||
OUTPUT_PATH = "/models/ssdlite_mobilenet_v2.xml"
|
"/models/ssdlite_mobilenet_v2_coco_2018_05_09/frozen_inference_graph.pb",
|
||||||
INPUT_SHAPE = [1, 300, 300, 3]
|
compress_to_fp16=True,
|
||||||
|
transformations_config="/usr/local/lib/python3.11/dist-packages/openvino/tools/mo/front/tf/ssd_v2_support.json",
|
||||||
# faster_rcnn_box_coder divides the deltas by pipeline.config's y/x/height/width
|
tensorflow_object_detection_api_pipeline_config="/models/ssdlite_mobilenet_v2_coco_2018_05_09/pipeline.config",
|
||||||
# scales of 10/10/5/5, which DetectionOutput expresses as per-prior variances.
|
reverse_input_channels=True,
|
||||||
BOX_VARIANCES = np.float32([0.1, 0.1, 0.2, 0.2])
|
|
||||||
|
|
||||||
model = ov.convert_model(
|
|
||||||
f"{MODEL_DIR}/frozen_inference_graph.pb",
|
|
||||||
input=[("image_tensor:0", INPUT_SHAPE)],
|
|
||||||
)
|
)
|
||||||
|
ov.save_model(ov_model, "/models/ssdlite_mobilenet_v2.xml")
|
||||||
nodes = {op.get_friendly_name(): op for op in model.get_ordered_ops()}
|
|
||||||
parameter = model.get_parameters()[0]
|
|
||||||
|
|
||||||
preprocessor = nodes["Preprocessor/map/TensorArrayStack/TensorArrayGatherV3"]
|
|
||||||
box_deltas = nodes["Postprocessor/Reshape_1"].output(0)
|
|
||||||
class_scores = nodes["Postprocessor/convert_scores"].output(0)
|
|
||||||
anchors_output = nodes["Postprocessor/Reshape"].output(0)
|
|
||||||
|
|
||||||
# The anchors only depend on the static input shape, so fold them into a
|
|
||||||
# constant and drop the generator subgraph with the rest of the postprocessor.
|
|
||||||
probe = ov.Core().compile_model(
|
|
||||||
ov.Model([anchors_output, preprocessor.output(0)], [parameter], "probe"), "CPU"
|
|
||||||
)
|
|
||||||
probe_input = np.random.default_rng(0).integers(0, 255, INPUT_SHAPE, dtype=np.uint8)
|
|
||||||
anchors, resized = (out.copy() for out in probe([probe_input]).values())
|
|
||||||
|
|
||||||
assert np.allclose(resized, probe_input, atol=1e-3), (
|
|
||||||
"preprocessor is not an identity at 300x300, it cannot be bypassed"
|
|
||||||
)
|
|
||||||
|
|
||||||
image = ops.convert(parameter, "f32")
|
|
||||||
|
|
||||||
for consumer in list(preprocessor.output(0).get_target_inputs()):
|
|
||||||
consumer.replace_source_output(image.output(0))
|
|
||||||
|
|
||||||
# (ymin, xmin, ymax, xmax) -> (xmin, ymin, xmax, ymax)
|
|
||||||
priors = anchors[:, [1, 0, 3, 2]].astype(np.float32).reshape(-1)
|
|
||||||
variances = np.tile(BOX_VARIANCES, len(anchors))
|
|
||||||
proposals = ops.constant(np.stack([priors, variances])[np.newaxis])
|
|
||||||
|
|
||||||
# (ty, tx, th, tw) -> (dx, dy, dw, dh) for the CENTER_SIZE decode
|
|
||||||
box_logits = ops.reshape(ops.gather(box_deltas, [1, 0, 3, 2], 1), [1, -1], False)
|
|
||||||
class_preds = ops.reshape(class_scores, [1, -1], False)
|
|
||||||
|
|
||||||
detections = ops.detection_output(
|
|
||||||
box_logits,
|
|
||||||
class_preds,
|
|
||||||
proposals,
|
|
||||||
{
|
|
||||||
"background_label_id": 0,
|
|
||||||
"top_k": 100,
|
|
||||||
"keep_top_k": [100],
|
|
||||||
"nms_threshold": 0.6,
|
|
||||||
"confidence_threshold": 0.3,
|
|
||||||
"code_type": "caffe.PriorBoxParameter.CENTER_SIZE",
|
|
||||||
"share_location": True,
|
|
||||||
"variance_encoded_in_target": False,
|
|
||||||
"normalized": True,
|
|
||||||
"clip_before_nms": False,
|
|
||||||
"clip_after_nms": True,
|
|
||||||
"decrease_label_id": False,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
detections.output(0).get_tensor().set_names({"detection_out"})
|
|
||||||
|
|
||||||
model = ov.Model([detections], [parameter], "ssdlite_mobilenet_v2")
|
|
||||||
|
|
||||||
ppp = PrePostProcessor(model)
|
|
||||||
ppp.input().tensor().set_layout(ov.Layout("NHWC"))
|
|
||||||
ppp.input().preprocess().reverse_channels()
|
|
||||||
model = ppp.build()
|
|
||||||
|
|
||||||
# Fail the build rather than silently ship the dynamically shaped graph again.
|
|
||||||
op_types = [op.get_type_name() for op in model.get_ordered_ops()]
|
|
||||||
assert op_types.count("DetectionOutput") == 1, "postprocessor was not fused"
|
|
||||||
|
|
||||||
for dynamic_op in ("NonMaxSuppression", "NonZero", "Loop", "TensorIterator"):
|
|
||||||
assert dynamic_op not in op_types, f"{dynamic_op} left in the graph"
|
|
||||||
|
|
||||||
output_shape = model.outputs[0].get_partial_shape()
|
|
||||||
assert output_shape.is_static and list(output_shape) == [1, 1, 100, 7], (
|
|
||||||
f"unexpected detector output shape {output_shape}"
|
|
||||||
)
|
|
||||||
|
|
||||||
ov.save_model(model, OUTPUT_PATH, compress_to_fp16=True)
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
SQLITE_VEC_VERSION="0.1.9"
|
SQLITE_VEC_VERSION="0.1.3"
|
||||||
|
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
numpy
|
numpy
|
||||||
openvino >= 2026.2.0
|
tensorflow
|
||||||
|
openvino-dev>=2024.0.0
|
||||||
@@ -79,5 +79,7 @@ sherpa-onnx==1.12.*
|
|||||||
faster-whisper==1.1.*
|
faster-whisper==1.1.*
|
||||||
librosa==0.11.*
|
librosa==0.11.*
|
||||||
soundfile==0.13.*
|
soundfile==0.13.*
|
||||||
|
# DeGirum detector
|
||||||
|
degirum == 0.16.*
|
||||||
# Memory profiling
|
# Memory profiling
|
||||||
memray == 1.15.*
|
memray == 1.15.*
|
||||||
|
|||||||
@@ -150,9 +150,7 @@ http {
|
|||||||
include auth_request.conf;
|
include auth_request.conf;
|
||||||
types {
|
types {
|
||||||
video/mp4 mp4;
|
video/mp4 mp4;
|
||||||
image/jpeg jpg jpeg;
|
image/jpeg jpg;
|
||||||
image/png png;
|
|
||||||
image/webp webp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
expires 7d;
|
expires 7d;
|
||||||
@@ -276,13 +274,6 @@ http {
|
|||||||
include proxy.conf;
|
include proxy.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /api/logout {
|
|
||||||
auth_request off;
|
|
||||||
rewrite ^/api(/.*)$ $1 break;
|
|
||||||
proxy_pass http://frigate_api;
|
|
||||||
include proxy.conf;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Allow unauthenticated access to the first_time_login endpoint
|
# Allow unauthenticated access to the first_time_login endpoint
|
||||||
# so the login page can load help text before authentication.
|
# so the login page can load help text before authentication.
|
||||||
location /api/auth/first_time_login {
|
location /api/auth/first_time_login {
|
||||||
|
|||||||
@@ -894,41 +894,6 @@ deepstack:
|
|||||||
api_url: http://<your_codeproject_ai_server_ip>:<port>/v1/vision/detection
|
api_url: http://<your_codeproject_ai_server_ip>:<port>/v1/vision/detection
|
||||||
type: deepstack
|
type: deepstack
|
||||||
api_timeout: 0.1 # seconds
|
api_timeout: 0.1 # seconds
|
||||||
xdna2:
|
|
||||||
title: AMD XDNA2
|
|
||||||
models:
|
|
||||||
- key: yolov9
|
|
||||||
label: YOLOv9
|
|
||||||
recommended: true
|
|
||||||
download: |-
|
|
||||||
Prepare the model using the frigate-xdna setup instructions linked above. For local YOLO models, Frigate must have access to the same ONNX file bytes as the sidecar. The example below uses YOLOv9-C at 320x320. Frigate+ models may instead use the same `plus://MODEL_ID` in Frigate and the sidecar.
|
|
||||||
ui: |-
|
|
||||||
Navigate to **Settings > System > Detectors and model** and select **ZMQ IPC** from the detector type dropdown and click **Add**, then set the endpoint to `tcp://xdna:5555`. Then on the same page, in the **Custom Model** tab, configure:
|
|
||||||
|
|
||||||
| Field | Value |
|
|
||||||
| ---------------------------------------- | ------------------------------------------ |
|
|
||||||
| **Custom object detector model path** | `/config/models/yolov9-c-320.onnx` |
|
|
||||||
| **Label map for custom object detector** | `/labelmap/coco-80.txt` |
|
|
||||||
| **Object detection model input width** | `320` |
|
|
||||||
| **Object detection model input height** | `320` |
|
|
||||||
| **Model Input Pixel Color Format** | `rgb` (Frigate's default value) |
|
|
||||||
| **Model Input Tensor Shape** | `nchw` |
|
|
||||||
| **Model Input D Type** | `float` |
|
|
||||||
| **Object Detection Model Type** | `yolo-generic` |
|
|
||||||
yaml: |-
|
|
||||||
detectors:
|
|
||||||
xdna:
|
|
||||||
type: zmq
|
|
||||||
endpoint: tcp://xdna:5555
|
|
||||||
|
|
||||||
model:
|
|
||||||
model_type: yolo-generic
|
|
||||||
width: 320
|
|
||||||
height: 320
|
|
||||||
input_tensor: nchw
|
|
||||||
input_dtype: float
|
|
||||||
path: /config/models/yolov9-c-320.onnx
|
|
||||||
labelmap_path: /labelmap/coco-80.txt
|
|
||||||
memryx:
|
memryx:
|
||||||
title: MemryX
|
title: MemryX
|
||||||
models:
|
models:
|
||||||
@@ -1135,7 +1100,7 @@ synaptics:
|
|||||||
- key: ssd
|
- key: ssd
|
||||||
label: SSD MobileNet
|
label: SSD MobileNet
|
||||||
recommended: true
|
recommended: true
|
||||||
download: A synap model is provided in the container at `/synaptics/mobilenet.synap` and is used by this detector type by default. The model comes from the [Synap-release Github](https://github.com/synaptics-astra/synap-release/tree/v1.5.0/models/dolphin/object_detection/coco/model/mobilenet224_full80).
|
download: A synap model is provided in the container at `/mobilenet.synap` and is used by this detector type by default. The model comes from the [Synap-release Github](https://github.com/synaptics-astra/synap-release/tree/v1.5.0/models/dolphin/object_detection/coco/model/mobilenet224_full80).
|
||||||
ui: |-
|
ui: |-
|
||||||
Navigate to **Settings > System > Detectors and model** and select **Synaptics** from the detector type dropdown and click **Add**. Then on the same page, in the **Custom Model** tab, configure:
|
Navigate to **Settings > System > Detectors and model** and select **Synaptics** from the detector type dropdown and click **Add**. Then on the same page, in the **Custom Model** tab, configure:
|
||||||
|
|
||||||
@@ -1304,3 +1269,78 @@ axengine:
|
|||||||
input_dtype: int
|
input_dtype: int
|
||||||
input_pixel_format: bgr
|
input_pixel_format: bgr
|
||||||
labelmap_path: /labelmap/coco-80.txt
|
labelmap_path: /labelmap/coco-80.txt
|
||||||
|
degirumAiServer:
|
||||||
|
title: DeGirum AI Server
|
||||||
|
models:
|
||||||
|
- key: ai-server-inference
|
||||||
|
label: AI Server Inference
|
||||||
|
recommended: true
|
||||||
|
download: |-
|
||||||
|
Launch a DeGirum AI server as a Docker container, then point the detector at it. Add this to your `docker-compose.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
degirum_detector:
|
||||||
|
container_name: degirum
|
||||||
|
image: degirum/aiserver:latest
|
||||||
|
privileged: true
|
||||||
|
ports:
|
||||||
|
- "8778:8778"
|
||||||
|
```
|
||||||
|
|
||||||
|
Set `location` to the server's service name, container name, or `host:port`.
|
||||||
|
ui: |
|
||||||
|
Navigate to **Settings > System > Detectors and model** and select **DeGirum** from the detector type dropdown and click **Add**.
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
| --- | --- |
|
||||||
|
| **Location** | `degirum` |
|
||||||
|
| **Zoo** | `degirum/public` |
|
||||||
|
| **Token** | your AI Hub token (optional for the public zoo) |
|
||||||
|
yaml: |
|
||||||
|
degirum_detector:
|
||||||
|
type: degirum
|
||||||
|
location: degirum
|
||||||
|
zoo: degirum/public
|
||||||
|
token: dg_example_token
|
||||||
|
degirumLocal:
|
||||||
|
title: DeGirum Local
|
||||||
|
models:
|
||||||
|
- key: local-inference
|
||||||
|
label: Local Inference
|
||||||
|
recommended: true
|
||||||
|
download: Run hardware directly inside the Frigate container with `@local`, removing the AI server hop. The matching device runtime (e.g. the Hailo runtime) must be installed in the container; confirm it with `degirum sys-info`.
|
||||||
|
ui: |
|
||||||
|
Navigate to **Settings > System > Detectors and model** and select **DeGirum** from the detector type dropdown and click **Add**.
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
| --- | --- |
|
||||||
|
| **Location** | `@local` |
|
||||||
|
| **Zoo** | `degirum/public` |
|
||||||
|
| **Token** | your AI Hub token (optional for the public zoo) |
|
||||||
|
yaml: |
|
||||||
|
degirum_detector:
|
||||||
|
type: degirum
|
||||||
|
location: @local
|
||||||
|
zoo: degirum/public
|
||||||
|
token: dg_example_token
|
||||||
|
degirumCloud:
|
||||||
|
title: DeGirum AI Hub Cloud
|
||||||
|
models:
|
||||||
|
- key: ai-hub-cloud-inference
|
||||||
|
label: AI Hub Cloud Inference
|
||||||
|
recommended: true
|
||||||
|
download: Run inferences on DeGirum's [AI Hub](https://hub.degirum.com) cloud with `@cloud`. Sign up, create an access token, and set it as `token`. Network latency may require lowering your detection fps.
|
||||||
|
ui: |
|
||||||
|
Navigate to **Settings > System > Detectors and model** and select **DeGirum** from the detector type dropdown and click **Add**.
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
| --- | --- |
|
||||||
|
| **Location** | `@cloud` |
|
||||||
|
| **Zoo** | `degirum/public` |
|
||||||
|
| **Token** | your AI Hub token (optional for the public zoo) |
|
||||||
|
yaml: |
|
||||||
|
degirum_detector:
|
||||||
|
type: degirum
|
||||||
|
location: @cloud
|
||||||
|
zoo: degirum/public
|
||||||
|
token: dg_example_token
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ It is not recommended to copy this full configuration file. Only specify values
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
Sections marked `# NOTE: Can be overridden at the camera level` can be set globally and then adjusted per camera. See [Global and Camera-Level Configuration](../config_overrides.md) for how that works.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
mqtt:
|
mqtt:
|
||||||
# Optional: Enable mqtt server (default: shown below)
|
# Optional: Enable mqtt server (default: shown below)
|
||||||
@@ -173,14 +171,13 @@ model:
|
|||||||
# Valid values are rgb, bgr, or yuv. (default: shown below)
|
# Valid values are rgb, bgr, or yuv. (default: shown below)
|
||||||
input_pixel_format: rgb
|
input_pixel_format: rgb
|
||||||
# Required: Object detection model input tensor format
|
# Required: Object detection model input tensor format
|
||||||
# Valid values are nhwc, nchw, hwnc, or hwcn (default: shown below)
|
# Valid values are nhwc or nchw (default: shown below)
|
||||||
input_tensor: nhwc
|
input_tensor: nhwc
|
||||||
# Optional: Data type of the model input tensor
|
# Optional: Data type of the model input tensor
|
||||||
# Valid values are float, float_denorm, or int (default: shown below)
|
# Valid values are float, float_denorm, or int (default: shown below)
|
||||||
input_dtype: int
|
input_dtype: int
|
||||||
# Required: Object detection model architecture, used by detectors that support more
|
# Required: Object detection model type, currently only used with the OpenVINO detector
|
||||||
# than one model type (openvino, onnx, rknn, memryx, axengine, synaptics, and others)
|
# Valid values are ssd, yolox, yolonas (default: shown below)
|
||||||
# Valid values are ssd, yolox, yolonas, yolo-generic, rfdetr, dfine (default: shown below)
|
|
||||||
model_type: ssd
|
model_type: ssd
|
||||||
# Required: Label name modifications. These are merged into the standard labelmap.
|
# Required: Label name modifications. These are merged into the standard labelmap.
|
||||||
labelmap:
|
labelmap:
|
||||||
@@ -286,7 +283,7 @@ ffmpeg:
|
|||||||
# Optional: output args for detect streams (default: shown below)
|
# Optional: output args for detect streams (default: shown below)
|
||||||
detect: -threads 2 -f rawvideo -pix_fmt yuv420p
|
detect: -threads 2 -f rawvideo -pix_fmt yuv420p
|
||||||
# Optional: output args for record streams (default: shown below)
|
# Optional: output args for record streams (default: shown below)
|
||||||
record: preset-record-generic-audio-aac
|
record: preset-record-generic
|
||||||
# Optional: Time in seconds to wait before ffmpeg retries connecting to the camera. (default: shown below)
|
# Optional: Time in seconds to wait before ffmpeg retries connecting to the camera. (default: shown below)
|
||||||
# If set too low, frigate will retry a connection to the camera's stream too frequently, using up the limited streams some cameras can allow at once
|
# If set too low, frigate will retry a connection to the camera's stream too frequently, using up the limited streams some cameras can allow at once
|
||||||
# If set too high, then if a ffmpeg crash or camera stream timeout occurs, you could potentially lose up to a maximum of retry_interval second(s) of footage
|
# If set too high, then if a ffmpeg crash or camera stream timeout occurs, you could potentially lose up to a maximum of retry_interval second(s) of footage
|
||||||
@@ -342,7 +339,7 @@ detect:
|
|||||||
# especially when using separate streams for detect and record.
|
# especially when using separate streams for detect and record.
|
||||||
# Use this setting to make the timeline bounding boxes more closely align
|
# Use this setting to make the timeline bounding boxes more closely align
|
||||||
# with the recording. The value can be positive or negative.
|
# with the recording. The value can be positive or negative.
|
||||||
# TIP: Imagine there is a tracked object clip with a person walking from left to right.
|
# TIP: Imagine there is an tracked object clip with a person walking from left to right.
|
||||||
# If the tracked object lifecycle bounding box is consistently to the left of the person
|
# If the tracked object lifecycle bounding box is consistently to the left of the person
|
||||||
# then the value should be decreased. Similarly, if a person is walking from
|
# then the value should be decreased. Similarly, if a person is walking from
|
||||||
# left to right and the bounding box is consistently ahead of the person
|
# left to right and the bounding box is consistently ahead of the person
|
||||||
@@ -471,8 +468,8 @@ review:
|
|||||||
detections: False
|
detections: False
|
||||||
# Optional: Activity Context Prompt to give context to the GenAI what activity is and is not suspicious.
|
# Optional: Activity Context Prompt to give context to the GenAI what activity is and is not suspicious.
|
||||||
# It is important to be direct and detailed. See documentation for the default prompt structure.
|
# It is important to be direct and detailed. See documentation for the default prompt structure.
|
||||||
activity_context_prompt: |
|
activity_context_prompt: """Define what is and is not suspicious
|
||||||
Define what is and is not suspicious
|
"""
|
||||||
# Optional: Image source for GenAI (default: preview)
|
# Optional: Image source for GenAI (default: preview)
|
||||||
# Options: "preview" (uses cached preview frames at ~180p) or "recordings" (extracts frames from recordings at 480p)
|
# Options: "preview" (uses cached preview frames at ~180p) or "recordings" (extracts frames from recordings at 480p)
|
||||||
# Using "recordings" provides better image quality but uses more tokens per image.
|
# Using "recordings" provides better image quality but uses more tokens per image.
|
||||||
@@ -816,8 +813,7 @@ classification:
|
|||||||
cameras:
|
cameras:
|
||||||
camera_name:
|
camera_name:
|
||||||
# Required: Crop of image frame on this camera to run classification on
|
# Required: Crop of image frame on this camera to run classification on
|
||||||
# [x1, y1, x2, y2] as decimals between 0 and 1, relative to the detect resolution
|
crop: [0, 180, 220, 400]
|
||||||
crop: [0.0, 0.25, 0.3, 0.85]
|
|
||||||
# Optional: If classification should be run when motion is detected in the crop (default: shown below)
|
# Optional: If classification should be run when motion is detected in the crop (default: shown below)
|
||||||
motion: False
|
motion: False
|
||||||
# Optional: Interval to run classification on in seconds (default: shown below)
|
# Optional: Interval to run classification on in seconds (default: shown below)
|
||||||
@@ -981,9 +977,7 @@ cameras:
|
|||||||
# Optional: Adjust sort order of cameras in the UI. Larger numbers come later (default: shown below)
|
# Optional: Adjust sort order of cameras in the UI. Larger numbers come later (default: shown below)
|
||||||
# By default the cameras are sorted alphabetically.
|
# By default the cameras are sorted alphabetically.
|
||||||
order: 0
|
order: 0
|
||||||
# Optional: Whether or not to show the camera on the default All Cameras live dashboard.
|
# Optional: Whether or not to show the camera in the Frigate UI (default: shown below)
|
||||||
# The camera is still available everywhere else, including camera groups and settings
|
|
||||||
# (default: shown below)
|
|
||||||
dashboard: True
|
dashboard: True
|
||||||
# Optional: Whether this camera is visible in review (the review page and its camera
|
# Optional: Whether this camera is visible in review (the review page and its camera
|
||||||
# filter, motion review, and the history view) (default: shown below)
|
# filter, motion review, and the history view) (default: shown below)
|
||||||
|
|||||||
@@ -67,20 +67,14 @@ This section can be used to set environment variables for those unable to modify
|
|||||||
|
|
||||||
Variables prefixed with `FRIGATE_` can be referenced in config fields that support environment variable substitution (such as MQTT host and credentials, camera stream URLs, and ONVIF host and credentials) using the `{FRIGATE_VARIABLE_NAME}` syntax.
|
Variables prefixed with `FRIGATE_` can be referenced in config fields that support environment variable substitution (such as MQTT host and credentials, camera stream URLs, and ONVIF host and credentials) using the `{FRIGATE_VARIABLE_NAME}` syntax.
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
The `go2rtc` section is an exception. go2rtc runs as a separate process, so its stream definitions can only be substituted with variables that exist in the container's environment (set via Docker `-e`, the `environment:` section of `docker-compose.yml`, or Docker secrets). Variables defined in the `environment_vars` block above are not available to go2rtc streams. Home Assistant app users, who cannot set container environment variables, must instead put credentials directly in their go2rtc stream URLs.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
<ConfigTabs>
|
<ConfigTabs>
|
||||||
<TabItem value="ui">
|
<TabItem value="ui">
|
||||||
|
|
||||||
Navigate to <NavPath path="Settings > System > Environment variables" /> to add or edit environment variables.
|
Navigate to <NavPath path="Settings > System > Environment variables" /> to add or edit environment variables.
|
||||||
|
|
||||||
| Field | Description |
|
| Field | Description |
|
||||||
| ----------------- | --------------------------------------------------------- |
|
| --------- | --------------------------------------------------------- |
|
||||||
| **Variable name** | The environment variable name (e.g., `FRIGATE_MQTT_USER`) |
|
| **Key** | The environment variable name (e.g., `FRIGATE_MQTT_USER`) |
|
||||||
| **Value** | The value for the variable |
|
| **Value** | The value for the variable |
|
||||||
|
|
||||||
Variables defined here can be referenced elsewhere in your configuration using the `{FRIGATE_VARIABLE_NAME}` syntax.
|
Variables defined here can be referenced elsewhere in your configuration using the `{FRIGATE_VARIABLE_NAME}` syntax.
|
||||||
@@ -293,10 +287,6 @@ networking:
|
|||||||
|
|
||||||
This setting is for advanced users. For the majority of use cases it's recommended to change the `ports` section of your Docker compose file or use the Docker `run` `--publish` option instead, e.g. `-p 443:8971`. Changing Frigate's ports may break some integrations.
|
This setting is for advanced users. For the majority of use cases it's recommended to change the `ports` section of your Docker compose file or use the Docker `run` `--publish` option instead, e.g. `-p 443:8971`. Changing Frigate's ports may break some integrations.
|
||||||
|
|
||||||
The internal and external ports must be different port numbers, and Frigate will refuse to start otherwise. Requests arriving on the internal port are treated as authenticated admins, so pointing both at the same port would remove authentication from the external one.
|
|
||||||
|
|
||||||
Nginx binds these ports when it starts, so port changes only take effect after Frigate restarts.
|
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Customizing the Nginx configuration
|
### Customizing the Nginx configuration
|
||||||
@@ -339,7 +329,7 @@ For example:
|
|||||||
```
|
```
|
||||||
services:
|
services:
|
||||||
frigate:
|
frigate:
|
||||||
image: ghcr.io/blakeblackshear/frigate:stable
|
image: blakeblackshear/frigate:latest
|
||||||
environment:
|
environment:
|
||||||
- FRIGATE_BASE_PATH=/frigate
|
- FRIGATE_BASE_PATH=/frigate
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ cameras:
|
|||||||
|
|
||||||
### Configuring Minimum Volume
|
### Configuring Minimum Volume
|
||||||
|
|
||||||
The audio detector uses volume levels in the same way that motion in a camera feed is used for object detection. This means that Frigate will not run audio detection unless the audio volume is above the configured level in order to reduce resource usage. Audio levels can vary widely between camera models so it is important to run tests to see what volume levels are. The [Debug view](/usage/live#the-single-camera-view) in the Frigate UI has an Audio tab for cameras that have the `audio` role assigned where a graph and the current levels are displayed. The `min_volume` parameter should be set to the minimum the `RMS` level required to run audio detection.
|
The audio detector uses volume levels in the same way that motion in a camera feed is used for object detection. This means that Frigate will not run audio detection unless the audio volume is above the configured level in order to reduce resource usage. Audio levels can vary widely between camera models so it is important to run tests to see what volume levels are. The [Debug view](/usage/live#the-single-camera-view) in the Frigate UI has an Audio tab for cameras that have the `audio` role assigned where a graph and the current levels are is displayed. The `min_volume` parameter should be set to the minimum the `RMS` level required to run audio detection.
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ The only field that is valid at the camera level is `enabled`.
|
|||||||
|
|
||||||
#### Live transcription
|
#### Live transcription
|
||||||
|
|
||||||
The single camera Live view in the Frigate UI supports live transcription of audio for streams defined with the `audio` role. Use the Enable/Disable Live Audio Transcription button/switch to toggle transcription processing, or toggle it outside of the UI with the [`frigate/<camera_name>/audio_transcription/set`](/integrations/mqtt#frigatecamera_nameaudio_transcriptionset) MQTT topic or the HTTP API. When speech is heard, the UI will display a black box over the top of the camera stream with text. The MQTT topic `frigate/<camera_name>/audio/transcription` will also be updated in real-time with transcribed text.
|
The single camera Live view in the Frigate UI supports live transcription of audio for streams defined with the `audio` role. Use the Enable/Disable Live Audio Transcription button/switch to toggle transcription processing. When speech is heard, the UI will display a black box over the top of the camera stream with text. The MQTT topic `frigate/<camera_name>/audio/transcription` will also be updated in real-time with transcribed text.
|
||||||
|
|
||||||
Results can be error-prone due to a number of factors, including:
|
Results can be error-prone due to a number of factors, including:
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ If you have CUDA hardware, you can experiment with the `large` `whisper` model o
|
|||||||
|
|
||||||
#### Transcription and translation of `speech` audio events
|
#### Transcription and translation of `speech` audio events
|
||||||
|
|
||||||
Any `speech` events in Explore can be transcribed and/or translated through the Transcribe button (the microphone icon) in the Tracked Object Details pane.
|
Any `speech` events in Explore can be transcribed and/or translated through the Transcribe button in the Tracked Object Details pane.
|
||||||
|
|
||||||
In order to use transcription and translation for past events, you must enable audio detection and define `speech` as an audio type to listen for. To have `speech` events translated into the language of your choice, set the `language` config parameter with the correct [language code](https://github.com/openai/whisper/blob/main/whisper/tokenizer.py#L10).
|
In order to use transcription and translation for past events, you must enable audio detection and define `speech` as an audio type to listen for. To have `speech` events translated into the language of your choice, set the `language` config parameter with the correct [language code](https://github.com/openai/whisper/blob/main/whisper/tokenizer.py#L10).
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ Recorded `speech` events will always use a `whisper` model, regardless of the `m
|
|||||||
|
|
||||||
Because transcription is **serialized (one event at a time)** and speech events can be generated far faster than they can be processed, an auto-transcribe toggle would very quickly create an ever-growing backlog and degrade core functionality. For the amount of engineering and risk involved, it adds **very little practical value** for the majority of deployments, which are often on low-powered, edge hardware.
|
Because transcription is **serialized (one event at a time)** and speech events can be generated far faster than they can be processed, an auto-transcribe toggle would very quickly create an ever-growing backlog and degrade core functionality. For the amount of engineering and risk involved, it adds **very little practical value** for the majority of deployments, which are often on low-powered, edge hardware.
|
||||||
|
|
||||||
If you hear speech that's actually important and worth saving/indexing for the future, **just press the transcribe button (the microphone icon) in Explore** on that specific `speech` event - that keeps things explicit, reliable, and under your control.
|
If you hear speech that's actually important and worth saving/indexing for the future, **just press the transcribe button in Explore** on that specific `speech` event - that keeps things explicit, reliable, and under your control.
|
||||||
|
|
||||||
Other options are being considered for future versions of Frigate to add transcription options that support external `whisper` Docker containers. A single transcription service could then be shared by Frigate and other applications (for example, Home Assistant Voice), and run on more powerful machines when available.
|
Other options are being considered for future versions of Frigate to add transcription options that support external `whisper` Docker containers. A single transcription service could then be shared by Frigate and other applications (for example, Home Assistant Voice), and run on more powerful machines when available.
|
||||||
|
|
||||||
|
|||||||
@@ -262,19 +262,6 @@ In this example:
|
|||||||
|
|
||||||
- Admin precedence: if the `admin` mapping matches, Frigate resolves the session to `admin` to avoid accidental downgrade when a user belongs to multiple groups (for example both `admin` and `viewer` groups).
|
- Admin precedence: if the `admin` mapping matches, Frigate resolves the session to `admin` to avoid accidental downgrade when a user belongs to multiple groups (for example both `admin` and `viewer` groups).
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
If a user isn't getting the role you expect, enable debug logging to see exactly what headers Frigate is receiving from your proxy:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
logger:
|
|
||||||
default: info
|
|
||||||
logs:
|
|
||||||
frigate.api.auth: debug
|
|
||||||
```
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
#### Port Considerations
|
#### Port Considerations
|
||||||
|
|
||||||
**Authenticated Port (8971)**
|
**Authenticated Port (8971)**
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ title: Camera Autotracking
|
|||||||
import ConfigTabs from "@site/src/components/ConfigTabs";
|
import ConfigTabs from "@site/src/components/ConfigTabs";
|
||||||
import TabItem from "@theme/TabItem";
|
import TabItem from "@theme/TabItem";
|
||||||
import NavPath from "@site/src/components/NavPath";
|
import NavPath from "@site/src/components/NavPath";
|
||||||
import FaqItem from "@site/src/components/FaqItem";
|
|
||||||
|
|
||||||
An ONVIF-capable, PTZ (pan-tilt-zoom) camera that supports relative movement within the field of view (FOV) can be configured to automatically track moving objects and keep them in the center of the frame.
|
An ONVIF-capable, PTZ (pan-tilt-zoom) camera that supports relative movement within the field of view (FOV) can be configured to automatically track moving objects and keep them in the center of the frame.
|
||||||
|
|
||||||
@@ -188,96 +187,30 @@ In security and surveillance, it's common to use "spotter" cameras in combinatio
|
|||||||
|
|
||||||
## Troubleshooting and FAQ
|
## Troubleshooting and FAQ
|
||||||
|
|
||||||
### Camera Compatibility
|
### The autotracker loses track of my object. Why?
|
||||||
|
|
||||||
<FaqItem id="which-ptz-camera-should-i-use-for-autotracking" question="Which PTZ camera should I use for autotracking?">
|
|
||||||
|
|
||||||
See the community-maintained list of [ONVIF PTZ camera recommendations](cameras.md#onvif-ptz-camera-recommendations) for cameras and brands reported to work (and not work) with autotracking. This is not an exhaustive list that is frequently updated, so other cameras not listed may also work well. Frigate's autotracking was developed with a Dahua SD1A404XB-GNR (now sold as the EmpireTech PTZ1A4M-4X-S2), and Dahua / EmpireTech PTZs are the most consistently reported as working well.
|
|
||||||
|
|
||||||
When comparing models:
|
|
||||||
|
|
||||||
- Verify ONVIF support first. See [Checking ONVIF camera support](#checking-onvif-camera-support) above.
|
|
||||||
- Favor a camera with a fast PTZ motor. Cameras with slow motors may fail [calibration](#calibration) and will struggle to keep up with objects that move across the field of view quickly.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="does-autotracking-work-with-reolink-ptz-cameras" question="Does autotracking work with Reolink PTZ cameras?">
|
|
||||||
|
|
||||||
No. Reolink cameras (including the TrackMix series) lack the ONVIF FOV RelativeMove firmware support that Frigate's autotracker requires, so autotracking will not work with any current Reolink PTZ. Their video streams and basic PTZ controls still work in Frigate. If you want object tracking on a Reolink PTZ, you will need to use the tracking feature built into the camera's firmware, which is proprietary and operates independently of Frigate.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="im-seeing-an-error-in-the-logs-that-my-camera-is-still-in-onvif-moving-status-what-does-this-mean" question={"I'm seeing an error in the logs that my camera \"is still in ONVIF 'MOVING' status.\" What does this mean?"}>
|
|
||||||
|
|
||||||
There are two possible known reasons for this (and perhaps others yet unknown): a slow PTZ motor or buggy camera firmware. Frigate uses an ONVIF parameter provided by the camera, `MoveStatus`, to determine when the PTZ's motor is moving or idle. According to some users, Hikvision PTZs (even with the latest firmware), are not updating this value after PTZ movement. Unfortunately there is no workaround to this bug in Hikvision firmware, so autotracking will not function correctly and should be disabled in your config. This may also be the case with other non-Hikvision cameras utilizing Hikvision firmware, such as some Annke models. In rare cases the vendor may provide fixed firmware on request; for example, Annke has supplied firmware that resolves this for the CZ504 (see the [camera recommendations list](cameras.md#onvif-ptz-camera-recommendations)).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="calibration-seems-to-have-completed-but-the-camera-is-not-actually-moving-to-track-my-object-why" question="Calibration seems to have completed, but the camera is not actually moving to track my object. Why?">
|
|
||||||
|
|
||||||
Some cameras have firmware that reports that FOV RelativeMove, the ONVIF command that Frigate uses for autotracking, is supported. However, if the camera does not pan or tilt when an object comes into the required zone, your camera's firmware does not actually support FOV RelativeMove. One such camera is the Uniview IPC672LR-AX4DUPK. It actually moves its zoom motor instead of panning and tilting and does not follow the ONVIF standard whatsoever.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
### Calibration Issues
|
|
||||||
|
|
||||||
<FaqItem id="i-tried-calibrating-my-camera-but-the-logs-show-that-it-is-stuck-at-0-and-frigate-is-not-starting-up" question="I tried calibrating my camera, but the logs show that it is stuck at 0% and Frigate is not starting up.">
|
|
||||||
|
|
||||||
This is often caused by the same reason as the "MOVING" status error above - the `MoveStatus` ONVIF parameter is not changing due to a bug in your camera's firmware. Also, see the note above: Frigate's web UI and all other cameras will be unresponsive while calibration is in progress. This is expected and normal. But if you don't see log entries every few seconds for calibration progress, your camera is not compatible with autotracking.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="frigate-reports-an-error-saying-that-calibration-has-failed-why" question="Frigate reports an error saying that calibration has failed. Why?">
|
|
||||||
|
|
||||||
Calibration measures the amount of time it takes for Frigate to make a series of movements with your PTZ. This error message is recorded in the log if these values are too high for Frigate to support calibrated autotracking. This is often the case when your camera's motor or network connection is too slow or your camera's firmware doesn't report the motor status in a timely manner.
|
|
||||||
|
|
||||||
Some things to try:
|
|
||||||
|
|
||||||
- If your camera's firmware has a PTZ or motor speed setting, set it to the fastest available speed and calibrate again.
|
|
||||||
- Run without calibration: remove the `movement_weights` line from your config, set `calibrate_on_startup` to `False`, and restart.
|
|
||||||
|
|
||||||
If calibration consistently fails, this often means your camera's motor is too slow and autotracking will behave unpredictably or won't be able to keep up with moving objects.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="autotracking-is-erratic-or-moves-the-camera-in-the-wrong-direction" question="Autotracking is erratic, moves the camera in the wrong direction, or zooms past my object. Why?">
|
|
||||||
|
|
||||||
Frigate uses the `movement_weights` measured during calibration to predict how far the camera needs to move to keep an object centered, so inaccurate values produce movements that don't seem to make sense: overshooting, moving the opposite direction, or zooming in on an object's last known position and losing it entirely. This is almost always a calibration issue.
|
|
||||||
|
|
||||||
- Remove the `movement_weights` entry from your config and restart Frigate to run without calibration. If tracking improves, try recalibrating.
|
|
||||||
- Recalibrate several times. The `movement_weights` values should be close to each other after each run. If they vary significantly between runs, your camera may not be reporting its motor status reliably, and you may get better results without calibration.
|
|
||||||
- If you are using zooming, a high `zoom_factor` can cause the camera to zoom in too far and lose the object. Try a lower value.
|
|
||||||
|
|
||||||
Remember to recalibrate whenever you change your `return_preset`, change your camera's detect `fps`, or enable zooming after calibrating with it disabled.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
### Tracking Behavior
|
|
||||||
|
|
||||||
<FaqItem id="the-autotracker-loses-track-of-my-object-why" question="The autotracker loses track of my object. Why?">
|
|
||||||
|
|
||||||
There are many reasons this could be the case. If you are using experimental zooming, your `zoom_factor` value might be too high, the object might be traveling too quickly, the scene might be too dark, there are not enough details in the scene (for example, a PTZ looking down on a driveway or other monotone background without a sufficient number of hard edges or corners), or the scene is otherwise less than optimal for Frigate to maintain tracking.
|
There are many reasons this could be the case. If you are using experimental zooming, your `zoom_factor` value might be too high, the object might be traveling too quickly, the scene might be too dark, there are not enough details in the scene (for example, a PTZ looking down on a driveway or other monotone background without a sufficient number of hard edges or corners), or the scene is otherwise less than optimal for Frigate to maintain tracking.
|
||||||
|
|
||||||
Your camera's shutter speed may also be set too low so that blurring occurs with motion. Check your camera's firmware to see if you can increase the shutter speed.
|
Your camera's shutter speed may also be set too low so that blurring occurs with motion. Check your camera's firmware to see if you can increase the shutter speed.
|
||||||
|
|
||||||
Watching Frigate's debug view can help to determine a possible cause. The autotracked object will have a thicker colored box around it. If the camera consistently zooms in on the object and then loses it, see [Autotracking is erratic, moves the camera in the wrong direction, or zooms past my object. Why?](#autotracking-is-erratic-or-moves-the-camera-in-the-wrong-direction) above.
|
Watching Frigate's debug view can help to determine a possible cause. The autotracked object will have a thicker colored box around it.
|
||||||
|
|
||||||
</FaqItem>
|
### I'm seeing an error in the logs that my camera "is still in ONVIF 'MOVING' status." What does this mean?
|
||||||
|
|
||||||
<FaqItem id="im-seeing-this-error-in-the-logs-autotracker-motion-estimator-couldnt-get-transformations-what-does-this-mean" question={"I'm seeing this error in the logs: \"Autotracker: motion estimator couldn't get transformations\". What does this mean?"}>
|
There are two possible known reasons for this (and perhaps others yet unknown): a slow PTZ motor or buggy camera firmware. Frigate uses an ONVIF parameter provided by the camera, `MoveStatus`, to determine when the PTZ's motor is moving or idle. According to some users, Hikvision PTZs (even with the latest firmware), are not updating this value after PTZ movement. Unfortunately there is no workaround to this bug in Hikvision firmware, so autotracking will not function correctly and should be disabled in your config. This may also be the case with other non-Hikvision cameras utilizing Hikvision firmware.
|
||||||
|
|
||||||
|
### I tried calibrating my camera, but the logs show that it is stuck at 0% and Frigate is not starting up.
|
||||||
|
|
||||||
|
This is often caused by the same reason as above - the `MoveStatus` ONVIF parameter is not changing due to a bug in your camera's firmware. Also, see the note above: Frigate's web UI and all other cameras will be unresponsive while calibration is in progress. This is expected and normal. But if you don't see log entries every few seconds for calibration progress, your camera is not compatible with autotracking.
|
||||||
|
|
||||||
|
### I'm seeing this error in the logs: "Autotracker: motion estimator couldn't get transformations". What does this mean?
|
||||||
|
|
||||||
To maintain object tracking during PTZ moves, Frigate tracks the motion of your camera based on the details of the frame. If you are seeing this message, it could mean that your `zoom_factor` may be set too high, the scene around your detected object does not have enough details (like hard edges or color variations), or your camera's shutter speed is too slow and motion blur is occurring. Try reducing `zoom_factor`, finding a way to alter the scene around your object, or changing your camera's shutter speed.
|
To maintain object tracking during PTZ moves, Frigate tracks the motion of your camera based on the details of the frame. If you are seeing this message, it could mean that your `zoom_factor` may be set too high, the scene around your detected object does not have enough details (like hard edges or color variations), or your camera's shutter speed is too slow and motion blur is occurring. Try reducing `zoom_factor`, finding a way to alter the scene around your object, or changing your camera's shutter speed.
|
||||||
|
|
||||||
</FaqItem>
|
### Calibration seems to have completed, but the camera is not actually moving to track my object. Why?
|
||||||
|
|
||||||
<FaqItem id="why-does-object-detection-pause-briefly-when-the-camera-moves" question="Why does object detection pause briefly when the camera moves?">
|
Some cameras have firmware that reports that FOV RelativeMove, the ONVIF command that Frigate uses for autotracking, is supported. However, if the camera does not pan or tilt when an object comes into the required zone, your camera's firmware does not actually support FOV RelativeMove. One such camera is the Uniview IPC672LR-AX4DUPK. It actually moves its zoom motor instead of panning and tilting and does not follow the ONVIF standard whatsoever.
|
||||||
|
|
||||||
When the PTZ moves, the entire frame changes at once. Frigate's motion detection treats sudden scene-wide changes (like a lightning flash, an infrared mode switch, or a camera move) specially and pauses detection momentarily until the scene stabilizes. This is expected and normal, and detection resumes shortly after the camera stops moving. If detection does not resume once the camera is stationary, use the [debug view](/usage/live#the-single-camera-view) to see what is happening.
|
### Frigate reports an error saying that calibration has failed. Why?
|
||||||
|
|
||||||
</FaqItem>
|
Calibration measures the amount of time it takes for Frigate to make a series of movements with your PTZ. This error message is recorded in the log if these values are too high for Frigate to support calibrated autotracking. This is often the case when your camera's motor or network connection is too slow or your camera's firmware doesn't report the motor status in a timely manner. You can try running without calibration (just remove the `movement_weights` line from your config and restart), but if calibration fails, this often means that autotracking will behave unpredictably.
|
||||||
|
|
||||||
<FaqItem id="can-i-turn-autotracking-on-and-off-automatically" question="Can I turn autotracking on and off automatically?">
|
|
||||||
|
|
||||||
Yes. Autotracking can be toggled per camera at runtime over MQTT with the [`frigate/<camera_name>/ptz_autotracker/set`](../integrations/mqtt.md#frigatecamera_nameptz_autotrackerset) topic, and the [Home Assistant integration](../integrations/home-assistant.md) exposes a switch for it. This pairs well with the "spotter" camera automations described in [Usage applications](#usage-applications) above, for example only enabling autotracking at night or when nobody is home.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ Reolink has many different camera models with inconsistently supported features
|
|||||||
| 6MP or higher | Latest (ex: Duo3, CX-8##) | http-flv with ffmpeg 8.0, or rtsp | This uses the new http-flv-enhanced over H265 which requires ffmpeg 8.0 (Frigate's default) |
|
| 6MP or higher | Latest (ex: Duo3, CX-8##) | http-flv with ffmpeg 8.0, or rtsp | This uses the new http-flv-enhanced over H265 which requires ffmpeg 8.0 (Frigate's default) |
|
||||||
| 6MP or higher | Older (ex: RLC-8##) | rtsp | |
|
| 6MP or higher | Older (ex: RLC-8##) | rtsp | |
|
||||||
|
|
||||||
Frigate works much better with newer Reolink cameras that are setup with the below options:
|
Frigate works much better with newer reolink cameras that are setup with the below options:
|
||||||
|
|
||||||
If available, recommended settings are:
|
If available, recommended settings are:
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ If available, recommended settings are:
|
|||||||
|
|
||||||
#### Setup via the Add Camera Wizard
|
#### Setup via the Add Camera Wizard
|
||||||
|
|
||||||
The [Add Camera Wizard](cameras.md#adding-a-camera-with-the-add-camera-wizard) is the recommended way to add a standard Reolink camera. Before starting, make sure [HTTP is enabled](https://support.reolink.com/articles/360003452893-How-to-Access-Reolink-Cameras-NVRs-Home-Hub-Locally-via-Web-Browsers/) in the camera's advanced network settings. The wizard uses the camera's HTTP API to determine its resolution and choose the recommended stream type from the table above.
|
The Add Camera Wizard is the recommended way to add a standard Reolink camera. Before starting, make sure HTTP is enabled in the camera's advanced network settings. The wizard uses the camera's HTTP API to determine its resolution and choose the recommended stream type from the table above.
|
||||||
|
|
||||||
1. Click **Add Camera** in <NavPath path="Settings > Global configuration > Camera management" />.
|
1. Click **Add Camera** in <NavPath path="Settings > Global configuration > Camera management" />.
|
||||||
2. Choose **Manual selection** as the stream detection method and select **Reolink** as the camera brand.
|
2. Choose **Manual selection** as the stream detection method and select **Reolink** as the camera brand.
|
||||||
@@ -192,7 +192,7 @@ Reolink's latest cameras support two way audio via go2rtc and other applications
|
|||||||
|
|
||||||
NOTE: The RTSP stream can not be prefixed with `ffmpeg:`, as go2rtc needs to handle the stream to support two way audio.
|
NOTE: The RTSP stream can not be prefixed with `ffmpeg:`, as go2rtc needs to handle the stream to support two way audio.
|
||||||
|
|
||||||
Ensure [HTTP is enabled](https://support.reolink.com/articles/360003452893-How-to-Access-Reolink-Cameras-NVRs-Home-Hub-Locally-via-Web-Browsers/) in the camera's advanced network settings. To use two way talk with Frigate, see the [Live view documentation](/configuration/live#two-way-talk).
|
Ensure HTTP is enabled in the camera's advanced network settings. To use two way talk with Frigate, see the [Live view documentation](/configuration/live#two-way-talk).
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ go2rtc:
|
|||||||
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus"
|
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus"
|
||||||
your_reolink_camera_sub:
|
your_reolink_camera_sub:
|
||||||
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=username&password=password"
|
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=username&password=password"
|
||||||
# example for connecting to a Reolink camera that supports two way talk
|
# example for connectin to a Reolink camera that supports two way talk
|
||||||
your_reolink_camera_twt:
|
your_reolink_camera_twt:
|
||||||
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus"
|
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus"
|
||||||
- "rtsp://username:password@reolink_ip/Preview_01_sub"
|
- "rtsp://username:password@reolink_ip/Preview_01_sub"
|
||||||
@@ -249,7 +249,7 @@ cameras:
|
|||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
Unifi G5s cameras and newer need a Unifi Protect server to enable rtsps stream, it's not possible to enable it in standalone mode.
|
Unifi G5s cameras and newer need a Unifi Protect server to enable rtsps stream, it's not posible to enable it in standalone mode.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|||||||
@@ -7,74 +7,6 @@ import ConfigTabs from "@site/src/components/ConfigTabs";
|
|||||||
import TabItem from "@theme/TabItem";
|
import TabItem from "@theme/TabItem";
|
||||||
import NavPath from "@site/src/components/NavPath";
|
import NavPath from "@site/src/components/NavPath";
|
||||||
|
|
||||||
## Adding a camera with the Add Camera Wizard
|
|
||||||
|
|
||||||
The Add Camera Wizard is the recommended way to add a camera. Click **Add Camera** in <NavPath path="Settings > Global configuration > Camera management" />. The wizard connects to your camera, tests each stream, and writes the camera's configuration for you, including the [go2rtc](go2rtc.md) restream and the live view stream mapping, so a standard setup needs no hand-written YAML.
|
|
||||||
|
|
||||||
### Step 1: Name and connection
|
|
||||||
|
|
||||||
Enter a name for the camera along with its host or IP address and credentials, then choose how the wizard should find the camera's streams:
|
|
||||||
|
|
||||||
- **Probe camera** queries the camera over ONVIF (the ONVIF port is usually 80 or 8080) and asks it for its stream URLs. Some cameras use a separate ONVIF/service account rather than the device admin user, and some require **Use digest authentication** to be enabled.
|
|
||||||
- **Manual selection** builds a stream URL from a template for the camera brand you pick (Dahua/Amcrest/EmpireTech, Hikvision/Uniview/Annke, Ubiquiti, Reolink, Axis, TP-Link, or Foscam). Choose **Other** to enter a custom RTSP URL directly. Non-RTSP stream types must be [configured manually](#setting-up-camera-inputs).
|
|
||||||
|
|
||||||
The name you enter is lowercased and spaces become underscores. If the result still isn't a valid config key, the wizard generates a safe name and stores what you typed as `friendly_name`.
|
|
||||||
|
|
||||||
### Step 2: Probe or snapshot
|
|
||||||
|
|
||||||
In probe mode, the wizard reports what the camera returned (manufacturer, model, firmware, profile count, and whether PTZ, presets, and [autotracking](autotracking.md) are supported) along with the RTSP URLs it discovered. Test each candidate to see its resolution, frame rate, and codecs together with a snapshot, then select the one you want to use.
|
|
||||||
|
|
||||||
In manual mode, the wizard tests the templated URL and shows the same metadata and snapshot.
|
|
||||||
|
|
||||||
If no RTSP URLs are found, the credentials may be wrong or the camera may not support ONVIF. Go back and use manual selection instead.
|
|
||||||
|
|
||||||
### Step 3: Stream configuration
|
|
||||||
|
|
||||||
Assign [roles](#setting-up-camera-inputs) to the stream, and use **Add Another Stream** to add the camera's other streams, for example a substream for `detect` alongside the main stream for `record`. At least one stream must have the `detect` role before you can continue.
|
|
||||||
|
|
||||||
**Reduce connections to camera** routes that input through the go2rtc restream so Frigate and the live view share a single connection to the camera instead of each opening their own. See [restream](restream.md) for more detail.
|
|
||||||
|
|
||||||
### Step 4: Validation and testing
|
|
||||||
|
|
||||||
Connect each stream to get a live preview, an estimated bandwidth figure, and a list of validation results. The wizard checks for the most common misconfigurations, including:
|
|
||||||
|
|
||||||
- A detect resolution that is too high (increased resource usage) or too low for reliable detection, or one it could not probe at all
|
|
||||||
- A stream marked `record` whose audio codec is not AAC, or that has no audio at all
|
|
||||||
- A stream marked `audio` that carries no audio stream
|
|
||||||
- Using a restreamed input for the `record` role
|
|
||||||
- Brand-specific issues, such as an RTSP stream on a Reolink camera that should use http-flv, or a Dahua/Hikvision substream selected for `detect`
|
|
||||||
|
|
||||||
**Use stream compatibility mode** passes the stream through go2rtc's ffmpeg module. Enable it if a stream fails to load after several attempts. Note that this also prevents [two way talk](/configuration/live#two-way-talk) from being detected for that stream.
|
|
||||||
|
|
||||||
**Save New Camera** writes the configuration and starts the camera right away. No restart is required.
|
|
||||||
|
|
||||||
Other features, including [hardware acceleration](hardware_acceleration_video.md), [two way talk](/configuration/live#two-way-talk), and audio transcoding, is configured after the camera has been added. For camera model specific quirks, see the [camera specific](camera_specific.md) docs.
|
|
||||||
|
|
||||||
## Deleting a camera
|
|
||||||
|
|
||||||
Click **Delete Camera** in <NavPath path="Settings > Global configuration > Camera management" />, choose the camera, and confirm. Deleting a camera requires the `admin` role and cannot be undone.
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
Deleting a camera permanently removes its recordings, tracked objects, and configuration. If you only want to stop processing a camera, set its state to **Off** or **Disabled** in <NavPath path="Settings > Global configuration > Camera management" /> instead. See [camera state](/configuration/live#camera-state).
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
Deleting a camera removes:
|
|
||||||
|
|
||||||
- The camera's section of your config file, along with its entries in any [role](authentication.md#user-roles) camera list. A custom role left with no cameras is removed as well.
|
|
||||||
- Every database record for the camera: tracked objects, review items, recordings, previews, timeline entries, the saved region grid, and [triggers](semantic_search.md#triggers).
|
|
||||||
- Every media file for the camera: recordings, snapshots, thumbnails, and preview clips.
|
|
||||||
|
|
||||||
[Exports](/usage/exports) are kept by default, so saved footage survives the deletion of the camera it came from. Turn on **Also delete exports for this camera** in the confirmation step to remove those too.
|
|
||||||
|
|
||||||
The camera's processes are stopped and the change takes effect immediately, so no restart is required. If the resulting config cannot be parsed, Frigate restores the previous config and reports an error instead of leaving Frigate in a broken state.
|
|
||||||
|
|
||||||
Two things are not cleaned up for you:
|
|
||||||
|
|
||||||
- **go2rtc streams.** Frigate makes a best effort to stop a running [go2rtc](go2rtc.md) stream named after the camera, but stream entries in your config file remain and are recreated on the next restart. Remove them in <NavPath path="Settings > System > go2rtc streams" /> or in your config file.
|
|
||||||
- **Camera groups.** A deleted camera stays listed in any [camera group](#setting-up-camera-groups) that referenced it. The group skips the missing camera, so this is harmless, but you can edit the group to drop the stale entry.
|
|
||||||
|
|
||||||
## Setting Up Camera Inputs
|
## Setting Up Camera Inputs
|
||||||
|
|
||||||
Several inputs can be configured for each camera and the role of each input can be mixed and matched based on your needs. This allows you to use a lower resolution stream for object detection, but create recordings from a higher resolution stream, or vice versa.
|
Several inputs can be configured for each camera and the role of each input can be mixed and matched based on your needs. This allows you to use a lower resolution stream for object detection, but create recordings from a higher resolution stream, or vice versa.
|
||||||
@@ -137,7 +69,7 @@ Additional cameras are simply added under the camera configuration section.
|
|||||||
<ConfigTabs>
|
<ConfigTabs>
|
||||||
<TabItem value="ui">
|
<TabItem value="ui">
|
||||||
|
|
||||||
Navigate to <NavPath path="Settings > Global configuration > Camera management" /> and use the [Add Camera Wizard](#adding-a-camera-with-the-add-camera-wizard) to configure each additional camera.
|
Navigate to <NavPath path="Settings > Global configuration > Camera management" /> and use the add camera button to configure each additional camera.
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem value="yaml">
|
<TabItem value="yaml">
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Settings are organized into two scopes:
|
|||||||
- **Global configuration**: values under <NavPath path="Settings > Global configuration" /> apply to every camera by default. This is where you set the baseline behavior for object detection, recording, snapshots, motion, and so on.
|
- **Global configuration**: values under <NavPath path="Settings > Global configuration" /> apply to every camera by default. This is where you set the baseline behavior for object detection, recording, snapshots, motion, and so on.
|
||||||
- **Camera configuration**: values under <NavPath path="Settings > Camera configuration" /> apply to a single camera. Use the camera selector button at the top of these pages to choose which camera you are editing.
|
- **Camera configuration**: values under <NavPath path="Settings > Camera configuration" /> apply to a single camera. Use the camera selector button at the top of these pages to choose which camera you are editing.
|
||||||
|
|
||||||
When a camera-level section is left untouched, the camera simply inherits the global values. Changing a value on a camera page **overrides** the global value for that camera only: the global setting and every other camera are unaffected. This mirrors how the YAML works, where a value set under `cameras.<name>` takes precedence over the same value set at the top level. See [Global and Camera-Level Configuration](./config_overrides.md) for the full details, including how lists and maps are handled and which settings must be enabled globally first.
|
When a camera-level section is left untouched, the camera simply inherits the global values. Changing a value on a camera page **overrides** the global value for that camera only: the global setting and every other camera are unaffected. This mirrors how the YAML works, where a value set under `cameras.<name>` takes precedence over the same value set at the top level.
|
||||||
|
|
||||||
To undo an override and go back to inheriting from the parent scope, use the reset button at the bottom of the section:
|
To undo an override and go back to inheriting from the parent scope, use the reset button at the bottom of the section:
|
||||||
|
|
||||||
@@ -130,7 +130,6 @@ go2rtc:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
api_key: "{FRIGATE_GENAI_API_KEY}"
|
api_key: "{FRIGATE_GENAI_API_KEY}"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,244 +0,0 @@
|
|||||||
---
|
|
||||||
id: config_overrides
|
|
||||||
title: Global and Camera-Level Configuration
|
|
||||||
---
|
|
||||||
|
|
||||||
import ConfigTabs from "@site/src/components/ConfigTabs";
|
|
||||||
import TabItem from "@theme/TabItem";
|
|
||||||
import NavPath from "@site/src/components/NavPath";
|
|
||||||
|
|
||||||
Most of Frigate's configuration can be set once for all cameras and then adjusted for individual cameras. The global value acts as the default for every camera, and any camera can override it.
|
|
||||||
|
|
||||||
This page explains how that inheritance works. For a tour of the Settings UI itself, see [Frigate Configuration](./config.md).
|
|
||||||
|
|
||||||
## The basics
|
|
||||||
|
|
||||||
Set a value globally and every camera uses it. Set the same value on a camera and that camera uses its own value instead.
|
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
1. Navigate to <NavPath path="Settings > Global configuration > Object detection" /> and set **Detect FPS** to `5`. Every camera now detects at 5 fps.
|
|
||||||
2. Navigate to <NavPath path="Settings > Camera configuration > Object detection" />, select the `driveway` camera, and set **Detect FPS** to `10`.
|
|
||||||
|
|
||||||
The `driveway` camera now detects at 10 fps. Every other camera still uses the global value of 5.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
detect:
|
|
||||||
fps: 5 # every camera detects at 5 fps
|
|
||||||
|
|
||||||
cameras:
|
|
||||||
front_door:
|
|
||||||
ffmpeg: ...
|
|
||||||
driveway:
|
|
||||||
ffmpeg: ...
|
|
||||||
detect:
|
|
||||||
fps: 10 # except this one
|
|
||||||
```
|
|
||||||
|
|
||||||
`front_door` inherits `fps: 5`, and `driveway` uses `10`.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|
||||||
## Overrides apply per value, not per section
|
|
||||||
|
|
||||||
Overriding one value in a section does not detach the rest of that section. Everything you don't set on the camera still comes from the global configuration.
|
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
If you set a camera's **Motion threshold** but leave **Contour area** alone, only the threshold is overridden. The contour area continues to follow <NavPath path="Settings > Global configuration > Motion detection" />, and changing it there still affects that camera.
|
|
||||||
|
|
||||||
Open a section to see which values are overridden: the section header indicates how many fields differ from the global configuration.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
motion:
|
|
||||||
threshold: 30
|
|
||||||
contour_area: 10
|
|
||||||
|
|
||||||
cameras:
|
|
||||||
driveway:
|
|
||||||
motion:
|
|
||||||
threshold: 40
|
|
||||||
```
|
|
||||||
|
|
||||||
The `driveway` camera ends up with `threshold: 40` and `contour_area: 10`. Only the value you wrote was overridden.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|
||||||
## Returning a camera to the global value
|
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
A camera section that has its own values shows an **Overridden** badge. To remove the override and go back to inheriting, use the **Reset to Global** button at the bottom of the section.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
Frigate treats a camera value as an override because it is written in the config file, not because it differs from the global value. Repeating the global value under a camera still creates an override:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
snapshots:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
cameras:
|
|
||||||
driveway:
|
|
||||||
snapshots:
|
|
||||||
enabled: true # this is an override, even though it matches
|
|
||||||
```
|
|
||||||
|
|
||||||
If you later change the global `snapshots.enabled` to `false`, `driveway` keeps saving snapshots, because it has its own value. To make a camera follow the global value again, delete the key from the camera rather than setting it to match.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|
||||||
## Lists replace, maps merge
|
|
||||||
|
|
||||||
This is the distinction that surprises people most.
|
|
||||||
|
|
||||||
**Lists are replaced entirely.** A camera's list does not add to the global list, it takes its place.
|
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
The camera page shows the objects the camera is currently tracking, starting from the global list. Changing that selection under <NavPath path="Settings > Camera configuration > Objects" /> replaces the list for that camera, so make sure every object you want tracked is selected, not just the ones you are adding.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
objects:
|
|
||||||
track:
|
|
||||||
- person
|
|
||||||
- car
|
|
||||||
|
|
||||||
cameras:
|
|
||||||
backyard:
|
|
||||||
objects:
|
|
||||||
track:
|
|
||||||
- dog # backyard tracks ONLY dog, not person or car
|
|
||||||
```
|
|
||||||
|
|
||||||
To track `dog` in addition to the global objects, list all of them on the camera.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|
||||||
An empty list is a valid override, and is the normal way to opt a camera out of something:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
review:
|
|
||||||
alerts:
|
|
||||||
labels:
|
|
||||||
- person
|
|
||||||
|
|
||||||
cameras:
|
|
||||||
street:
|
|
||||||
review:
|
|
||||||
alerts:
|
|
||||||
labels: [] # this camera never creates alerts
|
|
||||||
```
|
|
||||||
|
|
||||||
**Maps are merged key by key.** A camera can add an entry without redeclaring the others.
|
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
Adding a filter for one object under <NavPath path="Settings > Camera configuration > Objects" /> does not remove the filters inherited from <NavPath path="Settings > Global configuration > Objects" />. The camera keeps both.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
objects:
|
|
||||||
filters:
|
|
||||||
person:
|
|
||||||
min_area: 5000
|
|
||||||
|
|
||||||
cameras:
|
|
||||||
driveway:
|
|
||||||
objects:
|
|
||||||
filters:
|
|
||||||
car:
|
|
||||||
min_area: 10000
|
|
||||||
```
|
|
||||||
|
|
||||||
The `driveway` camera ends up with both the `car` filter it defined and the `person` filter from the global configuration.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|
||||||
## Which settings can be overridden
|
|
||||||
|
|
||||||
Most, but not all. The [full reference config](./advanced/reference.md) is the authoritative source: sections that support camera-level overrides are marked with the comment `# NOTE: Can be overridden at the camera level`. In the UI, a setting can be overridden if it appears under both <NavPath path="Settings > Global configuration" /> and <NavPath path="Settings > Camera configuration" />.
|
|
||||||
|
|
||||||
A few things worth knowing beyond that:
|
|
||||||
|
|
||||||
- Some sections are **global only** and have no camera-level equivalent, including `go2rtc`, `genai` providers, `classification`, `telemetry`, `camera_groups`, and `ui`.
|
|
||||||
- Some sections exist **only at the camera level**, such as `zones` and `onvif`.
|
|
||||||
- Some sections are **partially overridable**, meaning a camera accepts only a few of the keys available globally. `face_recognition`, `lpr`, and `audio_transcription` work this way, and the reference config notes which keys apply.
|
|
||||||
|
|
||||||
## Enrichments that must be enabled globally first
|
|
||||||
|
|
||||||
License plate recognition and face recognition are special: the global setting is not just a default, it is a switch that must be on before any camera can use the feature. Enabling one on a camera while it is disabled globally is a configuration error, and Frigate will refuse to start:
|
|
||||||
|
|
||||||
```
|
|
||||||
Camera driveway has lpr enabled but lpr is disabled at the global level of the config. You must enable lpr at the global level.
|
|
||||||
```
|
|
||||||
|
|
||||||
Enable the feature globally, then turn it off on the cameras that don't need it.
|
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
1. Navigate to <NavPath path="Settings > Global configuration > License plate recognition" /> and enable **LPR**.
|
|
||||||
2. Navigate to <NavPath path="Settings > Camera configuration > License plate recognition" />, select each camera that should not run LPR, and disable the **Enable LPR** toggle.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
lpr:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
cameras:
|
|
||||||
driveway:
|
|
||||||
ffmpeg: ... # inherits lpr, enabled
|
|
||||||
backyard:
|
|
||||||
ffmpeg: ...
|
|
||||||
lpr:
|
|
||||||
enabled: false # opted out
|
|
||||||
```
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
This applies only to `lpr` and `face_recognition`, because the global setting controls whether the supporting background process starts at all. Other features do not work this way. Audio transcription, for example, can be enabled on a single camera without being enabled globally.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Profiles
|
|
||||||
|
|
||||||
[Profiles](./profiles.md) add a further layer on top of everything described above. A profile is a named set of camera overrides that you can switch on and off while Frigate is running, for example to change detection and recording behavior when you leave the house.
|
|
||||||
|
|
||||||
Profiles are applied on top of a camera's already-resolved configuration, so a profile value wins over both the camera and the global value while that profile is active. Profiles cover a subset of the camera sections and do not modify your config file.
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
- A camera inherits every value you don't set on it.
|
|
||||||
- Overriding one value does not detach the rest of the section.
|
|
||||||
- Writing a value on a camera overrides it, even if it matches the global value. Remove it to inherit again.
|
|
||||||
- Lists replace the global list. Maps merge into it.
|
|
||||||
- An empty list is an override, not an omission.
|
|
||||||
- `lpr` and `face_recognition` must be enabled globally before a camera can use them.
|
|
||||||
@@ -11,7 +11,7 @@ Object classification allows you to train a custom MobileNetV2 classification mo
|
|||||||
|
|
||||||
:::info
|
:::info
|
||||||
|
|
||||||
Training a custom object classification model requires an internet connection to download MobileNetV2 base weights. By default these weights are not cached in `/config/`, so they are downloaded again after the container is recreated. Once trained, the model runs fully offline. See [Network Requirements](/frigate/network_requirements#one-time-model-downloads) for details.
|
Training a custom object classification model requires a one-time internet connection to download MobileNetV2 base weights. Once trained, the model runs fully offline. See [Network Requirements](/frigate/network_requirements#one-time-model-downloads) for details.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ State classification allows you to train a custom MobileNetV2 classification mod
|
|||||||
|
|
||||||
:::info
|
:::info
|
||||||
|
|
||||||
Training a custom state classification model requires an internet connection to download MobileNetV2 base weights. By default these weights are not cached in `/config/`, so they are downloaded again after the container is recreated. Once trained, the model runs fully offline. See [Network Requirements](/frigate/network_requirements#one-time-model-downloads) for details.
|
Training a custom state classification model requires a one-time internet connection to download MobileNetV2 base weights. Once trained, the model runs fully offline. See [Network Requirements](/frigate/network_requirements#one-time-model-downloads) for details.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -73,13 +73,9 @@ classification:
|
|||||||
interval: 10 # also run every N seconds (optional)
|
interval: 10 # also run every N seconds (optional)
|
||||||
cameras:
|
cameras:
|
||||||
front:
|
front:
|
||||||
# [x1, y1, x2, y2] as decimals between 0 and 1, relative to the
|
crop: [0, 180, 220, 400]
|
||||||
# camera's detect resolution
|
|
||||||
crop: [0.0, 0.25, 0.3, 0.85]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Crop coordinates are normalized: each value is a fraction of the camera's `detect` width or height, not a pixel value. Drawing the crop in the UI wizard writes these values for you.
|
|
||||||
|
|
||||||
An optional config, `save_attempts`, can be set as a key under the model name. This defines the number of classification attempts to save in the Recent Classifications tab. For state classification models, the default is 100.
|
An optional config, `save_attempts`, can be set as a key under the model name. This defines the number of classification attempts to save in the Recent Classifications tab. For state classification models, the default is 100.
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ title: Face Recognition
|
|||||||
import ConfigTabs from "@site/src/components/ConfigTabs";
|
import ConfigTabs from "@site/src/components/ConfigTabs";
|
||||||
import TabItem from "@theme/TabItem";
|
import TabItem from "@theme/TabItem";
|
||||||
import NavPath from "@site/src/components/NavPath";
|
import NavPath from "@site/src/components/NavPath";
|
||||||
import FaqItem from "@site/src/components/FaqItem";
|
|
||||||
|
|
||||||
Face recognition identifies known individuals by matching detected faces with previously learned facial data. When a known `person` is recognized, their name will be added as a `sub_label`. This information is included in the UI, filters, as well as in notifications.
|
Face recognition identifies known individuals by matching detected faces with previously learned facial data. When a known `person` is recognized, their name will be added as a `sub_label`. This information is included in the UI, filters, as well as in notifications.
|
||||||
|
|
||||||
@@ -152,14 +151,6 @@ Follow these steps to begin:
|
|||||||
|
|
||||||
## Creating a Robust Training Set
|
## Creating a Robust Training Set
|
||||||
|
|
||||||
:::tip
|
|
||||||
|
|
||||||
**The short version:** Start with a few clear, front-facing photos of each person. As faces are detected in the Recent Recognitions tab, train clear images that scored lower, adding variety (different angles, lighting, and expressions) slowly. Diversity matters far more than volume, and low-quality images hurt recognition more than they help.
|
|
||||||
|
|
||||||
For a step-by-step narrative of these best practices (and the same principles applied to state and object classification), see the [Frigate Tips: Best Practices for Training](https://github.com/blakeblackshear/frigate/discussions/21374) discussion.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
The number of images needed for a sufficient training set for face recognition varies depending on several factors:
|
The number of images needed for a sufficient training set for face recognition varies depending on several factors:
|
||||||
|
|
||||||
- Diversity of the dataset: A dataset with diverse images, including variations in lighting, pose, and facial expressions, will require fewer images per person than a less diverse dataset.
|
- Diversity of the dataset: A dataset with diverse images, including variations in lighting, pose, and facial expressions, will require fewer images per person than a less diverse dataset.
|
||||||
@@ -190,27 +181,9 @@ When choosing images to include in the face training set it is recommended to al
|
|||||||
|
|
||||||
The Recent Recognitions tab in the face library displays recent face recognition attempts. Detected face images are grouped according to the person they were identified as potentially matching.
|
The Recent Recognitions tab in the face library displays recent face recognition attempts. Detected face images are grouped according to the person they were identified as potentially matching.
|
||||||
|
|
||||||
Each face image is labeled with a name (or `Unknown`) along with the confidence score of that recognition attempt. Images are grouped by the person they were matched against, not by who they actually are, so a group labeled with a person's name can contain a crop that is really someone else but happened to score as a partial match. The name and score shown on each individual crop describe that single attempt.
|
Each face image is labeled with a name (or `Unknown`) along with the confidence score of the recognition attempt. While each image can be used to train the system for a specific person, not all images are suitable for training.
|
||||||
|
|
||||||
While each image can be used to train the system for a specific person, not all images are suitable for training. Refer to the guidelines below for best practices on selecting images for training.
|
Refer to the guidelines below for best practices on selecting images for training.
|
||||||
|
|
||||||
### How Frigate Decides Who a Person Is
|
|
||||||
|
|
||||||
Recognition does not happen one frame at a time. While a `person` is in view, Frigate runs face recognition on many frames, not just a single frame. The final `sub_label` is decided from all of those attempts together, weighted by the area of each face (larger, closer faces count more), not from any single frame.
|
|
||||||
|
|
||||||
This has a few practical consequences:
|
|
||||||
|
|
||||||
- A handful of wrong guesses on blurry or distant frames usually do not change the result. If Frigate sees a person as "Tom, Tom, Sam, Tom, Tom," it will still conclude the person was Tom.
|
|
||||||
- The goal is not for every individual face crop to be correct. The goal is for each person to be recognized correctly overall, across all the faces captured while they were present.
|
|
||||||
- A single very high confidence match will not by itself assign a sub label. Recognition must be consistent. See [I see scores above the threshold in the Recent Recognitions tab, but a sub label wasn't assigned?](#i-see-scores-above-the-threshold-in-the-recent-recognitions-tab-but-a-sub-label-wasnt-assigned) below.
|
|
||||||
|
|
||||||
### Which Faces Are Worth Training?
|
|
||||||
|
|
||||||
Whether a face is worth training has little to do with what it was recognized as. A crop is a good training candidate when all of these are true:
|
|
||||||
|
|
||||||
- It did not already score high and correctly. Faces that are already recognized confidently add little and increase the risk of over-fitting.
|
|
||||||
- It is clear enough to be useful: not blurry, not heavily off-axis, not infrared (gray-scale). If it is hard for you to make out the face, it will not help the model.
|
|
||||||
- It adds something new: a different angle, lighting, expression, or distance than what you already have.
|
|
||||||
|
|
||||||
### Step 1 - Building a Strong Foundation
|
### Step 1 - Building a Strong Foundation
|
||||||
|
|
||||||
@@ -226,27 +199,11 @@ Once front-facing images are performing well, start choosing slightly off-angle
|
|||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
### Getting Recognition Working
|
### How do I debug Face Recognition issues?
|
||||||
|
|
||||||
<FaqItem id="how-do-i-debug-face-recognition-issues" question="How do I debug Face Recognition issues?">
|
|
||||||
|
|
||||||
Start with the [Usage](#usage) section and re-read the [Model Requirements](#model-requirements) above.
|
Start with the [Usage](#usage) section and re-read the [Model Requirements](#model-requirements) above.
|
||||||
|
|
||||||
1. Enable debug logs to see exactly what Frigate is doing.
|
1. Ensure `person` is being _detected_. A `person` will automatically be scanned by Frigate for a face. Any detected faces will appear in the Recent Recognitions tab in the Frigate UI's Face Library.
|
||||||
- Enable debug logs for face recognition by adding `frigate.data_processing.real_time.face: debug` to your `logger` configuration. Restart Frigate after this change.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
logger:
|
|
||||||
default: info
|
|
||||||
logs:
|
|
||||||
# highlight-next-line
|
|
||||||
frigate.data_processing.real_time.face: debug
|
|
||||||
```
|
|
||||||
|
|
||||||
- These logs report where the pipeline stopped for each `person` object, such as no face being found within the person's bounding box, the detected face being smaller than `min_area`, or a face being recognized but scoring too low.
|
|
||||||
- If you see no face-related messages at all, also add `frigate.embeddings.maintainer: debug` to confirm that the face processor was created at startup and that `person` updates are reaching it.
|
|
||||||
|
|
||||||
2. Ensure `person` is being _detected_. A `person` will automatically be scanned by Frigate for a face. Any detected faces will appear in the Recent Recognitions tab in the Frigate UI's Face Library.
|
|
||||||
|
|
||||||
If you are using a Frigate+ or `face` detecting model:
|
If you are using a Frigate+ or `face` detecting model:
|
||||||
- Watch the [debug view](/usage/live#the-single-camera-view) to ensure that `face` is being detected along with `person`.
|
- Watch the [debug view](/usage/live#the-single-camera-view) to ensure that `face` is being detected along with `person`.
|
||||||
@@ -256,51 +213,25 @@ Start with the [Usage](#usage) section and re-read the [Model Requirements](#mod
|
|||||||
- Check your `detect` stream resolution and ensure it is sufficiently high enough to capture face details on `person` objects.
|
- Check your `detect` stream resolution and ensure it is sufficiently high enough to capture face details on `person` objects.
|
||||||
- You may need to lower your `detection_threshold` if faces are not being detected.
|
- You may need to lower your `detection_threshold` if faces are not being detected.
|
||||||
|
|
||||||
3. Any detected faces will then be _recognized_.
|
2. Any detected faces will then be _recognized_.
|
||||||
- Make sure you have trained at least one face per the recommendations above.
|
- Make sure you have trained at least one face per the recommendations above.
|
||||||
- Adjust `recognition_threshold` settings per the suggestions [above](#advanced-configuration).
|
- Adjust `recognition_threshold` settings per the suggestions [above](#advanced-configuration).
|
||||||
|
|
||||||
</FaqItem>
|
### Detection does not work well with blurry images?
|
||||||
|
|
||||||
<FaqItem id="does-face-recognition-run-on-the-recording-stream" question="Does face recognition run on the recording stream?">
|
Accuracy is definitely a going to be improved with higher quality cameras / streams. It is important to look at the DORI (Detection Observation Recognition Identification) range of your camera, if that specification is posted. This specification explains the distance from the camera that a person can be detected, observed, recognized, and identified. The identification range is the most relevant here, and the distance listed by the camera is the furthest that face recognition will realistically work.
|
||||||
|
|
||||||
Face recognition does not run on the recording stream, this would be suboptimal for many reasons:
|
|
||||||
|
|
||||||
1. The latency of accessing the recordings means the notifications would not include the names of recognized people because recognition would not complete until after.
|
|
||||||
2. The embedding models used run on a set image size, so larger images will be scaled down to match this anyway.
|
|
||||||
3. Motion clarity is much more important than extra pixels, over-compression and motion blur are much more detrimental to results than resolution.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
### Improving Accuracy and Training
|
|
||||||
|
|
||||||
<FaqItem id="detection-does-not-work-well-with-blurry-images" question="Detection does not work well with blurry images?">
|
|
||||||
|
|
||||||
Accuracy is definitely going to be improved with higher quality cameras / streams. It is important to look at the DORI (Detection Observation Recognition Identification) range of your camera, if that specification is posted. This specification explains the distance from the camera that a person can be detected, observed, recognized, and identified. The identification range is the most relevant here, and the distance listed by the camera is the furthest that face recognition will realistically work.
|
|
||||||
|
|
||||||
Some users have also noted that setting the stream in camera firmware to a constant bit rate (CBR) leads to better image clarity than with a variable bit rate (VBR).
|
Some users have also noted that setting the stream in camera firmware to a constant bit rate (CBR) leads to better image clarity than with a variable bit rate (VBR).
|
||||||
|
|
||||||
</FaqItem>
|
### Why can't I bulk upload photos?
|
||||||
|
|
||||||
<FaqItem id="can-i-train-faces-for-people-who-only-appear-at-night" question="Can I train faces for people who only appear at night?">
|
|
||||||
|
|
||||||
The embedding models are trained on color images, so gray-scale and infrared (IR) faces sit in a different feature distribution and are more easily confused with other people. Prefer color images, and avoid mixing gray-scale samples in early while you are building a foundation. If someone only ever appears at night, gray-scale training is acceptable, but keep those samples limited and as clear as possible, and add them only once color recognition is stable for your other people.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="why-cant-i-bulk-upload-photos" question="Why can't I bulk upload photos?">
|
|
||||||
|
|
||||||
It is important to methodically add photos to the library, bulk importing photos (especially from a general photo library) will lead to over-fitting in that particular scenario and hurt recognition performance.
|
It is important to methodically add photos to the library, bulk importing photos (especially from a general photo library) will lead to over-fitting in that particular scenario and hurt recognition performance.
|
||||||
|
|
||||||
</FaqItem>
|
### Why can't I bulk reprocess faces?
|
||||||
|
|
||||||
<FaqItem id="why-cant-i-bulk-reprocess-faces" question="Why can't I bulk reprocess faces?">
|
|
||||||
|
|
||||||
Face embedding models work by breaking apart faces into different features. This means that when reprocessing an image, only images from a similar angle will have its score affected.
|
Face embedding models work by breaking apart faces into different features. This means that when reprocessing an image, only images from a similar angle will have its score affected.
|
||||||
|
|
||||||
</FaqItem>
|
### Why do unknown people score similarly to known people?
|
||||||
|
|
||||||
<FaqItem id="why-do-unknown-people-score-similarly-to-known-people" question="Why do unknown people score similarly to known people?">
|
|
||||||
|
|
||||||
This can happen for a few different reasons, but this is usually an indicator that the training set needs to be improved. This is often related to over-fitting:
|
This can happen for a few different reasons, but this is usually an indicator that the training set needs to be improved. This is often related to over-fitting:
|
||||||
|
|
||||||
@@ -312,52 +243,31 @@ Review your face collections and remove most of the unclear or low-quality image
|
|||||||
|
|
||||||
Avoid training on images that already score highly, as this can lead to over-fitting. Instead, focus on relatively clear images that score lower (ideally with different lighting, angles, and conditions) to help the model generalize more effectively.
|
Avoid training on images that already score highly, as this can lead to over-fitting. Instead, focus on relatively clear images that score lower (ideally with different lighting, angles, and conditions) to help the model generalize more effectively.
|
||||||
|
|
||||||
</FaqItem>
|
### Frigate misidentified a face. Can I tell it that a face is "not" a specific person?
|
||||||
|
|
||||||
<FaqItem id="should-i-correct-a-face-that-was-recognized-as-the-wrong-person" question="Should I correct a face that was recognized as the wrong person?">
|
|
||||||
|
|
||||||
Only if it is a good image. Reassigning a face does add it to that person's training set, but two things are true at once:
|
|
||||||
|
|
||||||
- Reassigning a single misclassified frame has a small effect. The image is weighted against every other sample for that person, so correcting 1 frame out of 20 will not move recognition much. Occasional wrong guesses on poor frames are normal and do not need to be fixed.
|
|
||||||
- Reassigning a poor image (blurry, off-angle, low-resolution, gray-scale) can hurt more than the misidentification did, because low-quality samples degrade recognition for that whole person.
|
|
||||||
|
|
||||||
So the decision is about image quality, not about the wrong label. If the crop is clear, well-lit, and reasonably front-facing, and it scored low or was wrong, assigning it to the correct person is useful. If you can barely make out the face yourself, ignore it; do not train it just to correct the label.
|
|
||||||
|
|
||||||
If a person is repeatedly misidentified, do not keep reassigning the same frame. Instead, remove low-quality or misleading images and add a few high-quality samples to the correct person. See [Why do unknown people score similarly to known people?](#why-do-unknown-people-score-similarly-to-known-people) above.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="frigate-misidentified-a-face-can-i-tell-it-that-a-face-is-not-a-specific-person" question={'Frigate misidentified a face. Can I tell it that a face is "not" a specific person?'}>
|
|
||||||
|
|
||||||
No, face recognition does not support negative training (i.e., explicitly telling it who someone is _not_). Instead, the best approach is to improve the training data by using a more diverse and representative set of images for each person.
|
No, face recognition does not support negative training (i.e., explicitly telling it who someone is _not_). Instead, the best approach is to improve the training data by using a more diverse and representative set of images for each person.
|
||||||
For more guidance, refer to the section above on improving recognition accuracy.
|
For more guidance, refer to the section above on improving recognition accuracy.
|
||||||
|
|
||||||
This also applies to a stranger who is repeatedly matched to a known person (for example, a delivery driver recognized as you). Do not create a profile for them and do not reassign their faces to yourself, as this pollutes your training set and makes recognition worse. Leave the detection as unknown and improve the known person's training set instead. Face recognition learns who someone is, not who they are not.
|
### I see scores above the threshold in the Recent Recognitions tab, but a sub label wasn't assigned?
|
||||||
|
|
||||||
</FaqItem>
|
The Frigate considers the recognition scores across all recognition attempts for each person object. The scores are continually weighted based on the area of the face, and a sub label will only be assigned to person if a person is confidently recognized consistently. This avoids cases where a single high confidence recognition would throw off the results.
|
||||||
|
|
||||||
<FaqItem id="i-see-scores-above-the-threshold-in-the-recent-recognitions-tab-but-a-sub-label-wasnt-assigned" question="I see scores above the threshold in the Recent Recognitions tab, but a sub label wasn't assigned?">
|
### Can I use other face recognition software like DoubleTake at the same time as the built in face recognition?
|
||||||
|
|
||||||
Frigate considers the recognition scores across all recognition attempts for each person object. The scores are continually weighted based on the area of the face, and a sub label will only be assigned to person if a person is confidently recognized consistently. This avoids cases where a single high confidence recognition would throw off the results.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
### Compatibility and Maintenance
|
|
||||||
|
|
||||||
<FaqItem id="can-i-use-other-face-recognition-software-like-doubletake-at-the-same-time-as-the-built-in-face-recognition" question="Can I use other face recognition software like DoubleTake at the same time as the built in face recognition?">
|
|
||||||
|
|
||||||
No, using another face recognition service will interfere with Frigate's built in face recognition. When using double-take the sub_label feature must be disabled if the built in face recognition is also desired.
|
No, using another face recognition service will interfere with Frigate's built in face recognition. When using double-take the sub_label feature must be disabled if the built in face recognition is also desired.
|
||||||
|
|
||||||
</FaqItem>
|
### Does face recognition run on the recording stream?
|
||||||
|
|
||||||
<FaqItem id="i-get-an-unknown-error-when-taking-a-photo-directly-with-my-iphone" question="I get an unknown error when taking a photo directly with my iPhone">
|
Face recognition does not run on the recording stream, this would be suboptimal for many reasons:
|
||||||
|
|
||||||
|
1. The latency of accessing the recordings means the notifications would not include the names of recognized people because recognition would not complete until after.
|
||||||
|
2. The embedding models used run on a set image size, so larger images will be scaled down to match this anyway.
|
||||||
|
3. Motion clarity is much more important than extra pixels, over-compression and motion blur are much more detrimental to results than resolution.
|
||||||
|
|
||||||
|
### I get an unknown error when taking a photo directly with my iPhone
|
||||||
|
|
||||||
By default iOS devices will use HEIC (High Efficiency Image Container) for images, but this format is not supported for uploads. Choosing `large` as the format instead of `original` will use JPG which will work correctly.
|
By default iOS devices will use HEIC (High Efficiency Image Container) for images, but this format is not supported for uploads. Choosing `large` as the format instead of `original` will use JPG which will work correctly.
|
||||||
|
|
||||||
</FaqItem>
|
### How can I delete the face database and start over?
|
||||||
|
|
||||||
<FaqItem id="how-can-i-delete-the-face-database-and-start-over" question="How can I delete the face database and start over?">
|
|
||||||
|
|
||||||
Frigate does not store anything in its database related to face recognition. You can simply delete all of your faces through the Frigate UI or remove the contents of the `/media/frigate/clips/faces` directory.
|
Frigate does not store anything in its database related to face recognition. You can simply delete all of your faces through the Frigate UI or remove the contents of the `/media/frigate/clips/faces` directory.
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|||||||
@@ -6,46 +6,12 @@ title: Configuring Generative AI
|
|||||||
import ConfigTabs from "@site/src/components/ConfigTabs";
|
import ConfigTabs from "@site/src/components/ConfigTabs";
|
||||||
import TabItem from "@theme/TabItem";
|
import TabItem from "@theme/TabItem";
|
||||||
import NavPath from "@site/src/components/NavPath";
|
import NavPath from "@site/src/components/NavPath";
|
||||||
import FaqItem from "@site/src/components/FaqItem";
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
A Generative AI provider can be configured in the global config, which will make the Generative AI features available for use. There are currently 5 native providers available to integrate with Frigate. Other providers that support the OpenAI standard API can also be used. See the OpenAI-Compatible section below.
|
A Generative AI provider can be configured in the global config, which will make the Generative AI features available for use. There are currently 4 native providers available to integrate with Frigate. Other providers that support the OpenAI standard API can also be used. See the OpenAI-Compatible section below.
|
||||||
|
|
||||||
`genai` is a map of named providers. Each key under `genai` is a name you choose, and its value is that provider's settings:
|
To use Generative AI, you must define a single provider at the global level of your Frigate configuration. If the provider you choose requires an API key, you may either directly paste it in your configuration, or store it in an environment variable prefixed with `FRIGATE_`.
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
1. Navigate to <NavPath path="Settings > Enrichments > Generative AI" />.
|
|
||||||
- Click **Add** and enter a **Provider name**. Any name of letters, numbers, hyphens, and underscores is accepted, but it cannot be changed from the UI after the provider is created.
|
|
||||||
- Set **Provider** to the service you are using (e.g., `ollama`)
|
|
||||||
- Set **Base URL**, **API key**, and **Model** as required by that provider
|
|
||||||
- Set **Roles** to the roles this provider should handle.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
genai:
|
|
||||||
my_provider: # any name you like
|
|
||||||
provider: ollama
|
|
||||||
base_url: http://localhost:11434
|
|
||||||
model: qwen3-vl:4b
|
|
||||||
roles:
|
|
||||||
- descriptions
|
|
||||||
- embeddings
|
|
||||||
- chat
|
|
||||||
```
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|
||||||
The examples on this page all use `my_provider`, but the name is arbitrary and is only used to reference the provider elsewhere in the config (for example, `semantic_search.model`).
|
|
||||||
|
|
||||||
Each provider handles one or more **roles**: `chat`, `descriptions`, and `embeddings`. A provider handles all three by default, and each role may be assigned to exactly one provider. Define a single provider if you want it to do everything, or split the roles across several providers using the `roles` option.
|
|
||||||
|
|
||||||
If the provider you choose requires an API key, you may either directly paste it in your configuration, or store it in an environment variable prefixed with `FRIGATE_`.
|
|
||||||
|
|
||||||
## Local Providers
|
## Local Providers
|
||||||
|
|
||||||
@@ -59,24 +25,15 @@ Running Generative AI models on CPU is not recommended, as high inference times
|
|||||||
|
|
||||||
### Recommended Local Models
|
### Recommended Local Models
|
||||||
|
|
||||||
#### Vision models
|
You must use a vision-capable model with Frigate. The following models are recommended for local deployment:
|
||||||
|
|
||||||
You must use a vision-capable model with Frigate. The following models are recommended for local deployment of the `descriptions` and `chat` roles:
|
|
||||||
|
|
||||||
| Model | Notes |
|
| Model | Notes |
|
||||||
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `qwen3-vl` | Strong visual and situational understanding, enhanced ability to identify smaller objects and interactions with object. |
|
| `qwen3-vl` | Strong visual and situational understanding, enhanced ability to identify smaller objects and interactions with object. |
|
||||||
| `qwen3.6`/`qwen3.8` | Strong situational understanding, but missing DeepStack from qwen3-vl leading to worse performance for identifying objects in people's hand and other small details. |
|
| `qwen3.5` | Strong situational understanding, but missing DeepStack from qwen3-vl leading to worse performance for identifying objects in people's hand and other small details. |
|
||||||
|
| `qwen3.6` | Strong situational understanding, similar to qwen3-vl |
|
||||||
| `gemma4` | Strong situational understanding, sometimes resorts to more vague terms like 'interacts' instead of assigning a specific action. |
|
| `gemma4` | Strong situational understanding, sometimes resorts to more vague terms like 'interacts' instead of assigning a specific action. |
|
||||||
|
|
||||||
#### Embedding models
|
|
||||||
|
|
||||||
The `embeddings` role needs a different kind of model. Text queries are matched against the stored image embeddings, so the model must be trained to place images and text into the same vector space. A chat or description model will still return vectors when asked, but those vectors are not trained for retrieval and text searches will return poor matches with no error to indicate why.
|
|
||||||
|
|
||||||
| Model | Notes |
|
|
||||||
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `qwen3-vl-embedding` | Multimodal embeddings for [Semantic Search](/configuration/semantic_search#genai-provider). Must be served by llama.cpp started with `--embeddings` and `--mmproj`. |
|
|
||||||
|
|
||||||
:::info
|
:::info
|
||||||
|
|
||||||
Each model is available in multiple parameter sizes (3b, 4b, 8b, etc.). Larger sizes are more capable of complex tasks and understanding of situations, but requires more memory and computational resources. It is recommended to try multiple models and experiment to see which performs best.
|
Each model is available in multiple parameter sizes (3b, 4b, 8b, etc.). Larger sizes are more capable of complex tasks and understanding of situations, but requires more memory and computational resources. It is recommended to try multiple models and experiment to see which performs best.
|
||||||
@@ -121,26 +78,23 @@ All llama.cpp native options can be passed through `provider_options`, including
|
|||||||
- Set **Provider** to `llamacpp`
|
- Set **Provider** to `llamacpp`
|
||||||
- Set **Base URL** to your llama.cpp server address (e.g., `http://localhost:8080`)
|
- Set **Base URL** to your llama.cpp server address (e.g., `http://localhost:8080`)
|
||||||
- Set **Model** to the name of your model
|
- Set **Model** to the name of your model
|
||||||
- Optionally, under **Provider Options**, set `context_size` to override the context size Frigate detects from the server
|
- Under **Provider Options**, set `context_size` to tell Frigate your context size so it can send the appropriate amount of information
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem value="yaml">
|
<TabItem value="yaml">
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: llamacpp
|
provider: llamacpp
|
||||||
base_url: http://localhost:8080
|
base_url: http://localhost:8080
|
||||||
model: your-model-name
|
model: your-model-name
|
||||||
provider_options:
|
provider_options:
|
||||||
context_size: 16000 # Optional, overrides the context size reported by the server.
|
context_size: 16000 # Tell Frigate your context size so it can send the appropriate amount of information.
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</ConfigTabs>
|
</ConfigTabs>
|
||||||
|
|
||||||
Frigate queries the llama.cpp server for the model's context size at startup and logs it along with the other detected capabilities. If `context_size` is set in `provider_options`, that value is always used instead, even when the server reports its own.
|
|
||||||
|
|
||||||
### Ollama
|
### Ollama
|
||||||
|
|
||||||
[Ollama](https://ollama.com/) allows you to self-host large language models and keep everything running locally. It is highly recommended to host this server on a machine with an Nvidia graphics card, or on a Apple silicon Mac for best performance.
|
[Ollama](https://ollama.com/) allows you to self-host large language models and keep everything running locally. It is highly recommended to host this server on a machine with an Nvidia graphics card, or on a Apple silicon Mac for best performance.
|
||||||
@@ -173,7 +127,6 @@ Note that Frigate will not automatically download the model you specify in your
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: ollama
|
provider: ollama
|
||||||
base_url: http://localhost:11434
|
base_url: http://localhost:11434
|
||||||
model: qwen3-vl:4b
|
model: qwen3-vl:4b
|
||||||
@@ -196,7 +149,6 @@ For OpenAI-compatible servers (such as llama.cpp) that don't expose the configur
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: openai
|
provider: openai
|
||||||
base_url: http://your-llama-server
|
base_url: http://your-llama-server
|
||||||
model: your-model-name
|
model: your-model-name
|
||||||
@@ -224,7 +176,6 @@ This ensures Frigate uses the correct context window size when generating prompt
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: openai
|
provider: openai
|
||||||
base_url: http://your-server:port
|
base_url: http://your-server:port
|
||||||
api_key: your-api-key # May not be required for local servers
|
api_key: your-api-key # May not be required for local servers
|
||||||
@@ -266,7 +217,6 @@ Ollama also supports [cloud models](https://ollama.com/cloud), where model infer
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: ollama
|
provider: ollama
|
||||||
base_url: http://localhost:11434
|
base_url: http://localhost:11434
|
||||||
model: cloud-model-name
|
model: cloud-model-name
|
||||||
@@ -276,7 +226,6 @@ or when using Ollama Cloud directly
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: ollama
|
provider: ollama
|
||||||
base_url: https://ollama.com
|
base_url: https://ollama.com
|
||||||
model: cloud-model-name
|
model: cloud-model-name
|
||||||
@@ -318,7 +267,6 @@ To start using Gemini, you must first get an API key from [Google AI Studio](htt
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: gemini
|
provider: gemini
|
||||||
api_key: "{FRIGATE_GEMINI_API_KEY}"
|
api_key: "{FRIGATE_GEMINI_API_KEY}"
|
||||||
model: gemini-2.5-flash
|
model: gemini-2.5-flash
|
||||||
@@ -331,9 +279,8 @@ genai:
|
|||||||
|
|
||||||
To use a different Gemini-compatible API endpoint, set the `provider_options` with the `base_url` key to your provider's API URL. For example:
|
To use a different Gemini-compatible API endpoint, set the `provider_options` with the `base_url` key to your provider's API URL. For example:
|
||||||
|
|
||||||
```yaml {5,6}
|
```yaml {4,5}
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: gemini
|
provider: gemini
|
||||||
...
|
...
|
||||||
provider_options:
|
provider_options:
|
||||||
@@ -371,7 +318,6 @@ To start using OpenAI, you must first [create an API key](https://platform.opena
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: openai
|
provider: openai
|
||||||
api_key: "{FRIGATE_OPENAI_API_KEY}"
|
api_key: "{FRIGATE_OPENAI_API_KEY}"
|
||||||
model: gpt-4o
|
model: gpt-4o
|
||||||
@@ -390,9 +336,8 @@ To use a different OpenAI-compatible API endpoint, set the `OPENAI_BASE_URL` env
|
|||||||
|
|
||||||
For OpenAI-compatible servers (such as llama.cpp) that don't expose the configured context size in the API response, you can manually specify the context size in `provider_options`:
|
For OpenAI-compatible servers (such as llama.cpp) that don't expose the configured context size in the API response, you can manually specify the context size in `provider_options`:
|
||||||
|
|
||||||
```yaml {6,7}
|
```yaml {5,6}
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: openai
|
provider: openai
|
||||||
base_url: http://your-llama-server
|
base_url: http://your-llama-server
|
||||||
model: your-model-name
|
model: your-model-name
|
||||||
@@ -432,7 +377,6 @@ To start using Azure OpenAI, you must first [create a resource](https://learn.mi
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: azure_openai
|
provider: azure_openai
|
||||||
base_url: https://instance.cognitiveservices.azure.com/openai/responses?api-version=2025-04-01-preview
|
base_url: https://instance.cognitiveservices.azure.com/openai/responses?api-version=2025-04-01-preview
|
||||||
model: gpt-5-mini
|
model: gpt-5-mini
|
||||||
@@ -441,82 +385,3 @@ genai:
|
|||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</ConfigTabs>
|
</ConfigTabs>
|
||||||
|
|
||||||
## FAQ
|
|
||||||
|
|
||||||
<FaqItem id="how-do-i-debug-genai-issues" question="How do I debug GenAI issues?">
|
|
||||||
|
|
||||||
Frigate's Generative AI features are configured and enabled separately. [Review descriptions and summaries](/configuration/genai/genai_review) live under `review.genai`, and [object descriptions](/configuration/genai/genai_objects) live under `objects.genai`. Configuring a provider on this page does not enable either feature, and enabling one does not enable the other. Decide which of the two is not working, then work through the steps below.
|
|
||||||
|
|
||||||
1. Confirm a provider is available and holds the `descriptions` role.
|
|
||||||
- Review descriptions, review summaries, and object descriptions all use the provider that has the `descriptions` role assigned in <NavPath path="Settings > Enrichments > Generative AI > Roles" /> (`genai.<provider>.roles`).
|
|
||||||
- A provider is contacted the first time one of its roles is actually used. A provider holding the `embeddings` role for semantic search is initialized during startup, while a `descriptions` provider is not initialized until the first description is requested, which may be well after boot.
|
|
||||||
- In <NavPath path="Settings > Enrichments > Generative AI" />, use **Refresh models** next to the model field. It queries the provider for its model list and is a quick way to verify that the base URL, API key, and network path between Frigate and your provider are correct.
|
|
||||||
|
|
||||||
2. Confirm the feature you expect is actually enabled.
|
|
||||||
- Object descriptions are disabled by default. Turn on <NavPath path="Settings > Global configuration > Objects > GenAI object config > Enable GenAI" /> (`objects.genai.enabled`), either globally or per camera. This is the most common reason custom prompts appear to be ignored while review summaries are still being generated.
|
|
||||||
- Review descriptions are disabled by default. Turn on <NavPath path="Settings > Global configuration > Review > GenAI config > Enable GenAI descriptions" /> (`review.genai.enabled`). Once enabled, alerts are described by default but detections are not, so a detection-only review item will never get a summary unless **Enable GenAI for detections** (`review.genai.detections`) is also on.
|
|
||||||
|
|
||||||
3. If object descriptions are never requested, check the filters that skip generation.
|
|
||||||
- <NavPath path="Settings > Global configuration > Objects > GenAI object config > GenAI objects" /> (`objects.genai.objects`) limits generation to specific labels, and **Required zones** (`objects.genai.required_zones`) requires the object to have entered one of those zones. If either is set and does not match, Frigate skips the request silently.
|
|
||||||
- Thumbnails are only collected while an object is moving. Objects that go stationary early contribute fewer frames.
|
|
||||||
- **Use snapshots** (`objects.genai.use_snapshot`) requires snapshots to be enabled for the camera. If the snapshot cannot be read, Frigate logs `Cannot load snapshot for <id>, file not found` and no description is generated.
|
|
||||||
- **Send on end** (`objects.genai.send_triggers.tracked_object_end`) is on by default. If you have turned it off in favor of **Early GenAI trigger** (`objects.genai.send_triggers.after_significant_updates`), descriptions are only requested once that number of updates is reached.
|
|
||||||
|
|
||||||
4. Enable debug logs to see exactly what Frigate is doing. Restart Frigate after this change. The next step also requires a restart, so turn both on at the same time to avoid restarting twice.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
logger:
|
|
||||||
default: info
|
|
||||||
logs:
|
|
||||||
# highlight-start
|
|
||||||
frigate.genai: debug
|
|
||||||
frigate.data_processing.post.object_descriptions: debug
|
|
||||||
frigate.data_processing.post.review_descriptions: debug
|
|
||||||
# highlight-end
|
|
||||||
```
|
|
||||||
|
|
||||||
5. Save the exact images and prompts that were sent to your provider.
|
|
||||||
- Turn on **Save thumbnails** for the feature you are debugging (`review.genai.debug_save_thumbnails` or `objects.genai.debug_save_thumbnails`). Both features write to `/media/frigate/clips/genai-requests/`, and these files are admin-only.
|
|
||||||
- Review descriptions write `genai-requests/<review_id>/` containing the numbered frames that were sent, plus `prompt.txt` and `response.txt` with the exact prompt and the raw, unparsed model response.
|
|
||||||
- Review summary reports write `genai-requests/<start_ts>-<end_ts>/prompt.txt` and `response.txt`. No images are involved, since a report summarizes existing review descriptions.
|
|
||||||
- Object descriptions write `genai-requests/<event_id>/` containing the numbered thumbnails. The prompt for object descriptions is not written to a file, it is only visible in the debug logs from step 4.
|
|
||||||
- Look at the saved images before blaming the model. If the object is small, blurry, or out of frame, no prompt will fix the result. For object descriptions, consider turning on **Use snapshots** (`objects.genai.use_snapshot`) to send a higher quality image. For review items, consider setting **Review image source** (`review.genai.image_source`) to `recordings` for 480p frames instead of the lower resolution preview frames.
|
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
For review descriptions, navigate to <NavPath path="Settings > Global configuration > Review" /> and set **GenAI config > Save thumbnails** to on.
|
|
||||||
|
|
||||||
For object descriptions, navigate to <NavPath path="Settings > Global configuration > Objects" />, expand **GenAI object config**, and set **Save thumbnails** to on.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
review:
|
|
||||||
genai:
|
|
||||||
enabled: true
|
|
||||||
# highlight-next-line
|
|
||||||
debug_save_thumbnails: true
|
|
||||||
|
|
||||||
objects:
|
|
||||||
genai:
|
|
||||||
enabled: true
|
|
||||||
# highlight-next-line
|
|
||||||
debug_save_thumbnails: true
|
|
||||||
```
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|
||||||
6. Verify the prompt is what you think it is.
|
|
||||||
- Object description prompts are the ones you control directly. A camera-level <NavPath path="Settings > Camera configuration > Objects > GenAI object config > Caption prompt" /> (`objects.genai.prompt`) overrides the global one, and an entry in **Object prompts** (`objects.genai.object_prompts`) for a label overrides both for that label. Only `{label}`, `{sub_label}`, and `{camera}` are substituted.
|
|
||||||
- Review description prompts are built by Frigate and request a structured JSON response, so they are not fully replaceable. The parts you control are <NavPath path="Settings > Global configuration > Review > GenAI config > Activity context prompt" /> (`review.genai.activity_context_prompt`) and **Additional concerns** (`review.genai.additional_concerns`). Keep the activity context prompt general, since overly specific rules will sway the model's threat level scoring.
|
|
||||||
|
|
||||||
7. If descriptions are generated but the results are poor or inconsistent, look at the model and the context window.
|
|
||||||
- Empty fields, missing `shortSummary` values, or `Failed to parse review description` errors usually mean the model is not following the requested JSON schema. Smaller models struggle with structured output. Try a larger parameter size or one of the [recommended models](#recommended-local-models).
|
|
||||||
- Frigate calculates how many frames to send from the context size the provider reports. If your server reports a different value than it is actually running with, frames will be truncated or the request will fail. Pin the value by adding `context_size` under <NavPath path="Settings > Enrichments > Generative AI > Provider options" /> (`genai.<provider>.provider_options`), and for Ollama also confirm `options.num_ctx` there matches the context you have configured.
|
|
||||||
- Check **Review Description Speed** and **Object Description Speed** in <NavPath path="System metrics > Enrichments" />. If inference takes tens of seconds, requests will queue behind each other and descriptions will appear to stop. For Ollama, review `OLLAMA_NUM_PARALLEL`, `OLLAMA_MAX_QUEUE`, and `OLLAMA_MAX_LOADED_MODELS` so that concurrent requests from Frigate are handled the way you expect.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ You can define custom prompts at the global level and per-object type. To config
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
genai:
|
genai:
|
||||||
my_provider:
|
|
||||||
provider: ollama
|
provider: ollama
|
||||||
base_url: http://localhost:11434
|
base_url: http://localhost:11434
|
||||||
model: qwen3-vl:8b-instruct
|
model: qwen3-vl:8b-instruct
|
||||||
@@ -113,7 +112,3 @@ Many providers also have a public facing chat interface for their models. Downlo
|
|||||||
- OpenAI - [ChatGPT](https://chatgpt.com)
|
- OpenAI - [ChatGPT](https://chatgpt.com)
|
||||||
- Gemini - [Google AI Studio](https://aistudio.google.com)
|
- Gemini - [Google AI Studio](https://aistudio.google.com)
|
||||||
- Ollama - [Open WebUI](https://docs.openwebui.com/)
|
- Ollama - [Open WebUI](https://docs.openwebui.com/)
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
If descriptions are not being generated, or the generated descriptions are not what you expect, see [How do I debug GenAI issues?](/configuration/genai/genai_config#how-do-i-debug-genai-issues).
|
|
||||||
|
|||||||
@@ -201,7 +201,3 @@ Along with individual review item summaries, Generative AI can also produce a si
|
|||||||
Review reports can be requested via the [API](/integrations/api/generate-review-summary-review-summarize-start-start-ts-end-end-ts-post) by sending a POST request to `/api/review/summarize/start/{start_ts}/end/{end_ts}` with Unix timestamps.
|
Review reports can be requested via the [API](/integrations/api/generate-review-summary-review-summarize-start-start-ts-end-end-ts-post) by sending a POST request to `/api/review/summarize/start/{start_ts}/end/{end_ts}` with Unix timestamps.
|
||||||
|
|
||||||
For Home Assistant users, there is a built-in service (`frigate.review_summarize`) that makes it easy to request review reports as part of automations or scripts. This allows you to automatically generate daily summaries, vacation reports, or custom time period reports based on your specific needs.
|
For Home Assistant users, there is a built-in service (`frigate.review_summarize`) that makes it easy to request review reports as part of automations or scripts. This allows you to automatically generate daily summaries, vacation reports, or custom time period reports based on your specific needs.
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
If summaries are not being generated, or the generated summaries are not what you expect, see [How do I debug GenAI issues?](/configuration/genai/genai_config#how-do-i-debug-genai-issues).
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Frigate uses the bundled go2rtc to power a number of key features:
|
|||||||
|
|
||||||
:::tip[Most users no longer need to configure go2rtc by hand]
|
:::tip[Most users no longer need to configure go2rtc by hand]
|
||||||
|
|
||||||
The [**camera setup wizard**](cameras.md#adding-a-camera-with-the-add-camera-wizard) is the recommended way to add cameras. Click **Add Camera** in <NavPath path="Settings > Global configuration > Camera management" />, and the wizard probes your camera and writes its configuration for you, including the go2rtc restream and the live stream mapping, so go2rtc is set up automatically.
|
The **camera setup wizard** is the recommended way to add cameras. Click **Add Camera** in <NavPath path="Settings > Global configuration > Camera management" />, and the wizard probes your camera and writes its configuration for you, including the go2rtc restream and the live stream mapping, so go2rtc is set up automatically.
|
||||||
|
|
||||||
This guide is mainly useful if you are **upgrading from an older version and have existing cameras that don't yet use go2rtc**, or if you want to fine-tune a stream by hand (for example, to transcode a codec your browser can't play). The [go2rtc troubleshooting guide](/troubleshooting/go2rtc) applies regardless of how your cameras were added.
|
This guide is mainly useful if you are **upgrading from an older version and have existing cameras that don't yet use go2rtc**, or if you want to fine-tune a stream by hand (for example, to transcode a codec your browser can't play). The [go2rtc troubleshooting guide](/troubleshooting/go2rtc) applies regardless of how your cameras were added.
|
||||||
|
|
||||||
@@ -67,6 +67,4 @@ If your stream won't play, has no audio, uses excessive CPU, or otherwise misbeh
|
|||||||
|
|
||||||
## Homekit Configuration
|
## Homekit Configuration
|
||||||
|
|
||||||
To export camera streams to HomeKit, Frigate must be configured in docker to use `host` networking mode. HomeKit settings are stored in `/config/go2rtc_homekit.yml` rather than in your Frigate config, and are edited through the go2rtc config editor at `http://<frigate_host>:1984/editor.html`. Pairings are saved back to that file automatically.
|
To add camera streams to Homekit Frigate must be configured in docker to use `host` networking mode. Once that is done, you can use the go2rtc WebUI (accessed via port 1984, which is disabled by default) to share export a camera to Homekit. Any changes made will automatically be saved to `/config/go2rtc_homekit.yml`.
|
||||||
|
|
||||||
See the [HomeKit integration docs](/integrations/homekit) for the full setup, including the video and audio requirements HomeKit places on the stream.
|
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ Error marking filters as finished
|
|||||||
Restarting ffmpeg...
|
Restarting ffmpeg...
|
||||||
```
|
```
|
||||||
|
|
||||||
you should try to upgrade to FFmpeg 7. This can be done using this config option:
|
you should try to uprade to FFmpeg 7. This can be done using this config option:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
ffmpeg:
|
ffmpeg:
|
||||||
@@ -498,7 +498,7 @@ cameras:
|
|||||||
|
|
||||||
## Synaptics
|
## Synaptics
|
||||||
|
|
||||||
Hardware accelerated video de-/encoding is supported on Synaptics SL-series SoC.
|
Hardware accelerated video de-/encoding is supported on Synpatics SL-series SoC.
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ title: License Plate Recognition (LPR)
|
|||||||
import ConfigTabs from "@site/src/components/ConfigTabs";
|
import ConfigTabs from "@site/src/components/ConfigTabs";
|
||||||
import TabItem from "@theme/TabItem";
|
import TabItem from "@theme/TabItem";
|
||||||
import NavPath from "@site/src/components/NavPath";
|
import NavPath from "@site/src/components/NavPath";
|
||||||
import FaqItem from "@site/src/components/FaqItem";
|
|
||||||
|
|
||||||
Frigate can recognize license plates on vehicles and automatically add the detected characters to the `recognized_license_plate` field or a [known](#matching) name as a `sub_label` to tracked objects of type `car`, `motorcycle`, `bus`, `truck`, `school_bus`, or `garbage_truck`, depending on which of those labels your model detects. A common use case may be to read the license plates of cars pulling into a driveway or cars passing by on a street.
|
Frigate can recognize license plates on vehicles and automatically add the detected characters to the `recognized_license_plate` field or a [known](#matching) name as a `sub_label` to tracked objects of type `car` or `motorcycle`. A common use case may be to read the license plates of cars pulling into a driveway or cars passing by on a street.
|
||||||
|
|
||||||
LPR works best when the license plate is clearly visible to the camera. For moving vehicles, Frigate continuously refines the recognition process, keeping the most confident result. When a vehicle becomes stationary, LPR continues to run for a short time after to attempt recognition.
|
LPR works best when the license plate is clearly visible to the camera. For moving vehicles, Frigate continuously refines the recognition process, keeping the most confident result. When a vehicle becomes stationary, LPR continues to run for a short time after to attempt recognition.
|
||||||
|
|
||||||
@@ -24,7 +23,7 @@ When a plate is recognized, the details are:
|
|||||||
- Viewable in the Details pane in Review/History.
|
- Viewable in the Details pane in Review/History.
|
||||||
- Viewable in the Tracked Object Details pane in Explore (sub labels and recognized license plates).
|
- Viewable in the Tracked Object Details pane in Explore (sub labels and recognized license plates).
|
||||||
- Filterable through the More Filters menu in Explore.
|
- Filterable through the More Filters menu in Explore.
|
||||||
- Published via the `frigate/events` MQTT topic as a `sub_label` ([known](#matching)) or `recognized_license_plate` (unknown) for the vehicle tracked object.
|
- Published via the `frigate/events` MQTT topic as a `sub_label` ([known](#matching)) or `recognized_license_plate` (unknown) for the `car` or `motorcycle` tracked object.
|
||||||
- Published via the `frigate/tracked_object_update` MQTT topic with `name` (if [known](#matching)) and `plate`.
|
- Published via the `frigate/tracked_object_update` MQTT topic with `name` (if [known](#matching)) and `plate`.
|
||||||
|
|
||||||
## Model Requirements
|
## Model Requirements
|
||||||
@@ -35,7 +34,7 @@ Users without a model that detects license plates can still run LPR. Frigate use
|
|||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
In the default mode, Frigate's LPR needs to first detect a vehicle before it can recognize a license plate. If you're using a dedicated LPR camera and have a zoomed-in view where a vehicle will not be detected, you can still run LPR, but the configuration parameters will differ from the default mode. See the [Dedicated LPR Cameras](#dedicated-lpr-cameras) section below.
|
In the default mode, Frigate's LPR needs to first detect a `car` or `motorcycle` before it can recognize a license plate. If you're using a dedicated LPR camera and have a zoomed-in view where a `car` or `motorcycle` will not be detected, you can still run LPR, but the configuration parameters will differ from the default mode. See the [Dedicated LPR Cameras](#dedicated-lpr-cameras) section below.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -86,7 +85,7 @@ cameras:
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</ConfigTabs>
|
</ConfigTabs>
|
||||||
|
|
||||||
For non-dedicated LPR cameras, ensure that your camera is configured to detect vehicle objects, and that a vehicle is actually being detected by Frigate. Otherwise, LPR will not run. The object types that can carry a plate are defined by your model's `attributes_map`, so if your model detects other vehicle labels, you can add them there.
|
For non-dedicated LPR cameras, ensure that your camera is configured to detect objects of type `car` or `motorcycle`, and that a car or motorcycle is actually being detected by Frigate. Otherwise, LPR will not run.
|
||||||
|
|
||||||
Like the other real-time processors in Frigate, license plate recognition runs on the camera stream defined by the `detect` role in your config. To ensure optimal performance, select a suitable resolution for this stream in your camera's firmware that fits your specific scene and requirements.
|
Like the other real-time processors in Frigate, license plate recognition runs on the camera stream defined by the `detect` role in your config. To ensure optimal performance, select a suitable resolution for this stream in your camera's firmware that fits your specific scene and requirements.
|
||||||
|
|
||||||
@@ -158,7 +157,7 @@ lpr:
|
|||||||
|
|
||||||
Navigate to <NavPath path="Settings > Enrichments > License plate recognition" />.
|
Navigate to <NavPath path="Settings > Enrichments > License plate recognition" />.
|
||||||
|
|
||||||
- **Known plates**: Assign custom `sub_label` values to vehicle objects when a recognized plate matches a known value. These labels appear in the UI, filters, and notifications. Unknown plates are still saved but are added to the `recognized_license_plate` field rather than the `sub_label`.
|
- **Known plates**: Assign custom `sub_label` values to `car` and `motorcycle` objects when a recognized plate matches a known value. These labels appear in the UI, filters, and notifications. Unknown plates are still saved but are added to the `recognized_license_plate` field rather than the `sub_label`.
|
||||||
- **Match distance**: Allows for minor variations (missing/incorrect characters) when matching a detected plate to a known plate. For example, setting to `1` allows a plate `ABCDE` to match `ABCBE` or `ABCD`. This parameter will _not_ operate on known plates that are defined as regular expressions.
|
- **Match distance**: Allows for minor variations (missing/incorrect characters) when matching a detected plate to a known plate. For example, setting to `1` allows a plate `ABCDE` to match `ABCBE` or `ABCD`. This parameter will _not_ operate on known plates that are defined as regular expressions.
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -316,7 +315,7 @@ lpr:
|
|||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
If a camera is configured to detect vehicles but you don't want Frigate to run LPR for that camera, disable LPR at the camera level:
|
If a camera is configured to detect `car` or `motorcycle` but you don't want Frigate to run LPR for that camera, disable LPR at the camera level:
|
||||||
|
|
||||||
<ConfigTabs>
|
<ConfigTabs>
|
||||||
<TabItem value="ui">
|
<TabItem value="ui">
|
||||||
@@ -379,9 +378,9 @@ Navigate to <NavPath path="Settings > Camera configuration > Object detection" /
|
|||||||
Navigate to <NavPath path="Settings > Camera configuration > Objects" />.
|
Navigate to <NavPath path="Settings > Camera configuration > Objects" />.
|
||||||
|
|
||||||
| Field | Description |
|
| Field | Description |
|
||||||
| --------------------------------------------------------- | ------------------- |
|
| ---------------------------------------------- | ------------------- |
|
||||||
| **Objects to track** | Add `license_plate` |
|
| **Objects to track** | Add `license_plate` |
|
||||||
| **Object filters > License Plate > Confidence threshold** | Set to `0.7` |
|
| **Object filters > License Plate > Threshold** | Set to `0.7` |
|
||||||
|
|
||||||
Navigate to <NavPath path="Settings > Camera configuration > Motion detection" />.
|
Navigate to <NavPath path="Settings > Camera configuration > Motion detection" />.
|
||||||
|
|
||||||
@@ -456,7 +455,7 @@ With this setup:
|
|||||||
- Snapshots will have license plate bounding boxes on them.
|
- Snapshots will have license plate bounding boxes on them.
|
||||||
- The `frigate/events` MQTT topic will publish tracked object updates.
|
- The `frigate/events` MQTT topic will publish tracked object updates.
|
||||||
- Debug view will display `license_plate` bounding boxes.
|
- Debug view will display `license_plate` bounding boxes.
|
||||||
- If you are using a Frigate+ model and want to submit images from your dedicated LPR camera for model training and fine-tuning, annotate both the vehicle and the `license_plate` in the snapshots on the Frigate+ website, even if the vehicle is barely visible.
|
- If you are using a Frigate+ model and want to submit images from your dedicated LPR camera for model training and fine-tuning, annotate both the `car` / `motorcycle` and the `license_plate` in the snapshots on the Frigate+ website, even if the car is barely visible.
|
||||||
|
|
||||||
### Using the Secondary LPR Pipeline (Without Frigate+)
|
### Using the Secondary LPR Pipeline (Without Frigate+)
|
||||||
|
|
||||||
@@ -592,9 +591,7 @@ By selecting the appropriate configuration, users can optimize their dedicated L
|
|||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
### Detection and Recognition
|
### Why isn't my license plate being detected and recognized?
|
||||||
|
|
||||||
<FaqItem id="why-isnt-my-license-plate-being-detected-and-recognized" question="Why isn't my license plate being detected and recognized?">
|
|
||||||
|
|
||||||
Ensure that:
|
Ensure that:
|
||||||
|
|
||||||
@@ -609,43 +606,29 @@ Recognized plates will show as object labels in the debug view and will appear i
|
|||||||
|
|
||||||
If you are still having issues detecting plates, start with a basic configuration and see the debugging tips below.
|
If you are still having issues detecting plates, start with a basic configuration and see the debugging tips below.
|
||||||
|
|
||||||
</FaqItem>
|
### Can I run LPR without detecting `car` or `motorcycle` objects?
|
||||||
|
|
||||||
<FaqItem id="can-i-run-lpr-without-detecting-car-or-motorcycle-objects" question={<>Can I run LPR without detecting vehicle objects?</>}>
|
In normal LPR mode, Frigate requires a `car` or `motorcycle` to be detected first before recognizing a license plate. If you have a dedicated LPR camera, you can change the camera `type` to `"lpr"` to use the Dedicated LPR Camera algorithm. This comes with important caveats, though. See the [Dedicated LPR Cameras](#dedicated-lpr-cameras) section above.
|
||||||
|
|
||||||
In normal LPR mode, Frigate requires a vehicle to be detected first before recognizing a license plate. If you have a dedicated LPR camera, you can change the camera `type` to `"lpr"` to use the Dedicated LPR Camera algorithm. This comes with important caveats, though. See the [Dedicated LPR Cameras](#dedicated-lpr-cameras) section above.
|
### How can I improve detection accuracy?
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="how-can-i-improve-detection-accuracy" question="How can I improve detection accuracy?">
|
|
||||||
|
|
||||||
- Use high-quality cameras with good resolution.
|
- Use high-quality cameras with good resolution.
|
||||||
- Adjust `detection_threshold` and `recognition_threshold` values.
|
- Adjust `detection_threshold` and `recognition_threshold` values.
|
||||||
- Define a `format` regex to filter out invalid detections.
|
- Define a `format` regex to filter out invalid detections.
|
||||||
|
|
||||||
</FaqItem>
|
### Does LPR work at night?
|
||||||
|
|
||||||
<FaqItem id="does-lpr-work-at-night" question="Does LPR work at night?">
|
|
||||||
|
|
||||||
Yes, but performance depends on camera quality, lighting, and infrared capabilities. Make sure your camera can capture clear images of plates at night.
|
Yes, but performance depends on camera quality, lighting, and infrared capabilities. Make sure your camera can capture clear images of plates at night.
|
||||||
|
|
||||||
</FaqItem>
|
### Can I limit LPR to specific zones?
|
||||||
|
|
||||||
<FaqItem id="can-i-limit-lpr-to-specific-zones" question="Can I limit LPR to specific zones?">
|
|
||||||
|
|
||||||
LPR, like other Frigate enrichments, runs at the camera level rather than the zone level. While you can't restrict LPR to specific zones directly, you can control when recognition runs by setting a `min_area` value to filter out smaller detections.
|
LPR, like other Frigate enrichments, runs at the camera level rather than the zone level. While you can't restrict LPR to specific zones directly, you can control when recognition runs by setting a `min_area` value to filter out smaller detections.
|
||||||
|
|
||||||
</FaqItem>
|
### How can I match known plates with minor variations?
|
||||||
|
|
||||||
<FaqItem id="how-can-i-match-known-plates-with-minor-variations" question="How can I match known plates with minor variations?">
|
|
||||||
|
|
||||||
Use `match_distance` to allow small character mismatches. Alternatively, define multiple variations in `known_plates`.
|
Use `match_distance` to allow small character mismatches. Alternatively, define multiple variations in `known_plates`.
|
||||||
|
|
||||||
</FaqItem>
|
### How do I debug LPR issues?
|
||||||
|
|
||||||
### Performance and Troubleshooting
|
|
||||||
|
|
||||||
<FaqItem id="how-do-i-debug-lpr-issues" question="How do I debug LPR issues?">
|
|
||||||
|
|
||||||
Start with ["Why isn't my license plate being detected and recognized?"](#why-isnt-my-license-plate-being-detected-and-recognized). If you are still having issues, work through these steps.
|
Start with ["Why isn't my license plate being detected and recognized?"](#why-isnt-my-license-plate-being-detected-and-recognized). If you are still having issues, work through these steps.
|
||||||
|
|
||||||
@@ -699,37 +682,27 @@ lpr:
|
|||||||
4. Ensure the characters on detected plates are being _recognized_.
|
4. Ensure the characters on detected plates are being _recognized_.
|
||||||
- Check the **Plate recognition** inference time in Enrichment metrics (<NavPath path="System metrics > Enrichments" />). High inference times (> 100ms) could lead to poor recognition results, especially for dedicated LPR cameras where the plate crosses the frame quickly.
|
- Check the **Plate recognition** inference time in Enrichment metrics (<NavPath path="System metrics > Enrichments" />). High inference times (> 100ms) could lead to poor recognition results, especially for dedicated LPR cameras where the plate crosses the frame quickly.
|
||||||
- Enable `debug_save_plates` to save images of detected text on plates to the clips directory (`/media/frigate/clips/lpr`). Ensure these images are readable and the text is clear.
|
- Enable `debug_save_plates` to save images of detected text on plates to the clips directory (`/media/frigate/clips/lpr`). Ensure these images are readable and the text is clear.
|
||||||
- Watch the debug view to see plates recognized in real-time. For non-dedicated LPR cameras, the vehicle's label will change to the recognized plate when LPR is enabled and working.
|
- Watch the debug view to see plates recognized in real-time. For non-dedicated LPR cameras, the `car` or `motorcycle` label will change to the recognized plate when LPR is enabled and working.
|
||||||
- Adjust `recognition_threshold` settings per the suggestions [above](#advanced-configuration).
|
- Adjust `recognition_threshold` settings per the suggestions [above](#advanced-configuration).
|
||||||
|
|
||||||
</FaqItem>
|
### Will LPR slow down my system?
|
||||||
|
|
||||||
<FaqItem id="will-lpr-slow-down-my-system" question="Will LPR slow down my system?">
|
|
||||||
|
|
||||||
LPR's performance impact depends on your hardware. Ensure you have at least 4GB RAM and a capable CPU or GPU for optimal results. If you are running the Dedicated LPR Camera mode, resource usage will be higher compared to users who run a model that natively detects license plates. Tune your motion detection settings for your dedicated LPR camera so that the license plate detection model runs only when necessary.
|
LPR's performance impact depends on your hardware. Ensure you have at least 4GB RAM and a capable CPU or GPU for optimal results. If you are running the Dedicated LPR Camera mode, resource usage will be higher compared to users who run a model that natively detects license plates. Tune your motion detection settings for your dedicated LPR camera so that the license plate detection model runs only when necessary.
|
||||||
|
|
||||||
</FaqItem>
|
### I am seeing a YOLOv9 plate detection metric in Enrichment Metrics, but I have a Frigate+ or custom model that detects `license_plate`. Why is the YOLOv9 model running?
|
||||||
|
|
||||||
<FaqItem id="i-am-seeing-a-yolov9-plate-detection-metric-in-enrichment-metrics-but-i-have-a-frigate-or-custom-model-that-detects-license_plate-why-is-the-yolov9-model-running" question={<>I am seeing a YOLOv9 plate detection metric in Enrichment Metrics, but I have a Frigate+ or custom model that detects <code>license_plate</code>. Why is the YOLOv9 model running?</>}>
|
|
||||||
|
|
||||||
The YOLOv9 license plate detector model will run (and the metric will appear) if you've enabled LPR but haven't defined `license_plate` as an object to track, either at the global or camera level.
|
The YOLOv9 license plate detector model will run (and the metric will appear) if you've enabled LPR but haven't defined `license_plate` as an object to track, either at the global or camera level.
|
||||||
|
|
||||||
If you are detecting vehicles on cameras where you don't want to run LPR, make sure you disable LPR it at the camera level. And if you do want to run LPR on those cameras, make sure you define `license_plate` as an object to track.
|
If you are detecting `car` or `motorcycle` on cameras where you don't want to run LPR, make sure you disable LPR it at the camera level. And if you do want to run LPR on those cameras, make sure you define `license_plate` as an object to track.
|
||||||
|
|
||||||
</FaqItem>
|
### It looks like Frigate picked up my camera's timestamp or overlay text as the license plate. How can I prevent this?
|
||||||
|
|
||||||
<FaqItem id="it-looks-like-frigate-picked-up-my-cameras-timestamp-or-overlay-text-as-the-license-plate-how-can-i-prevent-this" question="It looks like Frigate picked up my camera's timestamp or overlay text as the license plate. How can I prevent this?">
|
This could happen if cars or motorcycles travel close to your camera's timestamp or overlay text. You could either move the text through your camera's firmware, or apply a mask to it in Frigate.
|
||||||
|
|
||||||
This could happen if vehicles travel close to your camera's timestamp or overlay text. You could either move the text through your camera's firmware, or apply a mask to it in Frigate.
|
|
||||||
|
|
||||||
If you are using a model that natively detects `license_plate`, add an _object mask_ of type `license_plate` and a _motion mask_ over your text.
|
If you are using a model that natively detects `license_plate`, add an _object mask_ of type `license_plate` and a _motion mask_ over your text.
|
||||||
|
|
||||||
If you are not using a model that natively detects `license_plate` or you are using dedicated LPR camera mode, only a _motion mask_ over your text is required.
|
If you are not using a model that natively detects `license_plate` or you are using dedicated LPR camera mode, only a _motion mask_ over your text is required.
|
||||||
|
|
||||||
</FaqItem>
|
### I see "Error running ... model" in my logs, or my inference time is very high. How can I fix this?
|
||||||
|
|
||||||
<FaqItem id="i-see-error-running--model-in-my-logs-or-my-inference-time-is-very-high-how-can-i-fix-this" question={'I see "Error running ... model" in my logs, or my inference time is very high. How can I fix this?'}>
|
|
||||||
|
|
||||||
This usually happens when your GPU is unable to compile or use one of the LPR models. Set your `device` to `CPU` and try again. GPU acceleration only provides a slight performance increase, and the models are lightweight enough to run without issue on most CPUs.
|
This usually happens when your GPU is unable to compile or use one of the LPR models. Set your `device` to `CPU` and try again. GPU acceleration only provides a slight performance increase, and the models are lightweight enough to run without issue on most CPUs.
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ title: Live View
|
|||||||
import ConfigTabs from "@site/src/components/ConfigTabs";
|
import ConfigTabs from "@site/src/components/ConfigTabs";
|
||||||
import TabItem from "@theme/TabItem";
|
import TabItem from "@theme/TabItem";
|
||||||
import NavPath from "@site/src/components/NavPath";
|
import NavPath from "@site/src/components/NavPath";
|
||||||
import FaqItem from "@site/src/components/FaqItem";
|
|
||||||
|
|
||||||
Frigate intelligently displays your camera streams on the Live view dashboard. By default, Frigate employs "smart streaming" where camera images update once per minute when no detectable activity is occurring to conserve bandwidth and resources. As soon as any motion or active objects are detected, cameras seamlessly switch to a live stream.
|
Frigate intelligently displays your camera streams on the Live view dashboard. By default, Frigate employs "smart streaming" where camera images update once per minute when no detectable activity is occurring to conserve bandwidth and resources. As soon as any motion or active objects are detected, cameras seamlessly switch to a live stream.
|
||||||
|
|
||||||
@@ -34,7 +33,7 @@ If you are using go2rtc, you should adjust the following settings in your camera
|
|||||||
|
|
||||||
- Video codec: **H.264** - provides the most compatible video codec with all Live view technologies and browsers. Avoid any kind of "smart codec" or "+" codec like _H.264+_ or _H.265+_. as these non-standard codecs remove keyframes (see below).
|
- Video codec: **H.264** - provides the most compatible video codec with all Live view technologies and browsers. Avoid any kind of "smart codec" or "+" codec like _H.264+_ or _H.265+_. as these non-standard codecs remove keyframes (see below).
|
||||||
- Audio codec: **AAC** - provides the most compatible audio codec with all Live view technologies and browsers that support audio.
|
- Audio codec: **AAC** - provides the most compatible audio codec with all Live view technologies and browsers that support audio.
|
||||||
- I-frame interval (sometimes called the keyframe interval, the interframe space, or the GOP length): match your camera's frame rate, or choose "1x" (for interframe space on Reolink cameras). For example, if your stream outputs 20fps, your i-frame interval should be 20 (or 1x on Reolink). Values higher than the frame rate will cause the stream to take longer to begin playback. See [this page](https://web.archive.org/web/20251213190836/https://gardinal.net/understanding-the-keyframe-interval/) for more on keyframes. For many users this may not be an issue, but it should be noted that a 1x i-frame interval will cause more storage utilization if you are using the stream for the `record` role as well.
|
- I-frame interval (sometimes called the keyframe interval, the interframe space, or the GOP length): match your camera's frame rate, or choose "1x" (for interframe space on Reolink cameras). For example, if your stream outputs 20fps, your i-frame interval should be 20 (or 1x on Reolink). Values higher than the frame rate will cause the stream to take longer to begin playback. See [this page](https://gardinal.net/understanding-the-keyframe-interval/) for more on keyframes. For many users this may not be an issue, but it should be noted that a 1x i-frame interval will cause more storage utilization if you are using the stream for the `record` role as well.
|
||||||
|
|
||||||
The default video and audio codec on your camera may not always be compatible with your browser, which is why setting them to H.264 and AAC is recommended. See the [go2rtc docs](https://github.com/AlexxIT/go2rtc?tab=readme-ov-file#codecs-madness) for codec support information.
|
The default video and audio codec on your camera may not always be compatible with your browser, which is why setting them to H.264 and AAC is recommended. See the [go2rtc docs](https://github.com/AlexxIT/go2rtc?tab=readme-ov-file#codecs-madness) for codec support information.
|
||||||
|
|
||||||
@@ -196,7 +195,7 @@ services:
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
See [go2rtc WebRTC docs](https://github.com/AlexxIT/go2rtc/tree/v1.9.14#module-webrtc) for more information about this.
|
See [go2rtc WebRTC docs](https://github.com/AlexxIT/go2rtc/tree/v1.8.3#module-webrtc) for more information about this.
|
||||||
|
|
||||||
### Two way talk
|
### Two way talk
|
||||||
|
|
||||||
@@ -334,7 +333,7 @@ When your browser runs into problems playing back your camera streams, it will l
|
|||||||
|
|
||||||
- **stalled**
|
- **stalled**
|
||||||
- What it means: Playback has stalled because the player has fallen too far behind live (extended buffering or no data arriving).
|
- What it means: Playback has stalled because the player has fallen too far behind live (extended buffering or no data arriving).
|
||||||
- What to try: This is usually indicative of the browser struggling to decode too many high-resolution streams at once. Try selecting a lower-bandwidth stream (substream), reduce the number of live streams open, improve the network connection, or lower the camera resolution. Also check your camera's keyframe (I-frame) interval: shorter intervals make playback start and recover faster. You can also try increasing the timeout value in <NavPath path="Settings > UI" /> .
|
- What to try: This is usually indicative of the browser struggling to decode too many high-resolution streams at once. Try selecting a lower-bandwidth stream (substream), reduce the number of live streams open, improve the network connection, or lower the camera resolution. Also check your camera's keyframe (I-frame) interval: shorter intervals make playback start and recover faster. You can also try increasing the timeout value in the UI pane of Frigate's settings.
|
||||||
|
|
||||||
- Possible console messages from the player code:
|
- Possible console messages from the player code:
|
||||||
- `Buffer time (10 seconds) exceeded, browser may not be playing media correctly.`
|
- `Buffer time (10 seconds) exceeded, browser may not be playing media correctly.`
|
||||||
@@ -342,44 +341,48 @@ When your browser runs into problems playing back your camera streams, it will l
|
|||||||
|
|
||||||
## Live view FAQ
|
## Live view FAQ
|
||||||
|
|
||||||
### Getting Live View Working
|
1. **Why don't I have audio in my Live view?**
|
||||||
|
|
||||||
<FaqItem id="why-dont-i-have-audio-in-my-live-view" question="Why don't I have audio in my Live view?">
|
|
||||||
|
|
||||||
You must use go2rtc to hear audio in your live streams. If you have go2rtc already configured, you need to ensure your camera is sending PCMA/PCMU or AAC audio. If you can't change your camera's audio codec, you need to [transcode the audio](https://github.com/AlexxIT/go2rtc?tab=readme-ov-file#source-ffmpeg) using go2rtc.
|
You must use go2rtc to hear audio in your live streams. If you have go2rtc already configured, you need to ensure your camera is sending PCMA/PCMU or AAC audio. If you can't change your camera's audio codec, you need to [transcode the audio](https://github.com/AlexxIT/go2rtc?tab=readme-ov-file#source-ffmpeg) using go2rtc.
|
||||||
|
|
||||||
If the audio controls don't appear in the UI at all, verify that the Live view is actually using your go2rtc stream. If your go2rtc stream names don't match your Frigate camera name, you must map them with the `live -> streams` config (see [Setting Streams For Live UI](#setting-streams-for-live-ui) above); otherwise the UI falls back to the video-only jsmpeg player.
|
|
||||||
|
|
||||||
Note that the low bandwidth mode player is a video-only stream. You should not expect to hear audio when in low bandwidth mode, even if you've set up go2rtc.
|
Note that the low bandwidth mode player is a video-only stream. You should not expect to hear audio when in low bandwidth mode, even if you've set up go2rtc.
|
||||||
|
|
||||||
</FaqItem>
|
2. **Frigate shows that my live stream is in "low bandwidth mode". What does this mean?**
|
||||||
|
|
||||||
<FaqItem id="i-have-unmuted-some-cameras-on-my-dashboard-but-i-do-not-hear-sound-why" question="I have unmuted some cameras on my dashboard, but I do not hear sound. Why?">
|
Frigate intelligently selects the live streaming technology based on a number of factors (user-selected modes like two-way talk, camera settings, browser capabilities, available bandwidth) and prioritizes showing an actual up-to-date live view of your camera's stream as quickly as possible.
|
||||||
|
|
||||||
If your camera is streaming (as indicated by a red dot in the upper right, or if it has been set to continuous streaming mode), your browser may be blocking audio until you interact with the page. This is an intentional browser limitation. See [this article](https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide#autoplay_availability). Many browsers have a whitelist feature to change this behavior.
|
When you have go2rtc configured, Live view initially attempts to load and play back your stream with a clearer, fluent stream technology (MSE). An initial timeout, a low bandwidth condition that would cause buffering of the stream, or decoding errors in the stream will cause Frigate to switch to the stream defined by the `detect` role, using the jsmpeg format. This is what the UI labels as "low bandwidth mode". On Live dashboards, the mode will automatically reset when smart streaming is configured and activity stops. Continuous streaming mode does not have an automatic reset mechanism, but you can use the _Reset_ option to force a reload of your stream.
|
||||||
|
|
||||||
</FaqItem>
|
If you are using continuous streaming or you are loading more than a few high resolution streams at once on the dashboard, your browser may struggle to begin playback of your streams before the timeout. Frigate always prioritizes showing a live stream as quickly as possible, even if it is a lower quality jsmpeg stream. You can use the "Reset" link/button to try loading your high resolution stream again.
|
||||||
|
|
||||||
<FaqItem id="my-live-view-shows-a-black-screen-or-doesnt-load-but-the-debug-view-works-why" question="My live view shows a black screen or doesn't load, but the debug view works. Why?">
|
Errors in stream playback (e.g., connection failures, codec issues, or buffering timeouts) that cause the fallback to low bandwidth mode (jsmpeg) are logged to the browser console for easier debugging. These errors may include:
|
||||||
|
- Network issues (e.g., MSE or WebRTC network connection problems).
|
||||||
|
- Unsupported codecs or stream formats (e.g., H.265 in WebRTC, which is not supported in some browsers).
|
||||||
|
- Buffering timeouts or low bandwidth conditions causing fallback to jsmpeg.
|
||||||
|
- Browser compatibility problems (e.g., iOS Safari limitations with MSE).
|
||||||
|
|
||||||
The debug view plays the `detect` stream processed by Frigate itself, while the Live view plays your go2rtc stream directly in the browser. If the debug view works but the Live view doesn't, your browser usually can't decode what the camera is sending, most often H.265 video or an incompatible audio track.
|
To view browser console logs:
|
||||||
|
1. Open the Frigate Live View in your browser.
|
||||||
|
2. Open the browser's Developer Tools (F12 or right-click > Inspect > Console tab).
|
||||||
|
3. Reproduce the error (e.g., load a problematic stream or simulate network issues).
|
||||||
|
4. Look for messages prefixed with the camera name.
|
||||||
|
|
||||||
Work through the [go2rtc troubleshooting guide](/troubleshooting/go2rtc#live-view-is-black-buffering-or-stuck-in-low-bandwidth-mode) to isolate the problem. Two fixes resolve the majority of cases:
|
These logs help identify if the issue is player-specific (MSE vs. WebRTC) or related to camera configuration (e.g., go2rtc streams, codecs). If you see frequent errors:
|
||||||
|
- Verify your camera's H.264/AAC settings (see [Frigate's camera settings recommendations](#camera-settings-recommendations)).
|
||||||
|
- Check go2rtc configuration for transcoding (e.g., audio to AAC/OPUS).
|
||||||
|
- Test with a different stream via the UI dropdown (if `live -> streams` is configured).
|
||||||
|
- For WebRTC-specific issues, ensure port 8555 is forwarded and candidates are set (see [WebRTC Extra Configuration](#webrtc-extra-configuration)).
|
||||||
|
- If your cameras are streaming at a high resolution, your browser may be struggling to load all of the streams before the buffering timeout occurs. Frigate prioritizes showing a true live view as quickly as possible. If the fallback occurs often, change your live view settings to use a lower bandwidth substream.
|
||||||
|
|
||||||
1. Restream through go2rtc's FFmpeg module by prefixing your source with `ffmpeg:`, for example `- ffmpeg:rtsp://user:password@192.168.1.5:554/stream`.
|
3. **It doesn't seem like my cameras are streaming on the Live dashboard. Why?**
|
||||||
2. If that doesn't help, transcode to compatible codecs: `- ffmpeg:rtsp://user:password@192.168.1.5:554/stream#video=h264#audio=aac#hardware`.
|
|
||||||
|
|
||||||
</FaqItem>
|
On the default Live dashboard ("All Cameras"), your camera images will update once per minute when no detectable activity is occurring to conserve bandwidth and resources. As soon as any activity is detected, cameras seamlessly switch to a full-resolution live stream. If you want to customize this behavior, use a camera group.
|
||||||
|
|
||||||
<FaqItem id="how-do-i-get-the-best-live-view-experience-in-home-assistant" question="How do I get the best live view experience in Home Assistant?">
|
4. **I see a strange diagonal line on my live view, but my recordings look fine. How can I fix it?**
|
||||||
|
|
||||||
For a full-resolution, low-latency live view in Home Assistant dashboards, use the [Advanced Camera Card](https://card.camera) with the [go2rtc live provider](https://card.camera/#/configuration/cameras/live-provider?id=go2rtc), which streams directly from Frigate's bundled go2rtc. This also supports audio and [two-way talk](#two-way-talk) on capable cameras. See the [Home Assistant integration docs](/integrations/home-assistant) for setup.
|
This is caused by incorrect dimensions set in your detect width or height (or incorrectly auto-detected), causing the jsmpeg player's rendering engine to display a slightly distorted image. You should enlarge the width and height of your `detect` resolution up to a standard aspect ratio (example: 640x352 becomes 640x360, and 800x443 becomes 800x450, 2688x1520 becomes 2688x1512, etc). If changing the resolution to match a standard (4:3, 16:9, or 32:9, etc) aspect ratio does not solve the issue, you can enable "compatibility mode" in your camera group dashboard's stream settings. Depending on your browser and device, more than a few cameras in compatibility mode may not be supported, so only use this option if changing your `detect` width and height fails to resolve the color artifacts and diagonal line.
|
||||||
|
|
||||||
</FaqItem>
|
5. **How does "smart streaming" work?**
|
||||||
|
|
||||||
### Streaming Behavior
|
|
||||||
|
|
||||||
<FaqItem id="how-does-smart-streaming-work" question={'How does "smart streaming" work?'}>
|
|
||||||
|
|
||||||
Because a static image of a scene looks exactly the same as a live stream with no motion or activity, smart streaming updates your camera images once per minute when no detectable activity is occurring to conserve bandwidth and resources. As soon as any activity (motion or object/audio detection) occurs, cameras seamlessly switch to a live stream.
|
Because a static image of a scene looks exactly the same as a live stream with no motion or activity, smart streaming updates your camera images once per minute when no detectable activity is occurring to conserve bandwidth and resources. As soon as any activity (motion or object/audio detection) occurs, cameras seamlessly switch to a live stream.
|
||||||
|
|
||||||
@@ -389,82 +392,21 @@ Smart streaming depends on having your camera's motion `threshold` and `contour_
|
|||||||
|
|
||||||
This is Frigate's default and recommended setting because it results in a significant bandwidth savings, especially for high resolution cameras.
|
This is Frigate's default and recommended setting because it results in a significant bandwidth savings, especially for high resolution cameras.
|
||||||
|
|
||||||
</FaqItem>
|
6. **I have unmuted some cameras on my dashboard, but I do not hear sound. Why?**
|
||||||
|
|
||||||
<FaqItem id="it-doesnt-seem-like-my-cameras-are-streaming-on-the-live-dashboard-why" question="It doesn't seem like my cameras are streaming on the Live dashboard. Why?">
|
If your camera is streaming (as indicated by a red dot in the upper right, or if it has been set to continuous streaming mode), your browser may be blocking audio until you interact with the page. This is an intentional browser limitation. See [this article](https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide#autoplay_availability). Many browsers have a whitelist feature to change this behavior.
|
||||||
|
|
||||||
On the default Live dashboard ("All Cameras"), your camera images will update once per minute when no detectable activity is occurring to conserve bandwidth and resources. As soon as any activity is detected, cameras seamlessly switch to a full-resolution live stream. If you want to customize this behavior, use a camera group.
|
7. **My camera streams have lots of visual artifacts / distortion.**
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="frigate-shows-that-my-live-stream-is-in-low-bandwidth-mode-what-does-this-mean" question={'Frigate shows that my live stream is in "low bandwidth mode". What does this mean?'}>
|
|
||||||
|
|
||||||
Frigate intelligently selects the live streaming technology based on a number of factors (user-selected modes like two-way talk, camera settings, browser capabilities, available bandwidth) and prioritizes showing an actual up-to-date live view of your camera's stream as quickly as possible.
|
|
||||||
|
|
||||||
When you have go2rtc configured, Live view initially attempts to load and play back your stream with a clearer, fluent stream technology (MSE). An initial timeout, a low bandwidth condition that would cause buffering of the stream, or decoding errors in the stream will cause Frigate to switch to the stream defined by the `detect` role, using the jsmpeg format. This is what the UI labels as "low bandwidth mode". On Live dashboards, the mode will automatically reset when smart streaming is configured and activity stops. Continuous streaming mode does not have an automatic reset mechanism, but you can use the _Reset_ option to force a reload of your stream.
|
|
||||||
|
|
||||||
If you are using continuous streaming or you are loading more than a few high resolution streams at once on the dashboard, your browser may struggle to begin playback of your streams before the timeout. Frigate always prioritizes showing a live stream as quickly as possible, even if it is a lower quality jsmpeg stream. You can use the "Reset" link/button to try loading your high resolution stream again.
|
|
||||||
|
|
||||||
Errors in stream playback (e.g., connection failures, codec issues, or buffering timeouts) that cause the fallback to low bandwidth mode (jsmpeg) are logged to the browser console for easier debugging. These errors may include:
|
|
||||||
|
|
||||||
- Network issues (e.g., MSE or WebRTC network connection problems).
|
|
||||||
- Unsupported codecs or stream formats (e.g., H.265 in WebRTC, which is not supported in some browsers).
|
|
||||||
- Buffering timeouts or low bandwidth conditions causing fallback to jsmpeg.
|
|
||||||
- Browser compatibility problems (e.g., iOS Safari limitations with MSE).
|
|
||||||
|
|
||||||
To view browser console logs:
|
|
||||||
|
|
||||||
1. Open the Frigate Live View in your browser.
|
|
||||||
2. Open the browser's Developer Tools (F12 or right-click > Inspect > Console tab).
|
|
||||||
3. Reproduce the error (e.g., load a problematic stream or simulate network issues).
|
|
||||||
4. Look for messages prefixed with the camera name.
|
|
||||||
|
|
||||||
These logs help identify if the issue is player-specific (MSE vs. WebRTC) or related to camera configuration (e.g., go2rtc streams, codecs). If you see frequent errors:
|
|
||||||
|
|
||||||
- Verify your camera's H.264/AAC settings (see [Frigate's camera settings recommendations](#camera-settings-recommendations)).
|
|
||||||
- Check go2rtc configuration for transcoding (e.g., audio to AAC/OPUS).
|
|
||||||
- Test with a different stream via the UI dropdown (if `live -> streams` is configured).
|
|
||||||
- For WebRTC-specific issues, ensure port 8555 is forwarded and candidates are set (see [WebRTC Extra Configuration](#webrtc-extra-configuration)).
|
|
||||||
- If your cameras are streaming at a high resolution, your browser may be struggling to load all of the streams before the buffering timeout occurs. Frigate prioritizes showing a true live view as quickly as possible. If the fallback occurs often, change your live view settings to use a lower bandwidth substream.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="why-is-my-live-view-delayed-or-lagging-behind-real-time" question="Why is my live view delayed or lagging behind real time?">
|
|
||||||
|
|
||||||
A delay when a stream first starts is usually caused by your camera's I-frame (keyframe) interval. Playback cannot begin until a keyframe arrives, so an interval set higher than your camera's frame rate makes the stream take longer to start. Set the I-frame interval to match the frame rate (or "1x" on Reolink) per the [camera settings recommendations](#camera-settings-recommendations).
|
|
||||||
|
|
||||||
A stream that starts on time but falls further behind live is buffering, which is usually the browser struggling to decode too many high-resolution streams at once. Select a lower-bandwidth substream for your dashboards (see [Setting Streams For Live UI](#setting-streams-for-live-ui)), reduce the number of streams open at once, or improve the network connection between your browser and Frigate. Frigate's player automatically speeds up playback to catch up to live after buffering, and falls back to low bandwidth mode if it stalls for too long. The _Reset_ option forces a fresh connection at the live edge.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="why-does-frigate-prefer-mse-over-webrtc-for-live-view" question="Why does Frigate prefer MSE over WebRTC for live view?">
|
|
||||||
|
|
||||||
Frigate prefers MSE because it delivers a better out-of-the-box experience than WebRTC on nearly every axis that matters for a security camera system. MSE is an open standard optimized and supported by all modern browsers, works without any extra configuration (WebRTC requires port forwarding and candidate setup, and lacks H.265 support in some browsers), and requires no internet access for NAT traversal. More importantly, MSE runs over TCP, so every frame arrives and is decoded in order, so nothing is ever silently skipped. WebRTC optimizes for latency over UDP by discarding late or incomplete frames, which works against you on cellular or spotty Wi-Fi: you can end up with frozen video, visual corruption, or gaps in the feed without ever knowing you missed something. Frigate's enhanced MSE player has adaptive speed playback and has been tuned for latency and connection robustness that meets or exceeds WebRTC, so you get near-real-time playback with a guarantee that when the video plays, every frame is actually there - which, for an NVR whose whole purpose is letting you see what happened, matters more than shaving fractions of a second off a latency number. That's why Frigate defaults to MSE and reserves WebRTC for cases that require it, like two-way talk.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
### Video Quality Issues
|
|
||||||
|
|
||||||
<FaqItem id="i-see-a-strange-diagonal-line-on-my-live-view-but-my-recordings-look-fine-how-can-i-fix-it" question="I see a strange diagonal line on my live view, but my recordings look fine. How can I fix it?">
|
|
||||||
|
|
||||||
This is caused by incorrect dimensions set in your detect width or height (or incorrectly auto-detected), causing the jsmpeg player's rendering engine to display a slightly distorted image. You should enlarge the width and height of your `detect` resolution up to a standard aspect ratio (example: 640x352 becomes 640x360, and 800x443 becomes 800x450, 2688x1520 becomes 2688x1512, etc). If changing the resolution to match a standard (4:3, 16:9, or 32:9, etc) aspect ratio does not solve the issue, you can enable "compatibility mode" in your camera group dashboard's stream settings. Depending on your browser and device, more than a few cameras in compatibility mode may not be supported, so only use this option if changing your `detect` width and height fails to resolve the color artifacts and diagonal line.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="my-camera-streams-have-lots-of-visual-artifacts-or-distortion" question="My camera streams have lots of visual artifacts / distortion.">
|
|
||||||
|
|
||||||
Some cameras don't include the hardware to support multiple connections to the high resolution stream, and this can cause unexpected behavior. In this case it is recommended to [restream](./restream.md) the high resolution stream so that it can be used for live view and recordings.
|
Some cameras don't include the hardware to support multiple connections to the high resolution stream, and this can cause unexpected behavior. In this case it is recommended to [restream](./restream.md) the high resolution stream so that it can be used for live view and recordings.
|
||||||
|
|
||||||
</FaqItem>
|
8. **Why does my camera stream switch aspect ratios on the Live dashboard?**
|
||||||
|
|
||||||
<FaqItem id="why-does-my-camera-stream-switch-aspect-ratios-on-the-live-dashboard" question="Why does my camera stream switch aspect ratios on the Live dashboard?">
|
|
||||||
|
|
||||||
Your camera may change aspect ratios on the dashboard because Frigate uses different streams for different purposes. With go2rtc and Smart Streaming, Frigate shows a static image from the `detect` stream when no activity is present, and switches to the live stream when motion is detected. The camera image will change size if your streams use different aspect ratios.
|
Your camera may change aspect ratios on the dashboard because Frigate uses different streams for different purposes. With go2rtc and Smart Streaming, Frigate shows a static image from the `detect` stream when no activity is present, and switches to the live stream when motion is detected. The camera image will change size if your streams use different aspect ratios.
|
||||||
|
|
||||||
To prevent this, make the `detect` stream match the go2rtc live stream's aspect ratio (resolution does not need to match, just the aspect ratio). You can either adjust the camera's output resolution or set the `width` and `height` values in your config's `detect` section to a resolution with an aspect ratio that matches.
|
To prevent this, make the `detect` stream match the go2rtc live stream's aspect ratio (resolution does not need to match, just the aspect ratio). You can either adjust the camera's output resolution or set the `width` and `height` values in your config's `detect` section to a resolution with an aspect ratio that matches.
|
||||||
|
|
||||||
Example: Resolutions from two streams
|
Example: Resolutions from two streams
|
||||||
|
|
||||||
- Mismatched (may cause aspect ratio switching on the dashboard):
|
- Mismatched (may cause aspect ratio switching on the dashboard):
|
||||||
- Live/go2rtc stream: 1920x1080 (16:9)
|
- Live/go2rtc stream: 1920x1080 (16:9)
|
||||||
- Detect stream: 640x352 (~1.82:1, not 16:9)
|
- Detect stream: 640x352 (~1.82:1, not 16:9)
|
||||||
@@ -493,4 +435,6 @@ cameras:
|
|||||||
|
|
||||||
The same applies to your `record` stream: if its aspect ratio differs from your `detect` stream, your recordings will appear in a different shape than the live view. For consistent framing across live view and recordings, use the same aspect ratio for all of a camera's streams (the resolution can still differ).
|
The same applies to your `record` stream: if its aspect ratio differs from your `detect` stream, your recordings will appear in a different shape than the live view. For consistent framing across live view and recordings, use the same aspect ratio for all of a camera's streams (the resolution can still differ).
|
||||||
|
|
||||||
</FaqItem>
|
9. **Why does Frigate prefer MSE over WebRTC for live view?**
|
||||||
|
|
||||||
|
Frigate prefers MSE because it delivers a better out-of-the-box experience than WebRTC on nearly every axis that matters for a security camera system. MSE is an open standard optimized and supported by all modern browsers, works without any extra configuration (WebRTC requires port forwarding and candidate setup, and lacks H.265 support in some browsers), and requires no internet access for NAT traversal. More importantly, MSE runs over TCP, so every frame arrives and is decoded in order, so nothing is ever silently skipped. WebRTC optimizes for latency over UDP by discarding late or incomplete frames, which works against you on cellular or spotty Wi-Fi: you can end up with frozen video, visual corruption, or gaps in the feed without ever knowing you missed something. Frigate's enhanced MSE player has adaptive speed playback and has been tuned for latency and connection robustness that meets or exceeds WebRTC, so you get near-real-time playback with a guarantee that when the video plays, every frame is actually there - which, for an NVR whose whole purpose is letting you see what happened, matters more than shaving fractions of a second off a latency number. That's why Frigate defaults to MSE and reserves WebRTC for cases that require it, like two-way talk.
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ motion:
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</ConfigTabs>
|
</ConfigTabs>
|
||||||
|
|
||||||
Lower values mean motion detection is more sensitive to changes in color, making it more likely for example to detect motion when a brown dog blends in with a brown fence or a person wearing a red shirt blends in with a red car. If the threshold is too low however, it may detect things like grass blowing in the wind, shadows, etc. to be detected as motion.
|
Lower values mean motion detection is more sensitive to changes in color, making it more likely for example to detect motion when a brown dogs blends in with a brown fence or a person wearing a red shirt blends in with a red car. If the threshold is too low however, it may detect things like grass blowing in the wind, shadows, etc. to be detected as motion.
|
||||||
|
|
||||||
Watching the motion boxes in the debug view, increase the threshold until you only see motion that is visible to the eye. Once this is done, it is important to test and ensure that desired motion is still detected.
|
Watching the motion boxes in the debug view, increase the threshold until you only see motion that is visible to the eye. Once this is done, it is important to test and ensure that desired motion is still detected.
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ title: Notifications
|
|||||||
import ConfigTabs from "@site/src/components/ConfigTabs";
|
import ConfigTabs from "@site/src/components/ConfigTabs";
|
||||||
import TabItem from "@theme/TabItem";
|
import TabItem from "@theme/TabItem";
|
||||||
import NavPath from "@site/src/components/NavPath";
|
import NavPath from "@site/src/components/NavPath";
|
||||||
import FaqItem from "@site/src/components/FaqItem";
|
|
||||||
|
|
||||||
# Notifications
|
# Notifications
|
||||||
|
|
||||||
@@ -22,7 +21,7 @@ Push notifications require internet access from the Frigate server to the browse
|
|||||||
|
|
||||||
In order to use notifications the following requirements must be met:
|
In order to use notifications the following requirements must be met:
|
||||||
|
|
||||||
- Frigate must be accessed via a secure `https` connection while signed in as a Frigate user ([see the authorization docs](/configuration/authentication)).
|
- Frigate must be accessed via a secure `https` connection ([see the authorization docs](/configuration/authentication)).
|
||||||
- A supported browser must be used. Currently Chrome, Firefox, and Safari are known to be supported.
|
- A supported browser must be used. Currently Chrome, Firefox, and Safari are known to be supported.
|
||||||
- In order for notifications to be usable externally, Frigate must be accessible externally.
|
- In order for notifications to be usable externally, Frigate must be accessible externally.
|
||||||
- For iOS devices, some users have also indicated that the Notifications switch needs to be enabled in iOS Settings --> Apps --> Safari --> Advanced --> Features.
|
- For iOS devices, some users have also indicated that the Notifications switch needs to be enabled in iOS Settings --> Apps --> Safari --> Advanced --> Features.
|
||||||
@@ -86,13 +85,7 @@ cameras:
|
|||||||
|
|
||||||
### Registration
|
### Registration
|
||||||
|
|
||||||
Once notifications are enabled, press the `Register This Device` button on all devices that you would like to receive notifications on. This will register the background worker. After this Frigate must be restarted and then notifications will begin to be sent.
|
Once notifications are enabled, press the `Register for Notifications` button on all devices that you would like to receive notifications on. This will register the background worker. After this Frigate must be restarted and then notifications will begin to be sent.
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
Each registration is attached to the Frigate user account you are signed in as, so you must register over a secure connection to the authenticated port (`8971`). Reverse proxies and tunnels should point at port `8971`.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Supported Notifications
|
## Supported Notifications
|
||||||
|
|
||||||
@@ -111,62 +104,3 @@ Different platforms handle notifications differently, some settings changes may
|
|||||||
### Android
|
### Android
|
||||||
|
|
||||||
Most Android phones have battery optimization settings. To get reliable Notification delivery the browser (Chrome, Firefox) should have battery optimizations disabled. If Frigate is running as a PWA then the Frigate app should have battery optimizations disabled as well.
|
Most Android phones have battery optimization settings. To get reliable Notification delivery the browser (Chrome, Firefox) should have battery optimizations disabled. If Frigate is running as a PWA then the Frigate app should have battery optimizations disabled as well.
|
||||||
|
|
||||||
## Notifications FAQ
|
|
||||||
|
|
||||||
<FaqItem id="how-do-i-debug-notifications-issues" question="How do I debug notifications issues?">
|
|
||||||
|
|
||||||
Push notifications involve Frigate, your browser, and your browser vendor's push service, so it helps to work from the server outward.
|
|
||||||
|
|
||||||
1. Enable debug logs for the push client by adding `frigate.comms.webpush: debug` to your `logger` configuration. Restart Frigate after this change.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
logger:
|
|
||||||
default: info
|
|
||||||
logs:
|
|
||||||
# highlight-next-line
|
|
||||||
frigate.comms.webpush: debug
|
|
||||||
```
|
|
||||||
|
|
||||||
These logs show exactly where a notification stopped, including:
|
|
||||||
- `Email must be provided for push notifications to be sent` means the global `email` field is empty and nothing will ever be sent.
|
|
||||||
- `Sending test notification` and `Sending push notification for <camera>, review ID <id>` mean Frigate handed the message off to the push service.
|
|
||||||
- `Skipping notification for <camera> - in global cooldown period` (or `camera-specific cooldown period`) means your [cooldown](#configuration) values suppressed it.
|
|
||||||
- `Notifications for <camera> are currently suspended` means notifications were suspended from <NavPath path="Settings > Notifications" /> or MQTT.
|
|
||||||
- `Notification endpoint expired for <user>, received 410` means that device's subscription is no longer valid and it must be re-registered.
|
|
||||||
- `Failed to send notification to <user> :: <status>` means the push service rejected the message. A `401` or `403` usually points at a VAPID or `email` problem, and a `5xx` is a problem on the push service's end.
|
|
||||||
- If you see no messages at all when an alert occurs, the notification was never queued. Confirm an actual **alert** was created (notifications are not sent for detections), and that notifications are enabled both globally and for that camera.
|
|
||||||
|
|
||||||
2. Verify the basics that most reports come down to:
|
|
||||||
- Frigate must be reached over `https` with a certificate your device trusts. Browsers silently refuse to register a service worker otherwise, and a self-signed certificate that is not installed as trusted on the device will fail.
|
|
||||||
- On iOS, notifications only work when Frigate has been installed to the Home Screen via **Share > Add to Home Screen** and opened from that icon. Safari and Chrome tabs cannot receive web push on iOS.
|
|
||||||
- Each device must be registered individually, and Frigate must be restarted after registering before anything can be sent, including test notifications.
|
|
||||||
- The Frigate server needs outbound internet access to the browser vendor's push service. See [Network Requirements](/frigate/network_requirements#push-notifications).
|
|
||||||
|
|
||||||
3. Test from the UI. Use the `Send a test notification` button in <NavPath path="Settings > Notifications" />. If the log shows `Sending test notification` but nothing arrives on the device, the problem is between the push service and your device rather than in Frigate.
|
|
||||||
|
|
||||||
4. Check the browser side on the device that is not receiving notifications:
|
|
||||||
- Confirm the site's notification permission is set to **Allow** in your browser or OS settings, and that a focus/do not disturb mode is not hiding them.
|
|
||||||
- In desktop browsers, open Developer Tools > Application > Service Workers and confirm `notifications-worker.js` is registered and activated. Unregistering it and registering the device again will rebuild a broken subscription.
|
|
||||||
- Check the browser console and your reverse proxy logs for failures loading `/notifications-worker.js` or errors on `/api/notifications/register`.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="why-did-notifications-stop-arriving-after-working-for-a-while" question="Why did notifications stop arriving after working for a while?">
|
|
||||||
|
|
||||||
Push subscriptions are issued by the browser vendor and can be revoked, most often after a browser update, after clearing site data, or when a device has been offline for an extended period. When this happens the device still appears registered in Frigate, but the push service rejects the message. The debug logs will show `Notification endpoint expired` with a `404` or `410` status.
|
|
||||||
|
|
||||||
Unregister and re-register the affected device from <NavPath path="Settings > Notifications" />, then restart Frigate.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="why-am-i-not-getting-notifications-for-one-specific-camera" question="Why am I not getting notifications for one specific camera?">
|
|
||||||
|
|
||||||
Work through these in order:
|
|
||||||
|
|
||||||
- Notifications are only sent for **alerts**. If the camera is producing detections instead, adjust the camera's `review > alerts > labels` so the objects you care about are classified as alerts.
|
|
||||||
- Confirm notifications are enabled for that camera in <NavPath path="Settings > Camera configuration > Notifications" />.
|
|
||||||
- Check the camera's `cooldown` value, and remember that the global cooldown applies across all cameras. A busy camera can consume the global cooldown and suppress a quieter one.
|
|
||||||
- If [authentication](/configuration/authentication) is enabled with roles, users only receive notifications for the cameras their role grants access to.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|||||||
@@ -24,12 +24,12 @@ Frigate supports multiple different detectors that work on different types of ha
|
|||||||
- [Coral EdgeTPU](#edge-tpu-detector): The Google Coral EdgeTPU is available in USB, Mini PCIe, and m.2 formats allowing for a wide range of compatibility with devices.
|
- [Coral EdgeTPU](#edge-tpu-detector): The Google Coral EdgeTPU is available in USB, Mini PCIe, and m.2 formats allowing for a wide range of compatibility with devices.
|
||||||
- [Hailo](#hailo-8): The Hailo8 and Hailo8L AI Acceleration module is available in m.2 format with a HAT for RPi devices, offering a wide range of compatibility with devices.
|
- [Hailo](#hailo-8): The Hailo8 and Hailo8L AI Acceleration module is available in m.2 format with a HAT for RPi devices, offering a wide range of compatibility with devices.
|
||||||
- <CommunityBadge /> [MemryX](#memryx-mx3): The MX3 Acceleration module is available in m.2 format, offering broad compatibility across various platforms.
|
- <CommunityBadge /> [MemryX](#memryx-mx3): The MX3 Acceleration module is available in m.2 format, offering broad compatibility across various platforms.
|
||||||
|
- <CommunityBadge /> [DeGirum](#degirum): Service for using hardware devices in the cloud or locally. Hardware and models provided on the cloud on [their website](https://hub.degirum.com).
|
||||||
|
|
||||||
**AMD**
|
**AMD**
|
||||||
|
|
||||||
- [ROCm](#amdrocm-gpu-detector): ROCm can run on AMD Discrete GPUs to provide efficient object detection.
|
- [ROCm](#amdrocm-gpu-detector): ROCm can run on AMD Discrete GPUs to provide efficient object detection.
|
||||||
- [ONNX](#onnx): ROCm will automatically be detected and used as a detector in the `-rocm` Frigate image when a supported ONNX model is configured.
|
- [ONNX](#onnx): ROCm will automatically be detected and used as a detector in the `-rocm` Frigate image when a supported ONNX model is configured.
|
||||||
- <CommunityBadge /> [XDNA2](#amd-xdna2): AMD Ryzen AI / XDNA2 NPUs can run object detection through the community-maintained `frigate-xdna` ZMQ sidecar.
|
|
||||||
|
|
||||||
**Apple Silicon**
|
**Apple Silicon**
|
||||||
|
|
||||||
@@ -298,14 +298,6 @@ detectors:
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Intel NPU host requirements {#intel-npu-requirements}
|
|
||||||
|
|
||||||
The NPU firmware is loaded by the host kernel and is not part of the Frigate image. Everything else the NPU needs is bundled in the container, so host NPU libraries should never be mounted in.
|
|
||||||
|
|
||||||
Frigate bundles a specific version of Intel's [linux-npu-driver](https://github.com/intel/linux-npu-driver/releases), and the host firmware must come from that release or a newer one. Firmware older than the bundled driver may fail with `MAPPED_INFERENCE_VERSION is NOT compatible with the ELF`, where `Expected` is the version the firmware supports and `received` is the version the bundled compiler produced. Distributions often package older firmware than the driver Frigate ships, so check the build date on the host with `sudo dmesg | grep -i vpu` and update it there if needed.
|
|
||||||
|
|
||||||
Intel NPUs cannot be used under Home Assistant OS, which does not include the NPU firmware.
|
|
||||||
|
|
||||||
### Configuration {#configuration-openvino}
|
### Configuration {#configuration-openvino}
|
||||||
|
|
||||||
<ModelConfigDropdown detectorTitle="OpenVINO" models={objectDetectorsModels.openvino.models} />
|
<ModelConfigDropdown detectorTitle="OpenVINO" models={objectDetectorsModels.openvino.models} />
|
||||||
@@ -509,28 +501,6 @@ To verify that the integration is working correctly, start Frigate and observe t
|
|||||||
|
|
||||||
# Community Supported Detectors
|
# Community Supported Detectors
|
||||||
|
|
||||||
## AMD XDNA2
|
|
||||||
|
|
||||||
AMD Ryzen AI / XDNA2 NPUs can be used through the community-maintained
|
|
||||||
[frigate-xdna](https://github.com/mitchins/frigate-xdna) detector sidecar.
|
|
||||||
The sidecar runs separately from Frigate and connects using Frigate's ZMQ
|
|
||||||
detector interface.
|
|
||||||
|
|
||||||
Currently qualified on **Ryzen AI Max 300 / Strix Halo**. Other XDNA2 devices
|
|
||||||
are not yet qualified; XDNA1 is unsupported.
|
|
||||||
|
|
||||||
Follow the frigate-xdna setup instructions to prepare and start the sidecar
|
|
||||||
before starting Frigate.
|
|
||||||
|
|
||||||
### Configuration {#configuration-xdna2}
|
|
||||||
|
|
||||||
Using the detector config below will connect Frigate to the sidecar:
|
|
||||||
|
|
||||||
<ModelConfigDropdown detectorTitle="AMD XDNA2" models={objectDetectorsModels.xdna2.models} />
|
|
||||||
|
|
||||||
The example assumes Frigate and the sidecar share a Docker network where the
|
|
||||||
sidecar is named `xdna`.
|
|
||||||
|
|
||||||
## MemryX MX3
|
## MemryX MX3
|
||||||
|
|
||||||
This detector is available for use with the MemryX MX3 accelerator M.2 module. Frigate supports the MX3 on compatible hardware platforms, providing efficient and high-performance object detection.
|
This detector is available for use with the MemryX MX3 accelerator M.2 module. Frigate supports the MX3 on compatible hardware platforms, providing efficient and high-performance object detection.
|
||||||
@@ -755,7 +725,7 @@ The inference time was determined on a rk3588 with 3 NPU cores.
|
|||||||
|
|
||||||
To convert a onnx model to the rknn format using the [rknn-toolkit2](https://github.com/airockchip/rknn-toolkit2/) you have to:
|
To convert a onnx model to the rknn format using the [rknn-toolkit2](https://github.com/airockchip/rknn-toolkit2/) you have to:
|
||||||
|
|
||||||
- Place one or more models in onnx format in the directory `config/model_cache/rknn_cache/onnx` on your docker host (this might require `sudo` privileges).
|
- Place one ore more models in onnx format in the directory `config/model_cache/rknn_cache/onnx` on your docker host (this might require `sudo` privileges).
|
||||||
- Save the configuration file under `config/conv2rknn.yaml` (see below for details).
|
- Save the configuration file under `config/conv2rknn.yaml` (see below for details).
|
||||||
- Run `docker exec <frigate_container_id> python3 /opt/conv2rknn.py`. If the conversion was successful, the rknn models will be placed in `config/model_cache/rknn_cache`.
|
- Run `docker exec <frigate_container_id> python3 /opt/conv2rknn.py`. If the conversion was successful, the rknn models will be placed in `config/model_cache/rknn_cache`.
|
||||||
|
|
||||||
@@ -773,18 +743,99 @@ config:
|
|||||||
quant_img_RGB2BGR: true
|
quant_img_RGB2BGR: true
|
||||||
```
|
```
|
||||||
|
|
||||||
Explanation of the parameters:
|
Explanation of the paramters:
|
||||||
|
|
||||||
- `soc`: A list of all SoCs you want to build the rknn model for. If you don't specify this parameter, the script tries to find out your SoC and builds the rknn model for this one.
|
- `soc`: A list of all SoCs you want to build the rknn model for. If you don't specify this parameter, the script tries to find out your SoC and builds the rknn model for this one.
|
||||||
- `quantization`: true: 8 bit integer (i8) quantization, false: 16 bit float (fp16). Default: false.
|
- `quantization`: true: 8 bit integer (i8) quantization, false: 16 bit float (fp16). Default: false.
|
||||||
- `output_name`: The output name of the model. The following variables are available:
|
- `output_name`: The output name of the model. The following variables are available:
|
||||||
- `quant`: "i8" or "fp16" depending on the config
|
- `quant`: "i8" or "fp16" depending on the config
|
||||||
- `input_basename`: the basename of the input model (e.g. "my_model" if the input model is called "my_model.onnx")
|
- `input_basename`: the basename of the input model (e.g. "my_model" if the input model is calles "my_model.onnx")
|
||||||
- `soc`: the SoC this model was build for (e.g. "rk3588")
|
- `soc`: the SoC this model was build for (e.g. "rk3588")
|
||||||
- `tk_version`: Version of `rknn-toolkit2` (e.g. "2.3.0")
|
- `tk_version`: Version of `rknn-toolkit2` (e.g. "2.3.0")
|
||||||
- **example**: Specifying `output_name = "frigate-{quant}-{input_basename}-{soc}-v{tk_version}"` could result in a model called `frigate-i8-my_model-rk3588-v2.3.0.rknn`.
|
- **example**: Specifying `output_name = "frigate-{quant}-{input_basename}-{soc}-v{tk_version}"` could result in a model called `frigate-i8-my_model-rk3588-v2.3.0.rknn`.
|
||||||
- `config`: Configuration passed to `rknn-toolkit2` for model conversion. For an explanation of all available parameters have a look at section "2.2. Model configuration" of [this manual](https://github.com/MarcA711/rknn-toolkit2/releases/download/v2.3.2/03_Rockchip_RKNPU_API_Reference_RKNN_Toolkit2_V2.3.2_EN.pdf).
|
- `config`: Configuration passed to `rknn-toolkit2` for model conversion. For an explanation of all available parameters have a look at section "2.2. Model configuration" of [this manual](https://github.com/MarcA711/rknn-toolkit2/releases/download/v2.3.2/03_Rockchip_RKNPU_API_Reference_RKNN_Toolkit2_V2.3.2_EN.pdf).
|
||||||
|
|
||||||
|
## DeGirum
|
||||||
|
|
||||||
|
DeGirum is a detector that can use any type of hardware listed on [their website](https://hub.degirum.com). DeGirum can be used with local hardware through a DeGirum AI Server, or through the use of `@local`. You can also connect directly to DeGirum's AI Hub to run inferences. **Please Note:** This detector _cannot_ be used for commercial purposes.
|
||||||
|
|
||||||
|
### Configuration {#configuration-degirum}
|
||||||
|
|
||||||
|
#### AI Server Inference
|
||||||
|
|
||||||
|
Before starting with the config file for this section, you must first launch an AI server. DeGirum has an AI server ready to use as a docker container. Add this to your `docker-compose.yml` to get started:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
degirum_detector:
|
||||||
|
container_name: degirum
|
||||||
|
image: degirum/aiserver:latest
|
||||||
|
privileged: true
|
||||||
|
ports:
|
||||||
|
- "8778:8778"
|
||||||
|
```
|
||||||
|
|
||||||
|
All supported hardware will automatically be found on your AI server host as long as relevant runtimes and drivers are properly installed on your machine. Refer to [DeGirum's docs site](https://docs.degirum.com/pysdk/runtimes-and-drivers) if you have any trouble.
|
||||||
|
|
||||||
|
Once completed, configure the detector as follows:
|
||||||
|
|
||||||
|
<ModelConfigDropdown detectorTitle="DeGirum" models={objectDetectorsModels.degirumAiServer.models} />
|
||||||
|
|
||||||
|
Setting up a model in the `config.yml` is similar to setting up an AI server.
|
||||||
|
You can set it to:
|
||||||
|
|
||||||
|
- A model listed on the [AI Hub](https://hub.degirum.com), given that the correct zoo name is listed in your detector
|
||||||
|
- If this is what you choose to do, the correct model will be downloaded onto your machine before running.
|
||||||
|
- A local directory acting as a zoo. See DeGirum's docs site [for more information](https://docs.degirum.com/pysdk/user-guide-pysdk/organizing-models#model-zoo-directory-structure).
|
||||||
|
- A path to some model.json.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
model:
|
||||||
|
path: ./mobilenet_v2_ssd_coco--300x300_quant_n2x_orca1_1 # directory to model .json and file
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Local Inference
|
||||||
|
|
||||||
|
It is also possible to eliminate the need for an AI server and run the hardware directly. The benefit of this approach is that you eliminate any bottlenecks that occur when transferring prediction results from the AI server docker container to the frigate one. However, the method of implementing local inference is different for every device and hardware combination, so it's usually more trouble than it's worth. A general guideline to achieve this would be:
|
||||||
|
|
||||||
|
1. Ensuring that the frigate docker container has the runtime you want to use. So for instance, running `@local` for Hailo means making sure the container you're using has the Hailo runtime installed.
|
||||||
|
2. To double check the runtime is detected by the DeGirum detector, make sure the `degirum sys-info` command properly shows whatever runtimes you mean to install.
|
||||||
|
3. Create a DeGirum detector in your configuration.
|
||||||
|
|
||||||
|
<ModelConfigDropdown detectorTitle="DeGirum" models={objectDetectorsModels.degirumLocal.models} />
|
||||||
|
|
||||||
|
Once `degirum_detector` is setup, you can choose a model through 'model' section in the `config.yml` file.
|
||||||
|
|
||||||
|
```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
|
||||||
|
```
|
||||||
|
|
||||||
|
#### AI Hub Cloud Inference
|
||||||
|
|
||||||
|
If you do not possess whatever hardware you want to run, there's also the option to run cloud inferences. Do note that your detection fps might need to be lowered as network latency does significantly slow down this method of detection. For use with Frigate, we highly recommend using a local AI server as described above. To set up cloud inferences,
|
||||||
|
|
||||||
|
1. Sign up at [DeGirum's AI Hub](https://hub.degirum.com).
|
||||||
|
2. Get an access token.
|
||||||
|
3. Create a DeGirum detector in your configuration.
|
||||||
|
|
||||||
|
<ModelConfigDropdown detectorTitle="DeGirum" models={objectDetectorsModels.degirumCloud.models} />
|
||||||
|
|
||||||
|
Once `degirum_detector` is setup, you can choose a model through 'model' section in the `config.yml` file.
|
||||||
|
|
||||||
|
```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
|
||||||
|
```
|
||||||
|
|
||||||
## AXERA
|
## AXERA
|
||||||
|
|
||||||
Hardware accelerated object detection is supported on the following SoCs:
|
Hardware accelerated object detection is supported on the following SoCs:
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ Any detection below `min_score` will be immediately thrown out and never tracked
|
|||||||
|
|
||||||
### Threshold
|
### Threshold
|
||||||
|
|
||||||
`threshold` is used to determine that the object is a true positive. Once an object is detected with a score >= `threshold` object is considered a true positive. If `threshold` is too low then some higher scoring false positives may create a tracked object. If `threshold` is too high then true positive tracked objects may be missed due to the object never scoring high enough.
|
`threshold` is used to determine that the object is a true positive. Once an object is detected with a score >= `threshold` object is considered a true positive. If `threshold` is too low then some higher scoring false positives may create an tracked object. If `threshold` is too high then true positive tracked objects may be missed due to the object never scoring high enough.
|
||||||
|
|
||||||
## Configuring Object Scores
|
## Configuring Object Scores
|
||||||
|
|
||||||
@@ -46,9 +46,9 @@ Any detection below `min_score` will be immediately thrown out and never tracked
|
|||||||
Navigate to <NavPath path="Settings > Global configuration > Objects" /> to set score filters globally.
|
Navigate to <NavPath path="Settings > Global configuration > Objects" /> to set score filters globally.
|
||||||
|
|
||||||
| Field | Description |
|
| Field | Description |
|
||||||
| -------------------------------------------------- | ---------------------------------------------------------------- |
|
| --------------------------------------- | ---------------------------------------------------------------- |
|
||||||
| **Object filters > Person > Minimum confidence** | Minimum score for a single detection to initiate tracking |
|
| **Object filters > Person > Min Score** | Minimum score for a single detection to initiate tracking |
|
||||||
| **Object filters > Person > Confidence threshold** | Minimum computed (median) score to be considered a true positive |
|
| **Object filters > Person > Threshold** | Minimum computed (median) score to be considered a true positive |
|
||||||
|
|
||||||
To override score filters for a specific camera, navigate to <NavPath path="Settings > Camera configuration > Objects" /> and select the camera.
|
To override score filters for a specific camera, navigate to <NavPath path="Settings > Camera configuration > Objects" /> and select the camera.
|
||||||
|
|
||||||
@@ -104,11 +104,11 @@ Conceptually, a ratio of 1 is a square, 0.5 is a "tall skinny" box, and 2 is a "
|
|||||||
Navigate to <NavPath path="Settings > Global configuration > Objects" /> to set shape filters globally.
|
Navigate to <NavPath path="Settings > Global configuration > Objects" /> to set shape filters globally.
|
||||||
|
|
||||||
| Field | Description |
|
| Field | Description |
|
||||||
| -------------------------------------------------- | ------------------------------------------------------------------------ |
|
| --------------------------------------- | ------------------------------------------------------------------------ |
|
||||||
| **Object filters > Person > Minimum object area** | Minimum bounding box area in pixels (or decimal for percentage of frame) |
|
| **Object filters > Person > Min Area** | Minimum bounding box area in pixels (or decimal for percentage of frame) |
|
||||||
| **Object filters > Person > Maximum object area** | Maximum bounding box area in pixels (or decimal for percentage of frame) |
|
| **Object filters > Person > Max Area** | Maximum bounding box area in pixels (or decimal for percentage of frame) |
|
||||||
| **Object filters > Person > Minimum aspect ratio** | Minimum width/height ratio of the bounding box |
|
| **Object filters > Person > Min Ratio** | Minimum width/height ratio of the bounding box |
|
||||||
| **Object filters > Person > Maximum aspect ratio** | Maximum width/height ratio of the bounding box |
|
| **Object filters > Person > Max Ratio** | Maximum width/height ratio of the bounding box |
|
||||||
|
|
||||||
To override shape filters for a specific camera, navigate to <NavPath path="Settings > Camera configuration > Objects" /> and select the camera.
|
To override shape filters for a specific camera, navigate to <NavPath path="Settings > Camera configuration > Objects" /> and select the camera.
|
||||||
|
|
||||||
|
|||||||
@@ -71,13 +71,13 @@ Object filters help reduce false positives by constraining the size, shape, and
|
|||||||
Navigate to <NavPath path="Settings > Global configuration > Objects" />.
|
Navigate to <NavPath path="Settings > Global configuration > Objects" />.
|
||||||
|
|
||||||
| Field | Description |
|
| Field | Description |
|
||||||
| -------------------------------------------------- | ------------------------------------------------------------------------ |
|
| --------------------------------------- | ------------------------------------------------------------------------ |
|
||||||
| **Object filters > Person > Minimum object area** | Minimum bounding box area in pixels (or decimal for percentage of frame) |
|
| **Object filters > Person > Min Area** | Minimum bounding box area in pixels (or decimal for percentage of frame) |
|
||||||
| **Object filters > Person > Maximum object area** | Maximum bounding box area in pixels (or decimal for percentage of frame) |
|
| **Object filters > Person > Max Area** | Maximum bounding box area in pixels (or decimal for percentage of frame) |
|
||||||
| **Object filters > Person > Minimum aspect ratio** | Minimum width/height ratio of the bounding box |
|
| **Object filters > Person > Min Ratio** | Minimum width/height ratio of the bounding box |
|
||||||
| **Object filters > Person > Maximum aspect ratio** | Maximum width/height ratio of the bounding box |
|
| **Object filters > Person > Max Ratio** | Maximum width/height ratio of the bounding box |
|
||||||
| **Object filters > Person > Minimum confidence** | Minimum score for the object to initiate tracking |
|
| **Object filters > Person > Min Score** | Minimum score for the object to initiate tracking |
|
||||||
| **Object filters > Person > Confidence threshold** | Minimum computed score to be considered a true positive |
|
| **Object filters > Person > Threshold** | Minimum computed score to be considered a true positive |
|
||||||
|
|
||||||
To override filters for a specific camera, navigate to <NavPath path="Settings > Camera configuration > Objects" />.
|
To override filters for a specific camera, navigate to <NavPath path="Settings > Camera configuration > Objects" />.
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ Only the fields you explicitly set in a profile override are applied. All other
|
|||||||
|
|
||||||
## Activating Profiles
|
## Activating Profiles
|
||||||
|
|
||||||
Profiles can be activated and deactivated via the Frigate UI, [MQTT](/integrations/mqtt#frigateprofileset), the [HTTP API](../integrations/api/camera-set-camera-camera-name-set-feature-sub-command-put.api.mdx), or the Home Assistant integration.
|
Profiles can be activated and deactivated via the Frigate UI, [MQTT](/integrations/mqtt#frigateprofileset), or the Home Assistant integration.
|
||||||
|
|
||||||
In the Frigate UI, open the Settings cog and select **Profiles** from the submenu to see all defined profiles. From there you can activate any profile or deactivate the current one. The active profile is indicated in the UI so you always know which profile is in effect.
|
In the Frigate UI, open the Settings cog and select **Profiles** from the submenu to see all defined profiles. From there you can activate any profile or deactivate the current one. The active profile is indicated in the UI so you always know which profile is in effect.
|
||||||
|
|
||||||
@@ -191,12 +191,14 @@ cameras:
|
|||||||
detect:
|
detect:
|
||||||
enabled: false
|
enabled: false
|
||||||
record:
|
record:
|
||||||
enabled: true
|
enabled: false
|
||||||
profiles:
|
profiles:
|
||||||
away:
|
away:
|
||||||
enabled: true
|
enabled: true
|
||||||
detect:
|
detect:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
record:
|
||||||
|
enabled: true
|
||||||
home:
|
home:
|
||||||
enabled: false
|
enabled: false
|
||||||
```
|
```
|
||||||
@@ -230,31 +232,10 @@ No. Only one profile can be active at a time. Activating a new profile automatic
|
|||||||
|
|
||||||
When you delete a base zone or mask in the Frigate UI, any profile overrides for that entry are deleted automatically as part of the same operation. If you remove a base entry by editing your config file directly and leave a profile override behind, the config will fail validation at startup until the orphaned override is removed as well.
|
When you delete a base zone or mask in the Frigate UI, any profile overrides for that entry are deleted automatically as part of the same operation. If you remove a base entry by editing your config file directly and leave a profile override behind, the config will fail validation at startup until the orphaned override is removed as well.
|
||||||
|
|
||||||
### How do I make a YAML profile track no objects at all?
|
|
||||||
|
|
||||||
Set the tracked object list explicitly to an empty list in the profile:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
cameras:
|
|
||||||
front_door:
|
|
||||||
profiles:
|
|
||||||
home:
|
|
||||||
objects:
|
|
||||||
track: []
|
|
||||||
```
|
|
||||||
|
|
||||||
Leaving the `objects` section empty (or omitting `track`) does not clear the list. Empty sections set no fields, so the profile inherits the full tracked object list from the base config, including anything set at the global level. The same applies to other lists, such as `audio.listen`.
|
|
||||||
|
|
||||||
### Why are some settings missing when I configure a profile override?
|
### Why are some settings missing when I configure a profile override?
|
||||||
|
|
||||||
Fields that require a Frigate restart to take effect cannot be overridden by profiles, since profiles are applied at runtime without restarting. Those fields are hidden when editing a profile override and can only be changed on the base configuration.
|
Fields that require a Frigate restart to take effect cannot be overridden by profiles, since profiles are applied at runtime without restarting. Those fields are hidden when editing a profile override and can only be changed on the base configuration.
|
||||||
|
|
||||||
### Why can't a profile enable recording when it's disabled in the base config?
|
|
||||||
|
|
||||||
Frigate only sets up a camera's recording stream at startup when recording is enabled in the base config, so enabling it later from a profile has no effect. The same applies to turning recording on from the UI or MQTT.
|
|
||||||
|
|
||||||
To keep recording off by default, leave `record.enabled: true` in the base config and create a profile that sets `record.enabled: false`. Activate that profile and it will be restored automatically when Frigate starts.
|
|
||||||
|
|
||||||
### Can I schedule profiles to be enabled or disabled at certain times?
|
### Can I schedule profiles to be enabled or disabled at certain times?
|
||||||
|
|
||||||
Not within Frigate itself. Frigate is an NVR, not an automation platform, so it intentionally does not include a scheduler for activating profiles. Instead, activate profiles from an automation platform that already handles time- and event-based triggers well, such as [Home Assistant](https://www.home-assistant.io/) or [Node-RED](https://nodered.org/). These integrate with Frigate and give you far more robust and flexible scheduling than a built-in scheduler could.
|
Not within Frigate itself. Frigate is an NVR, not an automation platform, so it intentionally does not include a scheduler for activating profiles. Instead, activate profiles from an automation platform that already handles time- and event-based triggers well, such as [Home Assistant](https://www.home-assistant.io/) or [Node-RED](https://nodered.org/). These integrate with Frigate and give you far more robust and flexible scheduling than a built-in scheduler could.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import NavPath from "@site/src/components/NavPath";
|
|||||||
|
|
||||||
Recordings can be enabled and are stored at `/media/frigate/recordings`. The folder structure for the recordings is `YYYY-MM-DD/HH/<camera_name>/MM.SS.mp4` in **UTC time**. These recordings are written directly from your camera stream without re-encoding. Each camera supports a configurable retention policy. Frigate chooses the largest matching retention value between the recording retention and the tracked object retention when determining if a recording should be removed.
|
Recordings can be enabled and are stored at `/media/frigate/recordings`. The folder structure for the recordings is `YYYY-MM-DD/HH/<camera_name>/MM.SS.mp4` in **UTC time**. These recordings are written directly from your camera stream without re-encoding. Each camera supports a configurable retention policy. Frigate chooses the largest matching retention value between the recording retention and the tracked object retention when determining if a recording should be removed.
|
||||||
|
|
||||||
New recording segments are written from the camera stream to cache, they are only moved to disk if they pass a validation check and match the setup recording retention policy.
|
New recording segments are written from the camera stream to cache, they are only moved to disk if they match the setup recording retention policy.
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
@@ -291,7 +291,7 @@ For advanced use cases, the [custom export HTTP API](../integrations/api/export-
|
|||||||
POST /export/custom/{camera_name}/start/{start_time}/end/{end_time}
|
POST /export/custom/{camera_name}/start/{start_time}/end/{end_time}
|
||||||
```
|
```
|
||||||
|
|
||||||
The request body accepts `ffmpeg_input_args` and `ffmpeg_output_args` to control encoding, frame rate, filters, and other FFmpeg options. If neither is provided, Frigate defaults to time-lapse output settings (25x speed, 30 FPS) with audio removed (`-an`). When providing your own `ffmpeg_input_args`, include `-an` if you want audio stripped from the export.
|
The request body accepts `ffmpeg_input_args` and `ffmpeg_output_args` to control encoding, frame rate, filters, and other FFmpeg options. If neither is provided, Frigate defaults to time-lapse output settings (25x speed, 30 FPS).
|
||||||
|
|
||||||
The following example exports a time-lapse at 60x speed with 25 FPS:
|
The following example exports a time-lapse at 60x speed with 25 FPS:
|
||||||
|
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ For cameras that support two-way talk, go2rtc will automatically establish an au
|
|||||||
To prevent this, you must configure two separate stream instances:
|
To prevent this, you must configure two separate stream instances:
|
||||||
|
|
||||||
1. One stream instance with `#backchannel=0` for Frigate's viewing, recording, and detection (prevents go2rtc from establishing the blocking backchannel)
|
1. One stream instance with `#backchannel=0` for Frigate's viewing, recording, and detection (prevents go2rtc from establishing the blocking backchannel)
|
||||||
2. A second stream instance with no `#` parameters at all for two-way talk functionality (can be used by Frigate's WebRTC viewer or other applications)
|
2. A second stream instance without `#backchannel=0` for two-way talk functionality (can be used by Frigate's WebRTC viewer or other applications)
|
||||||
|
|
||||||
Configuration example:
|
Configuration example:
|
||||||
|
|
||||||
@@ -215,8 +215,6 @@ In this configuration:
|
|||||||
- `front_door` stream is used by Frigate for viewing, recording, and detection. The `#backchannel=0` parameter prevents go2rtc from establishing the audio output backchannel, so it won't block two-way talk access.
|
- `front_door` stream is used by Frigate for viewing, recording, and detection. The `#backchannel=0` parameter prevents go2rtc from establishing the audio output backchannel, so it won't block two-way talk access.
|
||||||
- `front_door_twoway` stream is used for two-way talk functionality. This stream can be used by Frigate's WebRTC viewer when two-way talk is enabled, or by other applications (like Home Assistant Advanced Camera Card) that need access to the camera's audio output channel.
|
- `front_door_twoway` stream is used for two-way talk functionality. This stream can be used by Frigate's WebRTC viewer when two-way talk is enabled, or by other applications (like Home Assistant Advanced Camera Card) that need access to the camera's audio output channel.
|
||||||
|
|
||||||
Any `#` parameter on a bare `rtsp://` source disables the backchannel unless the URL explicitly contains `#backchannel=1`. A two-way talk stream with something like `#video=h264` on it silently loses two-way audio, and Frigate will report that two-way talk is unavailable for that stream.
|
|
||||||
|
|
||||||
## Security: Restricted Stream Sources
|
## Security: Restricted Stream Sources
|
||||||
|
|
||||||
For security reasons, the `echo:`, `expr:`, and `exec:` stream sources are disabled by default in go2rtc. These sources allow arbitrary command execution and can pose security risks if misconfigured.
|
For security reasons, the `echo:`, `expr:`, and `exec:` stream sources are disabled by default in go2rtc. These sources allow arbitrary command execution and can pose security risks if misconfigured.
|
||||||
|
|||||||
@@ -121,31 +121,6 @@ cameras:
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</ConfigTabs>
|
</ConfigTabs>
|
||||||
|
|
||||||
## Categorizing manual events
|
|
||||||
|
|
||||||
Events created with the [create manual event API](../integrations/api/create-event-events-camera-name-label-create-post.api.mdx) are categorized with the same label lists, using the label from the request path:
|
|
||||||
|
|
||||||
1. If alerts are enabled and the label is listed in `review -> alerts -> labels`, the review item is an alert.
|
|
||||||
2. Otherwise, if detections are enabled and the label is listed in `review -> detections -> labels`, the review item is a detection.
|
|
||||||
3. If the label is in neither list, the review item is an alert, or no review item is created if alerts are disabled.
|
|
||||||
|
|
||||||
This means manual events are alerts unless you explicitly list their label as a detection label. For example, to have PIR sensors create detections instead of alerts, post to `/api/events/front_door/pir_sensor/create` with the following config:
|
|
||||||
|
|
||||||
```yaml {5-7}
|
|
||||||
cameras:
|
|
||||||
front_door:
|
|
||||||
review:
|
|
||||||
detections:
|
|
||||||
labels:
|
|
||||||
- pir_sensor
|
|
||||||
```
|
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
Required zones do not apply to manual events, since they are created through the API rather than by the object tracker. Setting `review -> alerts -> labels` to an empty list also does not stop manual events from becoming alerts, as a label in neither list still falls back to an alert.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Restricting review items to specific zones
|
## Restricting review items to specific zones
|
||||||
|
|
||||||
By default a review item will be created if any `review -> alerts -> labels` and `review -> detections -> labels` are detected anywhere in the camera frame. You will likely want to configure review items to only be created when the object enters an area of interest, [see the zone docs for more information](./zones.md#restricting-alerts-and-detections-to-specific-zones)
|
By default a review item will be created if any `review -> alerts -> labels` and `review -> detections -> labels` are detected anywhere in the camera frame. You will likely want to configure review items to only be created when the object enters an area of interest, [see the zone docs for more information](./zones.md#restricting-alerts-and-detections-to-specific-zones)
|
||||||
|
|||||||
@@ -163,8 +163,8 @@ genai:
|
|||||||
model: your-model-name
|
model: your-model-name
|
||||||
roles:
|
roles:
|
||||||
- embeddings
|
- embeddings
|
||||||
- descriptions
|
- vision
|
||||||
- chat
|
- tools
|
||||||
|
|
||||||
semantic_search:
|
semantic_search:
|
||||||
enabled: True
|
enabled: True
|
||||||
@@ -226,7 +226,7 @@ For tips on getting the best results from Semantic Search (choosing between thum
|
|||||||
|
|
||||||
## Triggers
|
## Triggers
|
||||||
|
|
||||||
Triggers utilize Semantic Search to automate actions when a tracked object matches a specified image or description. Triggers can be configured so that Frigate executes specific actions when a tracked object's image or description matches a predefined image or text, based on a similarity threshold. Triggers are managed per camera and can be configured via the Frigate UI in the Settings page under the Triggers tab.
|
Triggers utilize Semantic Search to automate actions when a tracked object matches a specified image or description. Triggers can be configured so that Frigate executes a specific actions when a tracked object's image or description matches a predefined image or text, based on a similarity threshold. Triggers are managed per camera and can be configured via the Frigate UI in the Settings page under the Triggers tab.
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
@@ -245,8 +245,8 @@ Triggers are best configured through the Frigate UI.
|
|||||||
1. Navigate to <NavPath path="Settings > Enrichments > Triggers" /> and select a camera from the dropdown menu.
|
1. Navigate to <NavPath path="Settings > Enrichments > Triggers" /> and select a camera from the dropdown menu.
|
||||||
2. Click **Add Trigger** to create a new trigger or use the pencil icon to edit an existing one.
|
2. Click **Add Trigger** to create a new trigger or use the pencil icon to edit an existing one.
|
||||||
3. In the **Create Trigger** wizard:
|
3. In the **Create Trigger** wizard:
|
||||||
- Enter a **Name** for the trigger (e.g., "Red Car Alert"). Frigate derives the trigger's
|
- Enter a **Name** for the trigger (e.g., "Red Car Alert").
|
||||||
internal **ID** from this name, which can be revealed and edited with the show/hide toggle.
|
- Enter a descriptive **Friendly Name** for the trigger (e.g., "Red car on the driveway camera").
|
||||||
- Select the **Type** (`Thumbnail` or `Description`).
|
- Select the **Type** (`Thumbnail` or `Description`).
|
||||||
- For `Thumbnail`, select an image to trigger this action when a similar thumbnail image is detected, based on the threshold.
|
- For `Thumbnail`, select an image to trigger this action when a similar thumbnail image is detected, based on the threshold.
|
||||||
- For `Description`, enter text to trigger this action when a similar tracked object description is detected.
|
- For `Description`, enter text to trigger this action when a similar tracked object description is detected.
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ Let's look at an example use case: I want to record any cars that enter my drive
|
|||||||
|
|
||||||
One might simply think "Why not just run object detection any time there is motion around the driveway area and notify if the bounding box is in that zone?"
|
One might simply think "Why not just run object detection any time there is motion around the driveway area and notify if the bounding box is in that zone?"
|
||||||
|
|
||||||
With that approach, what video is related to the car that entered the driveway? Did it come from the left or right? Was it parked across the street for an hour before turning into the driveway? One approach is to just record 24/7 or for motion (on any changed pixels) and not attempt to do that at all. This is what most other NVRs do. Just don't even try to identify a start and end for that object since it's hard and you will be wrong some portion of the time.
|
With that approach, what video is related to the car that entered the driveway? Did it come from the left or right? Was it parked across the street for an hour before turning into the driveway? One approach is to just record 24/7 or for motion (on any changed changed pixels) and not attempt to do that at all. This is what most other NVRs do. Just don't even try to identify a start and end for that object since it's hard and you will be wrong some portion of the time.
|
||||||
|
|
||||||
Couldn't you just look at when motion stopped and started? Motion for a video feed is nothing more than looking for pixels that are different than they were in previous frames. If the car entered the driveway while someone was mowing the grass, how would you know which motion was for the car and which was for the person when they mow along the driveway or street? What if another car was driving the other direction on the street? Or what if its a windy day and the bush by your mailbox is blowing around?
|
Couldn't you just look at when motion stopped and started? Motion for a video feed is nothing more than looking for pixels that are different than they were in previous frames. If the car entered the driveway while someone was mowing the grass, how would you know which motion was for the car and which was for the person when they mow along the driveway or street? What if another car was driving the other direction on the street? Or what if its a windy day and the bush by your mailbox is blowing around?
|
||||||
|
|
||||||
@@ -61,4 +61,4 @@ Now you have to determine which of the bounding boxes in this frame should be ma
|
|||||||
|
|
||||||
Now let's assume that those other 3 cars were already being tracked as stationary objects, so the car driving down the street is a new 4th car. The object tracker knows we have had 3 cars and we now have 4. As the new car approaches the parked cars, the bounding boxes for all 4 cars is predicted based on the previous frames. The predicted boxes for the parked cars is pretty much a 100% overlap with the bounding boxes in the new frame. The parked cars are slam dunk matches to the tracking ids they had before and the only one left is the remaining bounding box which gets assigned to the new car. This results in a much lower error rate. Not perfect, but better.
|
Now let's assume that those other 3 cars were already being tracked as stationary objects, so the car driving down the street is a new 4th car. The object tracker knows we have had 3 cars and we now have 4. As the new car approaches the parked cars, the bounding boxes for all 4 cars is predicted based on the previous frames. The predicted boxes for the parked cars is pretty much a 100% overlap with the bounding boxes in the new frame. The parked cars are slam dunk matches to the tracking ids they had before and the only one left is the remaining bounding box which gets assigned to the new car. This results in a much lower error rate. Not perfect, but better.
|
||||||
|
|
||||||
The most difficult scenario that causes IDs to be assigned incorrectly is when an object completely occludes another object. When a car drives in front of another car and it's no longer visible, a bounding box disappeared and it's a bit of a toss up when assigning the id since it's difficult to know which one is in front of the other. This happens for cars passing in front of other cars fairly often. It's something that we want to improve in the future.
|
The most difficult scenario that causes IDs to be assigned incorrectly is when an object completely occludes another object. When a car drives in front of another car and its no longer visible, a bounding box disappeared and it's a bit of a toss up when assigning the id since it's difficult to know which one is in front of the other. This happens for cars passing in front of other cars fairly often. It's something that we want to improve in the future.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ During testing, enable the Zones option for the [Debug view](/usage/live#the-sin
|
|||||||
1. Navigate to <NavPath path="Settings > Camera configuration > Masks / Zones" /> and select the desired camera.
|
1. Navigate to <NavPath path="Settings > Camera configuration > Masks / Zones" /> and select the desired camera.
|
||||||
2. Under the **Zones** section, click the plus icon to add a new zone.
|
2. Under the **Zones** section, click the plus icon to add a new zone.
|
||||||
3. Click on the camera's latest image to create the points for the zone boundary. Click the first point again to close the polygon.
|
3. Click on the camera's latest image to create the points for the zone boundary. Click the first point again to close the polygon.
|
||||||
4. Configure zone options such as **Name**, **Objects**, **Loitering Time**, and **Inertia** in the zone editor.
|
4. Configure zone options such as **Friendly name**, **Objects**, **Loitering time**, and **Inertia** in the zone editor.
|
||||||
5. Press **Save** when finished.
|
5. Press **Save** when finished.
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -200,7 +200,7 @@ When using loitering zones, a review item will behave in the following way:
|
|||||||
|
|
||||||
1. Navigate to <NavPath path="Settings > Camera configuration > Masks / Zones" /> and select the desired camera.
|
1. Navigate to <NavPath path="Settings > Camera configuration > Masks / Zones" /> and select the desired camera.
|
||||||
2. Edit or create the zone (e.g., `sidewalk`).
|
2. Edit or create the zone (e.g., `sidewalk`).
|
||||||
- Set **Loitering Time** to the desired number of seconds (e.g., `4`)
|
- Set **Loitering time** to the desired number of seconds (e.g., `4`)
|
||||||
- Under **Objects**, add the relevant object types (e.g., `person`)
|
- Under **Objects**, add the relevant object types (e.g., `person`)
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -291,7 +291,7 @@ Accurate real-world distance measurements are required to estimate speeds. These
|
|||||||
|
|
||||||
1. Navigate to <NavPath path="Settings > Camera configuration > Masks / Zones" /> and select the desired camera.
|
1. Navigate to <NavPath path="Settings > Camera configuration > Masks / Zones" /> and select the desired camera.
|
||||||
2. Create or edit a zone with exactly 4 points aligned to the ground plane.
|
2. Create or edit a zone with exactly 4 points aligned to the ground plane.
|
||||||
3. In the zone editor, enable **Speed Estimation** and enter the real-world **Line A distance**, **Line B distance**, **Line C distance**, and **Line D distance** between each pair of consecutive points.
|
3. In the zone editor, enter the real-world **Distances** between each pair of consecutive points.
|
||||||
- For example, if the distance between the first and second points is 10 meters, between the second and third is 12 meters, etc.
|
- For example, if the distance between the first and second points is 10 meters, between the second and third is 12 meters, etc.
|
||||||
4. Distances are measured in meters (metric) or feet (imperial), depending on the **Unit system** setting.
|
4. Distances are measured in meters (metric) or feet (imperial), depending on the **Unit system** setting.
|
||||||
|
|
||||||
@@ -358,7 +358,7 @@ Zones can be configured with a minimum speed requirement, meaning an object must
|
|||||||
|
|
||||||
1. Navigate to <NavPath path="Settings > Camera configuration > Masks / Zones" /> and select the desired camera.
|
1. Navigate to <NavPath path="Settings > Camera configuration > Masks / Zones" /> and select the desired camera.
|
||||||
2. Edit or create the zone with distances configured.
|
2. Edit or create the zone with distances configured.
|
||||||
- Set **Speed Threshold** to the desired minimum speed (e.g., `20`)
|
- Set **Speed threshold** to the desired minimum speed (e.g., `20`)
|
||||||
- The unit is kph or mph, depending on the **Unit system** setting
|
- The unit is kph or mph, depending on the **Unit system** setting
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ An object filter mask drops any [bounding box](#bounding-box) whose bottom cente
|
|||||||
|
|
||||||
## Min Score
|
## Min Score
|
||||||
|
|
||||||
The lowest score a detected object can have to be kept during tracking. Anything scoring below the minimum is assumed to be a [false positive](#false-positive) and discarded. Set with `min_score` in the config, shown as **Minimum confidence** in the settings UI.
|
The lowest score a detected object can have to be kept during tracking. Anything scoring below the minimum is assumed to be a [false positive](#false-positive) and discarded.
|
||||||
|
|
||||||
## Model
|
## Model
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ A more specific identity assigned to a [tracked object](#tracked-object-event-in
|
|||||||
|
|
||||||
## Threshold
|
## Threshold
|
||||||
|
|
||||||
The median score an object must reach to be considered a true positive. Set with `threshold` in the config, shown as **Confidence threshold** in the settings UI.
|
The median score an object must reach to be considered a true positive.
|
||||||
|
|
||||||
## Top Score
|
## Top Score
|
||||||
|
|
||||||
|
|||||||
@@ -70,9 +70,6 @@ Frigate supports multiple different detectors that work on different types of ha
|
|||||||
- [ROCm](#rocm---amd-gpu): ROCm can run on AMD Discrete GPUs to provide efficient object detection
|
- [ROCm](#rocm---amd-gpu): ROCm can run on AMD Discrete GPUs to provide efficient object detection
|
||||||
- [Supports limited model architectures](../../configuration/object_detectors#amdrocm-gpu-detector)
|
- [Supports limited model architectures](../../configuration/object_detectors#amdrocm-gpu-detector)
|
||||||
- Runs best on discrete AMD GPUs
|
- Runs best on discrete AMD GPUs
|
||||||
- <CommunityBadge /> [XDNA2 (Ryzen AI)](#amd-xdna2): AMD XDNA2 NPU (sub-watt power AI/ML processor separate to the GPU) inside Strix and other "AI" branded AMD platforms
|
|
||||||
- Has only been tested with YOLOv9, in theory other graphs may be compiled too.
|
|
||||||
- Runs via ZMQ proxy which adds some latency, only recommended for local connection
|
|
||||||
|
|
||||||
**Apple Silicon**
|
**Apple Silicon**
|
||||||
|
|
||||||
@@ -299,32 +296,6 @@ The inference time of a rk3588 with all 3 cores enabled is typically 25-30 ms fo
|
|||||||
| ---------------- | ----------------------------------- |
|
| ---------------- | ----------------------------------- |
|
||||||
| yolov9-tiny | ~ 4 ms |
|
| yolov9-tiny | ~ 4 ms |
|
||||||
|
|
||||||
### AMD Ryzen AI / XDNA2
|
|
||||||
|
|
||||||
Frigate supports AMD XDNA2 NPUs through the community-maintained
|
|
||||||
frigate-xdna ZMQ sidecar. It works with stock Frigate and supports
|
|
||||||
Frigate+ models or compatible local YOLO ONNX models. Models are compiled
|
|
||||||
once on the target system and cached for subsequent use.
|
|
||||||
|
|
||||||
Currently qualified on **Ryzen AI Max 300 / Strix Halo**. Other XDNA2
|
|
||||||
devices are not yet qualified; XDNA1 is unsupported.
|
|
||||||
|
|
||||||
Measured YOLOv9 detector latency on Strix Halo:
|
|
||||||
|
|
||||||
| Model | 320 | 640 |
|
|
||||||
| ----- | ---: | ---: |
|
|
||||||
| YOLOv9-T | ~7.4 ms | unsupported |
|
|
||||||
| YOLOv9-S | ~9.0 ms | ~20.0 ms |
|
|
||||||
| YOLOv9-M | ~13.1 ms | ~34.4 ms |
|
|
||||||
| YOLOv9-C | ~14.1 ms | ~35.2 ms |
|
|
||||||
| YOLOv9-E | ~69.4 ms | ~224.8 ms |
|
|
||||||
|
|
||||||
**YOLOv9-C at 320 is the recommended quality/performance balance.**
|
|
||||||
C at 640 is also usable where the lower throughput is acceptable.
|
|
||||||
|
|
||||||
Setup, model preparation, and compatibility details are available
|
|
||||||
[in the frigate-xdna documentation](https://github.com/mitchins/frigate-xdna).
|
|
||||||
|
|
||||||
## What does Frigate use the CPU for and what does it use a detector for? (ELI5 Version)
|
## What does Frigate use the CPU for and what does it use a detector for? (ELI5 Version)
|
||||||
|
|
||||||
This is taken from a [user question on reddit](https://www.reddit.com/r/homeassistant/comments/q8mgau/comment/hgqbxh5/?utm_source=share&utm_medium=web2x&context=3). Modified slightly for clarity.
|
This is taken from a [user question on reddit](https://www.reddit.com/r/homeassistant/comments/q8mgau/comment/hgqbxh5/?utm_source=share&utm_medium=web2x&context=3). Modified slightly for clarity.
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ Users of the Snapcraft build of Docker cannot use storage locations outside your
|
|||||||
|
|
||||||
Frigate utilizes shared memory to store frames during processing. The default `shm-size` provided by Docker is **64MB**.
|
Frigate utilizes shared memory to store frames during processing. The default `shm-size` provided by Docker is **64MB**.
|
||||||
|
|
||||||
The default shm size of **128MB** is fine for setups with **2 cameras** detecting at **720p**. If Frigate is exiting with "Bus error" messages, it is likely because you have too many high resolution cameras and you need to specify a higher shm size, using [`--shm-size`](https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources) (or [`service.shm_size`](https://docs.docker.com/compose/compose-file/compose-file-v2/#shm_size) in Docker Compose). If raising the shm size does not help, check your [process and file limits](#process-and-file-limits) as well.
|
The default shm size of **128MB** is fine for setups with **2 cameras** detecting at **720p**. If Frigate is exiting with "Bus error" messages, it is likely because you have too many high resolution cameras and you need to specify a higher shm size, using [`--shm-size`](https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources) (or [`service.shm_size`](https://docs.docker.com/compose/compose-file/compose-file-v2/#shm_size) in Docker Compose).
|
||||||
|
|
||||||
The Frigate container also stores logs in shm, which can take up to **40MB**, so make sure to take this into account in your math as well.
|
The Frigate container also stores logs in shm, which can take up to **40MB**, so make sure to take this into account in your math as well.
|
||||||
|
|
||||||
@@ -86,30 +86,6 @@ The Frigate container also stores logs in shm, which can take up to **40MB**, so
|
|||||||
|
|
||||||
The shm size cannot be set per container for Home Assistant Apps. However, this is probably not required since by default Home Assistant Supervisor allocates `/dev/shm` with half the size of your total memory. If your machine has 8GB of memory, chances are that Frigate will have access to up to 4GB without any additional configuration.
|
The shm size cannot be set per container for Home Assistant Apps. However, this is probably not required since by default Home Assistant Supervisor allocates `/dev/shm` with half the size of your total memory. If your machine has 8GB of memory, chances are that Frigate will have access to up to 4GB without any additional configuration.
|
||||||
|
|
||||||
### Process and file limits
|
|
||||||
|
|
||||||
Frigate runs many processes and opens a number of shared memory files. Installs with a large number of cameras can exceed the default limits your container runtime applies.
|
|
||||||
|
|
||||||
Hitting the PID limit logs `RuntimeError: can't start new thread`, often followed by a "Bus error" that makes it look like an shm sizing problem. Compare the current count against the max from inside the container:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cat /sys/fs/cgroup/pids.current
|
|
||||||
cat /sys/fs/cgroup/pids.max
|
|
||||||
```
|
|
||||||
|
|
||||||
If these are close, raise the limit with [`--pids-limit`](https://docs.docker.com/engine/containers/resource_constraints/) (or `service.pids_limit` in Docker Compose).
|
|
||||||
|
|
||||||
Running out of file descriptors logs `OSError: [Errno 24] Too many open files`. Raise the limit in Docker Compose:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
services:
|
|
||||||
frigate:
|
|
||||||
ulimits:
|
|
||||||
nofile:
|
|
||||||
soft: 65535
|
|
||||||
hard: 65535
|
|
||||||
```
|
|
||||||
|
|
||||||
## Extra Steps for Specific Hardware
|
## Extra Steps for Specific Hardware
|
||||||
|
|
||||||
The following sections contain additional setup steps that are only required if you are using specific hardware. If you are not using any of these hardware types, you can skip to the [Docker](#docker) installation section.
|
The following sections contain additional setup steps that are only required if you are using specific hardware. If you are not using any of these hardware types, you can skip to the [Docker](#docker) installation section.
|
||||||
@@ -118,7 +94,7 @@ The following sections contain additional setup steps that are only required if
|
|||||||
|
|
||||||
By default, the Raspberry Pi limits the amount of memory available to the GPU. In order to use ffmpeg hardware acceleration, you must increase the available memory by setting `gpu_mem` to the maximum recommended value in `config.txt` as described in the [official docs](https://www.raspberrypi.org/documentation/computers/config_txt.html#memory-options).
|
By default, the Raspberry Pi limits the amount of memory available to the GPU. In order to use ffmpeg hardware acceleration, you must increase the available memory by setting `gpu_mem` to the maximum recommended value in `config.txt` as described in the [official docs](https://www.raspberrypi.org/documentation/computers/config_txt.html#memory-options).
|
||||||
|
|
||||||
Additionally, the USB Coral draws a considerable amount of power. If using any other USB devices such as an SSD, you will experience instability due to the Pi not providing enough power to USB devices. You will need to purchase an external USB hub with its own power supply. Some have reported success with <a href="https://amzn.to/3a2mH0P" target="_blank" rel="nofollow noopener sponsored">this</a> (affiliate link).
|
Additionally, the USB Coral draws a considerable amount of power. If using any other USB devices such as an SSD, you will experience instability due to the Pi not providing enough power to USB devices. You will need to purchase an external USB hub with it's own power supply. Some have reported success with <a href="https://amzn.to/3a2mH0P" target="_blank" rel="nofollow noopener sponsored">this</a> (affiliate link).
|
||||||
|
|
||||||
### Hailo-8
|
### Hailo-8
|
||||||
|
|
||||||
@@ -508,6 +484,7 @@ Generate a Frigate Docker Compose configuration based on your hardware and requi
|
|||||||
|
|
||||||
<DockerComposeGenerator/>
|
<DockerComposeGenerator/>
|
||||||
|
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem value="original" label="Example Docker Compose File">
|
<TabItem value="original" label="Example Docker Compose File">
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -34,12 +34,6 @@ The following models are downloaded automatically the first time their associate
|
|||||||
| [Custom classification](/configuration/custom_classification/state_classification) (training) | MobileNetV2 ImageNet base weights (via Keras) | Google storage |
|
| [Custom classification](/configuration/custom_classification/state_classification) (training) | MobileNetV2 ImageNet base weights (via Keras) | Google storage |
|
||||||
| [Audio transcription](/configuration/advanced/system) | Whisper or Sherpa-ONNX streaming model | HuggingFace / OpenAI |
|
| [Audio transcription](/configuration/advanced/system) | Whisper or Sherpa-ONNX streaming model | HuggingFace / OpenAI |
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
The MobileNetV2 base weights are the one exception to the `/config/model_cache/` rule. They are also the only entry that is not downloaded when the feature is enabled: Frigate fetches them when a training run actually starts.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
### Hardware-Specific Detector Models
|
### Hardware-Specific Detector Models
|
||||||
|
|
||||||
If you are using one of the following hardware detectors and have not provided your own model file, a default model will be downloaded on first startup:
|
If you are using one of the following hardware detectors and have not provided your own model file, a default model will be downloaded on first startup:
|
||||||
@@ -81,7 +75,7 @@ If your Frigate instance has restricted internet access, you can point model dow
|
|||||||
| `HF_ENDPOINT` | `https://huggingface.co` | Semantic search, Sherpa-ONNX, AXEngine models |
|
| `HF_ENDPOINT` | `https://huggingface.co` | Semantic search, Sherpa-ONNX, AXEngine models |
|
||||||
| `GITHUB_ENDPOINT` | `https://github.com` | Face recognition, LPR, RKNN models |
|
| `GITHUB_ENDPOINT` | `https://github.com` | Face recognition, LPR, RKNN models |
|
||||||
| `GITHUB_RAW_ENDPOINT` | `https://raw.githubusercontent.com` | Bird classification |
|
| `GITHUB_RAW_ENDPOINT` | `https://raw.githubusercontent.com` | Bird classification |
|
||||||
| `TF_KERAS_MOBILENET_V2_WEIGHTS_URL` | Unset (Keras uses its own default) | Custom classification training |
|
| `TF_KERAS_MOBILENET_V2_WEIGHTS_URL` | Google storage (Keras default) | Custom classification training |
|
||||||
|
|
||||||
## Optional Cloud Services
|
## Optional Cloud Services
|
||||||
|
|
||||||
@@ -153,23 +147,9 @@ When running as a Home Assistant App, the go2rtc startup script queries the loca
|
|||||||
To run Frigate in an air-gapped or offline environment:
|
To run Frigate in an air-gapped or offline environment:
|
||||||
|
|
||||||
1. **Pre-download models**: Start Frigate with internet access once with all desired features enabled. Models will be cached in `/config/model_cache/`.
|
1. **Pre-download models**: Start Frigate with internet access once with all desired features enabled. Models will be cached in `/config/model_cache/`.
|
||||||
2. **Pre-download the training base weights**: If you plan to train custom classification models, set `TF_KERAS_MOBILENET_V2_WEIGHTS_URL` before training, then run one training job while online. Without this variable the base weights are cached outside `/config/` and are lost whenever the container is recreated, so a later training run will fail offline. If the machine never has internet access, copy the weights in manually as described below.
|
2. **Disable version check**: Set `telemetry.version_check: false` in your configuration.
|
||||||
3. **Disable version check**: Set `telemetry.version_check: false` in your configuration.
|
3. **Block outbound model requests**: Set the `HF_HUB_OFFLINE=1` and `TRANSFORMERS_OFFLINE=1` environment variables to prevent HuggingFace and Transformers from attempting any network requests.
|
||||||
4. **Block outbound model requests**: Set the `HF_HUB_OFFLINE=1` and `TRANSFORMERS_OFFLINE=1` environment variables to prevent HuggingFace and Transformers from attempting any network requests.
|
4. **Avoid cloud features**: Do not configure Frigate+, Generative AI providers that require internet, or cloud MQTT brokers.
|
||||||
5. **Avoid cloud features**: Do not configure Frigate+, Generative AI providers that require internet, or cloud MQTT brokers.
|
5. **Use local model mirrors**: If limited internet is available, set the `HF_ENDPOINT`, `GITHUB_ENDPOINT`, and `GITHUB_RAW_ENDPOINT` environment variables to point to local mirrors.
|
||||||
6. **Use local model mirrors**: If limited internet is available, set the `HF_ENDPOINT`, `GITHUB_ENDPOINT`, `GITHUB_RAW_ENDPOINT`, and `TF_KERAS_MOBILENET_V2_WEIGHTS_URL` environment variables to point to local mirrors.
|
|
||||||
|
|
||||||
After these steps, Frigate will operate with no outbound internet connections.
|
After these steps, Frigate will operate with no outbound internet connections.
|
||||||
|
|
||||||
### Manually Copying the Training Base Weights
|
|
||||||
|
|
||||||
On a machine with internet access, download the weights:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl -L -o mobilenet_v2_weights.h5 \
|
|
||||||
"https://storage.googleapis.com/tensorflow/keras-applications/mobilenet_v2/mobilenet_v2_weights_tf_dim_ordering_tf_kernels_0.35_224_no_top.h5"
|
|
||||||
```
|
|
||||||
|
|
||||||
Copy the file into your Frigate config volume as `/config/model_cache/MobileNet/mobilenet_v2_weights.h5`, keeping that exact filename, then set the environment variable `TF_KERAS_MOBILENET_V2_WEIGHTS_URL` in your Docker compose file to the URL above and restart Frigate.
|
|
||||||
|
|
||||||
The variable must be set even though the URL is never contacted. If it is unset, Frigate ignores the copied file and asks Keras to download the weights instead.
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ At this point you should be able to start Frigate and a basic config will be cre
|
|||||||
|
|
||||||
### Step 2: Add a camera
|
### Step 2: Add a camera
|
||||||
|
|
||||||
Click the **Add Camera** button in <NavPath path="Settings > Global configuration > Camera management" /> to use the camera setup wizard to get your first camera added into Frigate. See [Adding a camera with the Add Camera Wizard](../configuration/cameras.md#adding-a-camera-with-the-add-camera-wizard) for a walkthrough of each step.
|
Click the **Add Camera** button in <NavPath path="Settings > Global configuration > Camera management" /> to use the camera setup wizard to get your first camera added into Frigate.
|
||||||
|
|
||||||
### Step 3: Configure hardware acceleration (recommended)
|
### Step 3: Configure hardware acceleration (recommended)
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ The best way to integrate with Home Assistant is to use the [official integratio
|
|||||||
|
|
||||||
### Preparation
|
### Preparation
|
||||||
|
|
||||||
Frigate itself must be installed and running before setting up the integration. See the [installation documentation](../frigate/installation.md) for details.
|
|
||||||
|
|
||||||
The Frigate integration requires the `mqtt` integration to be installed and
|
The Frigate integration requires the `mqtt` integration to be installed and
|
||||||
manually configured first.
|
manually configured first.
|
||||||
|
|
||||||
@@ -124,7 +122,7 @@ Use `http://<frigate_device_ip>:8971` as the URL for the integration so that aut
|
|||||||
|
|
||||||
The above URL assumes you have [disabled TLS](../configuration/tls).
|
The above URL assumes you have [disabled TLS](../configuration/tls).
|
||||||
By default, TLS is enabled and Frigate will be using a self-signed certificate. HomeAssistant will fail to connect HTTPS to port 8971 since it fails to verify the self-signed certificate.
|
By default, TLS is enabled and Frigate will be using a self-signed certificate. HomeAssistant will fail to connect HTTPS to port 8971 since it fails to verify the self-signed certificate.
|
||||||
Either disable TLS and use HTTP from HomeAssistant, or configure Frigate to be accessible with a valid certificate.
|
Either disable TLS and use HTTP from HomeAssistant, or configure Frigate to be acessible with a valid certificate.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -281,7 +279,7 @@ For advanced usecases, this behavior can be changed with the [RTSP URL
|
|||||||
template](#options) option. When set, this string will override the default stream
|
template](#options) option. When set, this string will override the default stream
|
||||||
address that is derived from the default behavior described above. This option supports
|
address that is derived from the default behavior described above. This option supports
|
||||||
[jinja2 templates](https://jinja.palletsprojects.com/) and has the `camera` dict
|
[jinja2 templates](https://jinja.palletsprojects.com/) and has the `camera` dict
|
||||||
variables from [Frigate API](/integrations/api/frigate-http-api)
|
variables from [Frigate API](../integrations/api)
|
||||||
available for the template. Note that no Home Assistant state is available to the
|
available for the template. Note that no Home Assistant state is available to the
|
||||||
template, only the camera dict from Frigate.
|
template, only the camera dict from Frigate.
|
||||||
|
|
||||||
|
|||||||
@@ -3,100 +3,35 @@ id: homekit
|
|||||||
title: HomeKit
|
title: HomeKit
|
||||||
---
|
---
|
||||||
|
|
||||||
Frigate cameras can be exported to Apple HomeKit through go2rtc. Each exported camera appears as an accessory in the Apple Home app on your iOS, iPadOS, macOS, and tvOS devices.
|
Frigate cameras can be integrated with Apple HomeKit through go2rtc. This allows you to view your camera streams directly in the Apple Home app on your iOS, iPadOS, macOS, and tvOS devices.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Exporting cameras is handled entirely through go2rtc, which is embedded in Frigate. go2rtc provides the necessary HomeKit Accessory Protocol (HAP) server, so your camera is published to HomeKit as an accessory in its own right.
|
HomeKit integration is handled entirely through go2rtc, which is embedded in Frigate. go2rtc provides the necessary HomeKit Accessory Protocol (HAP) server to expose your cameras to HomeKit.
|
||||||
|
|
||||||
:::note
|
## Setup
|
||||||
|
|
||||||
This is the opposite of importing a HomeKit camera. go2rtc can also pair with an existing HomeKit camera (Aqara, Eve, Eufy, and similar) and use it as a stream source, which is what the `add` page of the go2rtc WebUI is for. That page discovers HomeKit accessories on your network and will not list your Frigate cameras. It is not used for exporting.
|
All HomeKit configuration and pairing should be done through the **go2rtc WebUI**.
|
||||||
|
|
||||||
:::
|
### Accessing the go2rtc WebUI
|
||||||
|
|
||||||
|
The go2rtc WebUI is available at:
|
||||||
|
|
||||||
|
```
|
||||||
|
http://<frigate_host>:1984
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace `<frigate_host>` with the IP address or hostname of your Frigate server.
|
||||||
|
|
||||||
|
### Pairing Cameras
|
||||||
|
|
||||||
|
1. Navigate to the go2rtc WebUI at `http://<frigate_host>:1984`
|
||||||
|
2. Use the `add` section to add a new camera to HomeKit
|
||||||
|
3. Follow the on-screen instructions to generate pairing codes for your cameras
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Frigate must be running with `network_mode: host` so that HomeKit can discover your cameras over mDNS
|
- Frigate must be accessible on your local network using host network_mode
|
||||||
- Your Apple device must be on the same network as Frigate
|
- Your iOS device must be on the same network as Frigate
|
||||||
- Port 1984 must be accessible so you can reach the go2rtc WebUI
|
- Port 1984 must be accessible for the go2rtc WebUI
|
||||||
|
- For detailed go2rtc configuration options, refer to the [go2rtc documentation](https://github.com/AlexxIT/go2rtc)
|
||||||
HomeKit also places strict limits on the stream itself. go2rtc passes your stream through without resizing or re-encoding it, so the stream you export must already meet these requirements:
|
|
||||||
|
|
||||||
- **Video:** H.264 at 1920x1080, 1280x720, or 320x240
|
|
||||||
- **Audio:** Opus, mono, 16 kHz
|
|
||||||
|
|
||||||
A camera's full resolution stream usually does not qualify. See [Exporting a compatible stream](#exporting-a-compatible-stream) below.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
HomeKit settings are stored in `/config/go2rtc_homekit.yml`. This is a separate file from your Frigate config, because go2rtc needs to write your pairings back to it when you pair a device.
|
|
||||||
|
|
||||||
Edit it using the go2rtc config editor, which writes to that file directly:
|
|
||||||
|
|
||||||
```
|
|
||||||
http://<frigate_host>:1984/editor.html
|
|
||||||
```
|
|
||||||
|
|
||||||
Replace `<frigate_host>` with the IP address or hostname of your Frigate server. The editor will be empty until you add a HomeKit section, since this file holds only your HomeKit settings and not the rest of your go2rtc config.
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
Do not put the `homekit:` section in the `go2rtc:` section of your Frigate config.
|
|
||||||
|
|
||||||
Frigate regenerates that config on every startup, so go2rtc cannot save your pairings to it. Pairing will appear to succeed and then fail after the next restart with `PairVerify with unknown client_id`. If the section exists in both places, your saved pairings are erased on every restart.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
Add an entry for each camera you want to export. The key must match the name of a go2rtc stream, and the pin must be 8 digits. This is the number the Home app calls the setup code:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
homekit:
|
|
||||||
front_door:
|
|
||||||
name: Front Door
|
|
||||||
pin: "12345678"
|
|
||||||
```
|
|
||||||
|
|
||||||
If the key does not match a go2rtc stream, go2rtc logs `[homekit] missing stream:` at startup and the camera will not appear in the Home app.
|
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
go2rtc derives each accessory's HomeKit identity from this key, so renaming it later means the camera appears as a new accessory and has to be paired again. Settle on the name before you pair.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
Frigate keeps only the `homekit:` section of this file when it starts, so do not store streams or other go2rtc settings in it.
|
|
||||||
|
|
||||||
### Exporting a compatible stream
|
|
||||||
|
|
||||||
If a camera's stream does not meet the requirements listed above, define a scaled restream in your Frigate config and point HomeKit at that stream instead of the original:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
go2rtc:
|
|
||||||
streams:
|
|
||||||
front_door:
|
|
||||||
- rtsp://user:password@192.168.1.50:554/stream
|
|
||||||
front_door_homekit:
|
|
||||||
- "ffmpeg:front_door#video=h264#width=1280#height=720#audio=opus/16000"
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# /config/go2rtc_homekit.yml
|
|
||||||
homekit:
|
|
||||||
front_door_homekit:
|
|
||||||
name: Front Door
|
|
||||||
pin: "12345678"
|
|
||||||
```
|
|
||||||
|
|
||||||
Add `#hardware=cuda`, `#hardware=vaapi`, or the appropriate value for your system to transcode using your GPU. Note that NVENC cannot encode H.264 wider than 4096 pixels, so very wide streams must be scaled down as shown above rather than only re-encoded.
|
|
||||||
|
|
||||||
## Pairing Cameras
|
|
||||||
|
|
||||||
1. Restart Frigate after adding the `homekit:` section
|
|
||||||
2. In the Apple Home app, choose **Add Accessory**, then **More options** to enter a code manually
|
|
||||||
3. Select your camera and enter the pin you configured as the setup code
|
|
||||||
4. Confirm that a `pairings:` list now appears under the camera in `/config/go2rtc_homekit.yml`
|
|
||||||
|
|
||||||
Pairings are saved back to that file automatically. If step 4 shows no `pairings:` list, check the Frigate log for `[homekit] can't save`, which means the `homekit:` section is missing from `/config/go2rtc_homekit.yml`.
|
|
||||||
|
|
||||||
For detailed go2rtc configuration options, refer to the [go2rtc documentation](https://github.com/AlexxIT/go2rtc).
|
|
||||||
|
|||||||
@@ -11,18 +11,12 @@ MQTT requires a network connection to your broker. This is typically local, but
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
:::note
|
|
||||||
|
|
||||||
Wherever a topic below includes a camera, mask, or zone name, use its `ID` from the config, not its `friendly_name`. For example, a camera with `friendly_name: "Back Yard"` and ID `back_yard` publishes to `frigate/back_yard/...`, not `frigate/Back Yard/...`.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
## General Frigate Topics
|
## General Frigate Topics
|
||||||
|
|
||||||
### `frigate/available`
|
### `frigate/available`
|
||||||
|
|
||||||
Designed to be used as an availability topic with Home Assistant. Possible message are:
|
Designed to be used as an availability topic with Home Assistant. Possible message are:
|
||||||
"online": published once Frigate is running and has published its initial state. Note that this is published on every connection to the broker, so it is republished if the broker restarts or the connection drops and recovers, without Frigate itself restarting.
|
"online": published when Frigate is running (on startup)
|
||||||
"stopped": published when Frigate is stopped normally
|
"stopped": published when Frigate is stopped normally
|
||||||
"offline": published automatically by the MQTT broker if Frigate disconnects unexpectedly (via MQTT Will Message)
|
"offline": published automatically by the MQTT broker if Frigate disconnects unexpectedly (via MQTT Will Message)
|
||||||
|
|
||||||
@@ -286,7 +280,7 @@ Same data available at `/api/stats` published at a configurable interval.
|
|||||||
|
|
||||||
### `frigate/camera_activity`
|
### `frigate/camera_activity`
|
||||||
|
|
||||||
Returns data about each camera, its current features, and if it is detecting motion, objects, etc. Can be triggered by publishing to `frigate/onConnect`
|
Returns data about each camera, its current features, and if it is detecting motion, objects, etc. Can be triggered by publising to `frigate/onConnect`
|
||||||
|
|
||||||
### `frigate/profile/set`
|
### `frigate/profile/set`
|
||||||
|
|
||||||
@@ -298,9 +292,7 @@ Topic with the currently active profile name. Published value is the profile nam
|
|||||||
|
|
||||||
### `frigate/notifications/set`
|
### `frigate/notifications/set`
|
||||||
|
|
||||||
Topic to turn notifications on and off for all cameras. Expected values are `ON` and `OFF`.
|
Topic to turn notifications on and off. Expected values are `ON` and `OFF`.
|
||||||
|
|
||||||
Only available when notifications are enabled in the config. Not persisted across Frigate restarts.
|
|
||||||
|
|
||||||
### `frigate/notifications/state`
|
### `frigate/notifications/state`
|
||||||
|
|
||||||
@@ -316,8 +308,6 @@ Publishes the current health status of each role that is enabled (`audio`, `dete
|
|||||||
- `offline`: Stream is offline and is being restarted
|
- `offline`: Stream is offline and is being restarted
|
||||||
- `disabled`: Camera is currently turned off (either at runtime via the `enabled/set` topic, or persistently via the configuration file). See [Camera state](/configuration/live#camera-state) for the distinction.
|
- `disabled`: Camera is currently turned off (either at runtime via the `enabled/set` topic, or persistently via the configuration file). See [Camera state](/configuration/live#camera-state) for the distinction.
|
||||||
|
|
||||||
These reflect the state of Frigate's process for that role, not the camera's reachability, so an unreachable camera alternates between `offline` and `online` as the watchdog restarts ffmpeg. Wait for the status to hold steady (for example with Home Assistant's `for:`) rather than acting on a single message.
|
|
||||||
|
|
||||||
### `frigate/<camera_name>/<object_name>`
|
### `frigate/<camera_name>/<object_name>`
|
||||||
|
|
||||||
Publishes the count of objects for the camera for use as a sensor in Home Assistant.
|
Publishes the count of objects for the camera for use as a sensor in Home Assistant.
|
||||||
@@ -400,18 +390,6 @@ Topic to turn audio detection for a camera on and off. Expected values are `ON`
|
|||||||
|
|
||||||
Topic with current state of audio detection for a camera. Published values are `ON` and `OFF`.
|
Topic with current state of audio detection for a camera. Published values are `ON` and `OFF`.
|
||||||
|
|
||||||
### `frigate/<camera_name>/audio_transcription/set`
|
|
||||||
|
|
||||||
Topic to turn [live audio transcription](/configuration/audio_detectors#live-transcription) for a camera on and off. Expected values are `ON` and `OFF`. Transcribed text is published to `frigate/<camera_name>/audio/transcription`.
|
|
||||||
|
|
||||||
`ON` is ignored unless audio transcription is enabled in the config for the camera. Unlike the other camera toggles, this one is not persisted across Frigate restarts.
|
|
||||||
|
|
||||||
**NOTE:** Requires audio detection and transcription to be enabled
|
|
||||||
|
|
||||||
### `frigate/<camera_name>/audio_transcription/state`
|
|
||||||
|
|
||||||
Topic with current state of live audio transcription for a camera. Published values are `ON` and `OFF`.
|
|
||||||
|
|
||||||
### `frigate/<camera_name>/recordings/set`
|
### `frigate/<camera_name>/recordings/set`
|
||||||
|
|
||||||
Topic to turn recordings for a camera on and off. Expected values are `ON` and `OFF`. The change is persisted across Frigate restarts (see [Runtime toggle persistence](/configuration/live#runtime-toggle-persistence)).
|
Topic to turn recordings for a camera on and off. Expected values are `ON` and `OFF`. The change is persisted across Frigate restarts (see [Runtime toggle persistence](/configuration/live#runtime-toggle-persistence)).
|
||||||
@@ -578,20 +556,16 @@ Topic with current state of the Birdseye mode for a camera. Published values are
|
|||||||
|
|
||||||
### `frigate/<camera_name>/notifications/set`
|
### `frigate/<camera_name>/notifications/set`
|
||||||
|
|
||||||
Topic to turn notifications for a camera on and off. Expected values are `ON` and `OFF`.
|
Topic to turn notifications on and off. Expected values are `ON` and `OFF`.
|
||||||
|
|
||||||
`ON` is ignored unless notifications are enabled in the config for the camera. This is not persisted across Frigate restarts. It is the same control the UI labels **Suspend until restart**.
|
|
||||||
|
|
||||||
### `frigate/<camera_name>/notifications/state`
|
### `frigate/<camera_name>/notifications/state`
|
||||||
|
|
||||||
Topic with current state of notifications. Published values are `ON` and `OFF`. This is the authoritative topic for whether a camera will notify.
|
Topic with current state of notifications. Published values are `ON` and `OFF`.
|
||||||
|
|
||||||
### `frigate/<camera_name>/notifications/suspend`
|
### `frigate/<camera_name>/notifications/suspend`
|
||||||
|
|
||||||
Topic to suspend notifications for a certain number of minutes. Expected value is an integer. Separate from `notifications/set`: it does not change `notifications/state`, and is ignored while notifications are off.
|
Topic to suspend notifications for a certain number of minutes. Expected value is an integer.
|
||||||
|
|
||||||
### `frigate/<camera_name>/notifications/suspended`
|
### `frigate/<camera_name>/notifications/suspended`
|
||||||
|
|
||||||
Topic with timestamp that notifications are suspended until. Published value is a UNIX timestamp, or 0 if there is no timed suspension.
|
Topic with timestamp that notifications are suspended until. Published value is a UNIX timestamp, or 0 if notifications are not suspended.
|
||||||
|
|
||||||
`0` does not mean notifications are enabled: `notifications/set` `OFF` clears the timed suspension, so this publishes `0` while `notifications/state` is `OFF`.
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ The [Advanced Camera Card](https://card.camera/#/README) is a Home Assistant das
|
|||||||
|
|
||||||
## [Double Take](https://github.com/skrashevich/double-take)
|
## [Double Take](https://github.com/skrashevich/double-take)
|
||||||
|
|
||||||
[Double Take](https://github.com/skrashevich/double-take) provides a unified UI and API for processing and training images for facial recognition.
|
[Double Take](https://github.com/skrashevich/double-take) provides an unified UI and API for processing and training images for facial recognition.
|
||||||
It supports automatically setting the sub labels in Frigate for person objects that are detected and recognized.
|
It supports automatically setting the sub labels in Frigate for person objects that are detected and recognized.
|
||||||
This is a fork (with fixed errors and new features) of [original Double Take](https://github.com/jakowenko/double-take) project which, unfortunately, isn't being maintained by author.
|
This is a fork (with fixed errors and new features) of [original Double Take](https://github.com/jakowenko/double-take) project which, unfortunately, isn't being maintained by author.
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ This is a fork (with fixed errors and new features) of [original Double Take](ht
|
|||||||
|
|
||||||
## [Scrypted - Frigate bridge plugin](https://github.com/apocaliss92/scrypted-frigate-bridge)
|
## [Scrypted - Frigate bridge plugin](https://github.com/apocaliss92/scrypted-frigate-bridge)
|
||||||
|
|
||||||
[Scrypted - Frigate bridge](https://github.com/apocaliss92/scrypted-frigate-bridge) is a plugin that allows you to ingest Frigate detections, motion, videoclips on Scrypted as well as provide templates to export rebroadcast configurations on Frigate.
|
[Scrypted - Frigate bridge](https://github.com/apocaliss92/scrypted-frigate-bridge) is an plugin that allows to ingest Frigate detections, motion, videoclips on Scrypted as well as provide templates to export rebroadcast configurations on Frigate.
|
||||||
|
|
||||||
## [Strix](https://github.com/eduard256/Strix)
|
## [Strix](https://github.com/eduard256/Strix)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ For the best results, follow these guidelines. You may also want to review the d
|
|||||||
|
|
||||||
## AI suggested labels
|
## AI suggested labels
|
||||||
|
|
||||||
If you have an active Frigate+ subscription, new uploads will be scanned for the objects configured for your camera and you will see suggested labels as light blue boxes when annotating in Frigate+. These suggestions are processed via a queue and typically complete within a minute after uploading, but processing times can be longer.
|
If you have an active Frigate+ subscription, new uploads will be scanned for the objects configured for you camera and you will see suggested labels as light blue boxes when annotating in Frigate+. These suggestions are processed via a queue and typically complete within a minute after uploading, but processing times can be longer.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -21,13 +21,7 @@ Yes. Models and metadata are stored in the `model_cache` directory within the co
|
|||||||
|
|
||||||
### Can I keep using my Frigate+ models even if I do not renew my subscription?
|
### Can I keep using my Frigate+ models even if I do not renew my subscription?
|
||||||
|
|
||||||
Yes. Subscriptions to Frigate+ provide access to the infrastructure used to train the models. Models you train during an active subscription remain licensed for your continued use even after your subscription ends — models already in your model cache will keep working indefinitely. An active subscription is required to train new models and download new versions.
|
Yes. Subscriptions to Frigate+ provide access to the infrastructure used to train the models. Models trained with your subscription are yours to keep and use forever. However, do note that the terms and conditions prohibit you from sharing, reselling, or creating derivative products from the models.
|
||||||
|
|
||||||
### Can I use Frigate+ models commercially?
|
|
||||||
|
|
||||||
A standard subscription covers use on camera systems you own or operate, including for your business. A shop, restaurant, warehouse, or office running Frigate+ at its own locations (including multiple locations) is exactly the kind of use the subscription is for.
|
|
||||||
What the standard subscription does not cover is using Frigate+ models to provide a product or service to others. If you're deploying models at your customers' sites, bundling them with hardware you sell, or running them as part of a hosted or managed service, even if your customers never receive the model files themselves, you'll need a commercial license.
|
|
||||||
Note that professional installers are fine under standard subscriptions when each customer holds their own Frigate+ subscription. The commercial license is for cases where your license powers your customers' sites.
|
|
||||||
|
|
||||||
### Why can't I submit images to Frigate+?
|
### Why can't I submit images to Frigate+?
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,6 @@ id: first_model
|
|||||||
title: Requesting your first model
|
title: Requesting your first model
|
||||||
---
|
---
|
||||||
|
|
||||||
import ConfigTabs from "@site/src/components/ConfigTabs";
|
|
||||||
import TabItem from "@theme/TabItem";
|
|
||||||
import NavPath from "@site/src/components/NavPath";
|
|
||||||
|
|
||||||
## Step 1: Upload and annotate your images
|
## Step 1: Upload and annotate your images
|
||||||
|
|
||||||
Before requesting your first model, you will need to upload and verify at least 10 images to Frigate+. The more images you upload, annotate, and verify the better your results will be. Most users start to see very good results once they have at least 100 verified images per camera. Keep in mind that varying conditions should be included. You will want images from cloudy days, sunny days, dawn, dusk, and night. Refer to the [integration docs](../integrations/plus.md#generate-an-api-key) for instructions on how to easily submit images to Frigate+ directly from Frigate.
|
Before requesting your first model, you will need to upload and verify at least 10 images to Frigate+. The more images you upload, annotate, and verify the better your results will be. Most users start to see very good results once they have at least 100 verified images per camera. Keep in mind that varying conditions should be included. You will want images from cloudy days, sunny days, dawn, dusk, and night. Refer to the [integration docs](../integrations/plus.md#generate-an-api-key) for instructions on how to easily submit images to Frigate+ directly from Frigate.
|
||||||
@@ -20,21 +16,13 @@ For more detailed recommendations, you can refer to the docs on [annotating](./a
|
|||||||
Once you have an initial set of verified images, you can request a model on the Models page. For guidance on choosing a model type, refer to [this part of the documentation](./index.md#available-model-types). If you are unsure which type to request, you can test the base model for each version from the "Base Models" tab. Each model request requires 1 of the 12 trainings that you receive with your annual subscription. This model will support all [label types available](./index.md#available-label-types) even if you do not submit any examples for those labels. Model creation can take up to 36 hours.
|
Once you have an initial set of verified images, you can request a model on the Models page. For guidance on choosing a model type, refer to [this part of the documentation](./index.md#available-model-types). If you are unsure which type to request, you can test the base model for each version from the "Base Models" tab. Each model request requires 1 of the 12 trainings that you receive with your annual subscription. This model will support all [label types available](./index.md#available-label-types) even if you do not submit any examples for those labels. Model creation can take up to 36 hours.
|
||||||

|

|
||||||
|
|
||||||
## Step 3: Set your model
|
## Step 3: Set your model id in the config
|
||||||
|
|
||||||
You will receive an email notification when your Frigate+ model is ready.
|
You will receive an email notification when your Frigate+ model is ready.
|
||||||

|

|
||||||
|
|
||||||
Models available in Frigate+ can be used with a special model path. No other information needs to be configured because it fetches the remaining config from Frigate+ automatically.
|
Models available in Frigate+ can be used with a special model path. No other information needs to be configured because it fetches the remaining config from Frigate+ automatically.
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
Navigate to <NavPath path="Settings > System > Detectors and model" />. In the **Detection Model** section, choose the **Frigate+** tab. Select your new Frigate+ model from the **Available Frigate+ models** dropdown, then click **Save**. Restart Frigate to apply the change.
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
detectors: ...
|
detectors: ...
|
||||||
|
|
||||||
@@ -42,46 +30,22 @@ model:
|
|||||||
path: plus://<your_model_id>
|
path: plus://<your_model_id>
|
||||||
```
|
```
|
||||||
|
|
||||||
:::tip
|
|
||||||
|
|
||||||
When setting the plus model id, all other fields should be removed as these are configured automatically with the Frigate+ model config
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
Model IDs are not secret values and can be shared freely. Access to your model is protected by your API key.
|
Model IDs are not secret values and can be shared freely. Access to your model is protected by your API key.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
|
||||||
|
When setting the plus model id, all other fields should be removed as these are configured automatically with the Frigate+ model config
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
## Step 4: Adjust your object filters for higher scores
|
## Step 4: Adjust your object filters for higher scores
|
||||||
|
|
||||||
Frigate+ models generally have much higher scores than the default model provided in Frigate. You will likely need to increase your `threshold` and `min_score` values. Here is an example of how these values can be refined, but you should expect these to evolve as your model improves. For more information about how `threshold` and `min_score` are related, see the docs on [object filters](../configuration/object_filters.md#object-scores).
|
Frigate+ models generally have much higher scores than the default model provided in Frigate. You will likely need to increase your `threshold` and `min_score` values. Here is an example of how these values can be refined, but you should expect these to evolve as your model improves. For more information about how `threshold` and `min_score` are related, see the docs on [object filters](../configuration/object_filters.md#object-scores).
|
||||||
|
|
||||||
<ConfigTabs>
|
|
||||||
<TabItem value="ui">
|
|
||||||
|
|
||||||
Navigate to <NavPath path="Settings > Global configuration > Objects" />. Under **Object filters**, set **Minimum confidence** and **Confidence threshold** for each object type, then click **Save**.
|
|
||||||
|
|
||||||
| Object | Minimum confidence | Confidence threshold |
|
|
||||||
| ----------------- | ------------------ | -------------------- |
|
|
||||||
| **dog** | .7 | .9 |
|
|
||||||
| **cat** | .65 | .8 |
|
|
||||||
| **face** | .7 | |
|
|
||||||
| **package** | .65 | .9 |
|
|
||||||
| **license_plate** | .6 | |
|
|
||||||
| **amazon** | .75 | |
|
|
||||||
| **ups** | .75 | |
|
|
||||||
| **fedex** | .75 | |
|
|
||||||
| **person** | .65 | .85 |
|
|
||||||
| **car** | .65 | .85 |
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value="yaml">
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
objects:
|
objects:
|
||||||
filters:
|
filters:
|
||||||
@@ -111,6 +75,3 @@ objects:
|
|||||||
min_score: .65
|
min_score: .65
|
||||||
threshold: .85
|
threshold: .85
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</ConfigTabs>
|
|
||||||
|
|||||||
@@ -65,11 +65,11 @@ Some users may find that Frigate+ models result in more false positives initiall
|
|||||||
|
|
||||||
Frigate+ models support a more relevant set of objects for security cameras. The labels for annotation in Frigate+ are configurable by editing the camera in the Cameras section of Frigate+. Currently, the following objects are supported:
|
Frigate+ models support a more relevant set of objects for security cameras. The labels for annotation in Frigate+ are configurable by editing the camera in the Cameras section of Frigate+. Currently, the following objects are supported:
|
||||||
|
|
||||||
- **People**: `person`, `face`, `baby`
|
- **People**: `person`, `face`
|
||||||
- **Vehicles**: `car`, `motorcycle`, `bicycle`, `boat`, `school_bus`, `garbage truck`, `license_plate`
|
- **Vehicles**: `car`, `motorcycle`, `bicycle`, `boat`, `school_bus`, `license_plate`
|
||||||
- **Delivery Logos**: `amazon`, `usps`, `ups`, `fedex`, `dhl`, `an_post`, `purolator`, `postnl`, `nzpost`, `postnord`, `gls`, `dpd`, `canada_post`, `royal_mail`
|
- **Delivery Logos**: `amazon`, `usps`, `ups`, `fedex`, `dhl`, `an_post`, `purolator`, `postnl`, `nzpost`, `postnord`, `gls`, `dpd`, `canada_post`, `royal_mail`
|
||||||
- **Animals**: `dog`, `cat`, `deer`, `horse`, `bird`, `raccoon`, `fox`, `bear`, `cow`, `squirrel`, `goat`, `rabbit`, `skunk`, `kangaroo`, `possum`, `rodent`
|
- **Animals**: `dog`, `cat`, `deer`, `horse`, `bird`, `raccoon`, `fox`, `bear`, `cow`, `squirrel`, `goat`, `rabbit`, `skunk`, `kangaroo`
|
||||||
- **Other**: `package`, `waste_bin`, `bbq_grill`, `robot_lawnmower`, `umbrella`, `baby_stroller`
|
- **Other**: `package`, `waste_bin`, `bbq_grill`, `robot_lawnmower`, `umbrella`
|
||||||
|
|
||||||
Other object types available in the default Frigate model are not available. Additional object types will be added in future releases.
|
Other object types available in the default Frigate model are not available. Additional object types will be added in future releases.
|
||||||
|
|
||||||
@@ -77,12 +77,9 @@ Other object types available in the default Frigate model are not available. Add
|
|||||||
|
|
||||||
Candidate labels are also available for annotation. These labels don't have enough data to be included in the model yet, but using them will help add support sooner. You can enable these labels by editing the camera settings.
|
Candidate labels are also available for annotation. These labels don't have enough data to be included in the model yet, but using them will help add support sooner. You can enable these labels by editing the camera settings.
|
||||||
|
|
||||||
Where possible, these labels are mapped to existing labels during training. For example, any `duck` labels are mapped to `bird` until support for new labels is added.
|
Where possible, these labels are mapped to existing labels during training. For example, any `baby` labels are mapped to `person` until support for new labels is added.
|
||||||
|
|
||||||
- **Vehicles**: `tractor`, `golf_cart`, `bus`, `airplane`, `helicopter`, `rickshaw`, `scooter`
|
The candidate labels are: `baby`, `bpost`, `badger`, `possum`, `rodent`, `chicken`, `groundhog`, `boar`, `hedgehog`, `tractor`, `golf cart`, `garbage truck`, `bus`, `sports ball`, `la_poste`, `lawnmower`, `heron`, `rickshaw`, `wombat`, `auspost`, `aramex`, `bobcat`, `mustelid`, `transoflex`, `airplane`, `drone`, `mountain_lion`, `crocodile`, `turkey`, `baby_stroller`, `monkey`, `coyote`, `porcupine`, `parcelforce`, `sheep`, `snake`, `helicopter`, `lizard`, `duck`, `hermes`, `cargus`, `fan_courier`, `sameday`
|
||||||
- **Delivery Logos**: `bpost`, `auspost`, `aramex`, `transoflex`, `parcelforce`, `hermes`, `cargus`, `fan_courier`, `sameday`, `la_poste`
|
|
||||||
- **Animals**: `badger`, `chicken`, `duck`, `turkey`, `groundhog`, `boar`, `hedgehog`, `wombat`, `bobcat`, `mustelid`, `mountain_lion`, `crocodile`, `monkey`, `coyote`, `porcupine`, `sheep`, `snake`, `lizard`, `heron`, `elk`, `moose`, `pig`, `donkey`, `civet`
|
|
||||||
- **Other**: `sports_ball`, `drone`, `lawnmower`
|
|
||||||
|
|
||||||
Candidate labels are not available for automatic suggestions.
|
Candidate labels are not available for automatic suggestions.
|
||||||
|
|
||||||
|
|||||||
@@ -1,240 +0,0 @@
|
|||||||
---
|
|
||||||
id: common_errors
|
|
||||||
title: Common Error Messages
|
|
||||||
---
|
|
||||||
|
|
||||||
import FaqItem from "@site/src/components/FaqItem";
|
|
||||||
|
|
||||||
This page is an index of error messages you might see in Frigate's logs, what each one means, and where to go next. It is organized by the kind of problem, not by which component logged the message.
|
|
||||||
|
|
||||||
Two things to know before you start:
|
|
||||||
|
|
||||||
- **Many of these messages come from FFmpeg, go2rtc, GPU drivers, or the operating system, not from Frigate itself.** Frigate captures and re-logs their output, so the log level shown in the Frigate UI does not always reflect the original severity.
|
|
||||||
- **Wrapped errors put the real cause on the next line.** When Frigate logs a generic message like `Error occurred when attempting to maintain recording cache`, the actual exception is logged immediately after it. When a camera's FFmpeg process exits, Frigate logs `The following ffmpeg logs include the last 100 lines prior to exit` and dumps that camera's FFmpeg output. Always read those lines, they are where the answer usually is.
|
|
||||||
|
|
||||||
## Camera connection and streams
|
|
||||||
|
|
||||||
<FaqItem id="connection-refused-no-route-to-host-401-404" question="Connection refused / No route to host / 401 Unauthorized / 404 Not Found">
|
|
||||||
|
|
||||||
These are FFmpeg errors about reaching the camera (or the go2rtc restream). `Connection refused` and `No route to host` mean nothing is listening at that address or the host is unreachable; `401 Unauthorized` is wrong credentials; `404 Not Found` is a wrong stream path (or a `restream` input pointing at a go2rtc stream name that does not exist). A camera that has hit its concurrent-connection limit can also return `refused` or `401` on a URL that works in VLC.
|
|
||||||
|
|
||||||
See [go2rtc troubleshooting](/troubleshooting/go2rtc#1-read-the-go2rtc-logs) for how to isolate the stream.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="no-frames-received-in-20-seconds" question="No frames received from <camera> in 20 seconds. Exiting ffmpeg...">
|
|
||||||
|
|
||||||
FFmpeg is running but has stopped delivering video for 20 seconds, so Frigate's camera watchdog restarts it. The stream connected at least once, then went quiet: a camera reboot, a network drop, the camera evicting the connection, or a stalled decoder. If it repeats on a loop, the stream is unstable.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="ffmpeg-process-crashed-unexpectedly" question="Ffmpeg process crashed unexpectedly for <camera>">
|
|
||||||
|
|
||||||
The detect FFmpeg process exited on its own. This message is only the notification; the cause is in the 100 FFmpeg log lines Frigate dumps right after it (look for a `Failed to sync surface`, `Connection refused`, codec, or audio error in that block). Related watchdog messages include `<camera> exceeded fps limit`, which means the camera is delivering frames faster than `detect.fps` (usually a camera whose real frame rate differs from what is configured).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="non-monotonically-increasing-dts" question="Non-monotonic DTS / non monotonically increasing dts to muxer / Queue input is backward in time">
|
|
||||||
|
|
||||||
These are FFmpeg messages indicating the camera sent packets with out-of-order timestamps, either on the video or the audio stream. Timestamp jitter like this is common with WiFi cameras and restreamed or proxied sources; other causes are a camera "Smart Codec" / H.264+ / H.265+ mode or a camera clock that jumps. A sustained flood of these messages usually precedes the stream stalling and the watchdog restarting FFmpeg.
|
|
||||||
|
|
||||||
In most cases, the fix is to improve the network, reduce system resource usage, or switch to non-WiFi cameras. In general, WiFi cameras are [not recommended](https://ipcamtalk.com/threads/multiple-cameras-high-bandwidth.77100/#post-861110).
|
|
||||||
|
|
||||||
On the video stream, this can affect recordings: because they are copied without re-encoding, FFmpeg cannot fix the timestamps, and the segment muxer often splits early, producing one-second segments and a cache backlog. See [Recordings: segments are only 1 second long](/troubleshooting/recordings#segments-are-only-1-second-long).
|
|
||||||
|
|
||||||
On the audio stream, the messages can come from the output's audio encoding. If the audio stream is the problem, it may help to have go2rtc transcode it by adding `#audio=aac` to the camera's go2rtc stream to produce clean timestamps for everything consuming the restream.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="bad-cseq" question="RTP: PT=xx: bad cseq (packet loss / reordering)">
|
|
||||||
|
|
||||||
An FFmpeg message meaning RTP packets arrived out of sequence, which almost always means the stream is using UDP transport. Frigate's RTSP presets force TCP, so seeing this points at a custom `input_args`, `preset-rtsp-udp`, or a go2rtc source that is not using TCP. Switch to TCP unless your camera is [UDP-only](/configuration/camera_specific#udp-only-cameras).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="error-while-decoding-mb-non-existing-pps" question="error while decoding MB / non-existing PPS referenced (corrupt frames)">
|
|
||||||
|
|
||||||
FFmpeg decoder messages meaning the received video bitstream was incomplete or damaged. A few of these at every stream start are normal (the decoder connected before the first keyframe) and Frigate discards them. A continuous stream of them means real packet loss, from Wi-Fi or a saturated link, an overloaded camera, or an FFmpeg restart loop caused by another problem. Fix the underlying instability rather than the message.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="could-not-find-codec-parameters" question="Could not find codec parameters for stream ... unspecified size">
|
|
||||||
|
|
||||||
An FFmpeg message meaning it probed the stream but never saw enough decodable video to determine the frame size, often because the probe window ended before the first keyframe on a long-GOP stream, or because the stream is not delivering usable video. If it is a Reolink HTTP stream, use `preset-http-reolink`, which raises the probe size for exactly this case.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
## Recording
|
|
||||||
|
|
||||||
<FaqItem id="no-new-recording-segments" question="No new recording segments were created (or: No new valid recording segments were created / No valid segments created since last invalid segment) for <camera> in the last 120s">
|
|
||||||
|
|
||||||
Frigate's record watchdog is restarting the record FFmpeg process because the camera stopped producing usable recordings. The wording distinguishes the cases: `No new recording segments` means no new segment file reached the cache, so ffmpeg isn't getting video out of the record stream; the two `valid` variants mean recordings are arriving but keep failing validation. Either way the fault is on the camera or network side, and the restart is Frigate trying to recover.
|
|
||||||
|
|
||||||
See [Recordings: no new recording segments were created](/troubleshooting/recordings#no-new-recording-segments-were-created).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="invalid-or-missing-video-stream-in-segment" question="Invalid or missing video stream in segment. Discarding. / Discarding a corrupt recording segment / Failed to probe corrupt segment / Invalid recording segment detected">
|
|
||||||
|
|
||||||
A cached recording segment failed validation and was deleted, either because it had no readable video stream or because its length was impossible. This nearly always means the camera stopped sending usable video partway through the segment: a camera that rebooted, dropped the connection, or ran out of simultaneous connections, or an unreliable link such as WiFi or a failing switch port. Broken camera timestamps (a "Smart Codec" / H.264+ mode) cause the corrupt-segment variants. The same stream failure trips the record watchdog, so the restarts above usually appear alongside these messages.
|
|
||||||
|
|
||||||
See [Recordings: invalid or missing video stream in segment](/troubleshooting/recordings#invalid-or-missing-video-stream-in-segment).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="incompatible-audio-codec" question="Recordings silently fail to save (incompatible audio codec)">
|
|
||||||
|
|
||||||
Some camera audio codecs (G.711 variants such as `pcm_alaw` and `pcm_mulaw`) cannot be stored in an MP4 container, so segments never finalize even though live view works.
|
|
||||||
|
|
||||||
See [Recordings: incompatible audio codec](/troubleshooting/recordings#incompatible-audio-codec-recordings-silently-fail-to-save) for the FFmpeg preset that transcodes the audio to AAC.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="error-maintaining-recording-cache" question="Error occurred when attempting to maintain recording cache">
|
|
||||||
|
|
||||||
A generic wrapper; the real exception is on the next log line. Frequently it is `[Errno 28] No space left on device` or `[Errno 17] File exists` on a network share.
|
|
||||||
|
|
||||||
See [Recordings cache warnings and errors](/troubleshooting/recordings#i-see-the-message-error--error-occurred-when-attempting-to-maintain-recording-cache), which covers this message and the common `Errno` cases.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
## Hardware acceleration
|
|
||||||
|
|
||||||
<FaqItem id="failed-to-sync-surface" question="Failed to sync surface / Failed to download frame: -5 / Error while filtering">
|
|
||||||
|
|
||||||
A VAAPI/QSV hardware frame-sync failure between FFmpeg and the GPU driver, not a Frigate bug. It usually appears when the detect stream is being scaled or decoded on the GPU.
|
|
||||||
|
|
||||||
See [GPU: Failed to download frame: -5](/troubleshooting/gpu#failed-to-download-frame--5), which lists the fixes in order (switch VAAPI/QSV preset, change `LIBVA_DRIVER_NAME`, use an H.264 substream, match detect resolution and fps to the stream).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="no-decoder-surfaces-left" question="No decoder surfaces left / Can't allocate a surface">
|
|
||||||
|
|
||||||
Both mean the GPU ran out of decode surfaces: `No decoder surfaces left` is NVIDIA NVDEC, `Can't allocate a surface` is Intel QSV. This is surface-pool exhaustion, typically from too many concurrent hardware-decoded cameras on one GPU (consumer NVIDIA cards have a driver-enforced limit on simultaneous decode sessions). Reduce the number of cameras decoding on that GPU, decode some on the CPU, or move to hardware without the session cap.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="nvidia-container-cli-nvml-error" question="nvidia-container-cli: nvml error: driver not loaded">
|
|
||||||
|
|
||||||
This comes from the NVIDIA container runtime while starting the container, not from Frigate, and the container never starts. The NVIDIA driver is not loaded on the host. Confirm `nvidia-smi` works on the host itself (not inside the container) before troubleshooting Frigate. In a VM or LXC, the driver must be available inside the guest. See [Hardware: Nvidia GPU](/configuration/hardware_acceleration_video).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
## Detectors and models
|
|
||||||
|
|
||||||
<FaqItem id="illegal-instruction" question="Illegal instruction (core dumped)">
|
|
||||||
|
|
||||||
The process was killed by the CPU for executing an unsupported instruction. There are two distinct causes in Frigate:
|
|
||||||
|
|
||||||
- **A Coral EdgeTPU** on a newer kernel with an outdated gasket driver. See [EdgeTPU: Illegal instruction](/troubleshooting/edgetpu#attempting-to-load-tpu-as-pci--fatal-python-error-illegal-instruction).
|
|
||||||
- **A CPU without AVX/AVX2**, when enabling semantic search, face recognition, license plate recognition, classification, or audio transcription. These features use libraries compiled with AVX and crash immediately on CPUs that lack it (commonly Intel Celeron/Pentium before the 2020 Tiger Lake generation). See the [CPU requirements](/frigate/planning_setup#cpu).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="onnx-invalidprotobuf" question="ONNX Runtime InvalidProtobuf / failed to load model">
|
|
||||||
|
|
||||||
ONNX Runtime could not parse the model file. The file exists but its contents are not a valid ONNX model, usually a corrupted or interrupted download in `model_cache`, or the wrong file pointed at by `model.path`. Delete the cached model file so Frigate re-downloads it, and confirm `model.path` points at an actual `.onnx` model. See [ONNX detector configuration](/configuration/object_detectors#onnx).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="cuda-failure-999-901" question="CUDA failure 999 / CUDA failure 901">
|
|
||||||
|
|
||||||
ONNX Runtime CUDA errors. `999` (`cudaErrorUnknown`) is a general, unrecoverable CUDA context failure, usually a driver/runtime version mismatch between the host and the container or a GPU in a bad state. `901` is a CUDA-graph capture error, which points at a custom model whose operations are not capture-safe. For `999`, align the host driver with the container's CUDA version and confirm the GPU is healthy.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="openvino-no-supported-devices" question="Can't get OPTIMIZATION_CAPABILITIES property as no supported devices found">
|
|
||||||
|
|
||||||
OpenVINO could not find the configured device (usually `GPU` or `NPU`). Most often the `/dev/dri` render node is not passed into the container, or the wrong render node is mapped when an iGPU and a discrete GPU coexist.
|
|
||||||
|
|
||||||
See [GPU: no supported devices found](/troubleshooting/gpu#cant-get-optimization_capabilities-property-as-no-supported-devices-found).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
## Memory and storage
|
|
||||||
|
|
||||||
<FaqItem id="fatal-python-error-bus-error" question="Fatal Python error: Bus error">
|
|
||||||
|
|
||||||
Frigate ran out of shared memory (`/dev/shm`). The container's `shm_size` is too small for the number and resolution of your detect streams, or you added cameras after startup without increasing it.
|
|
||||||
|
|
||||||
See [Calculating required shm-size](/frigate/installation#calculating-required-shm-size). If you cannot increase `shm_size`, lowering the `SHM_MAX_FRAMES` environment variable reduces how many frames Frigate buffers per camera.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="errno-28-no-space-left" question="[Errno 28] No space left on device">
|
|
||||||
|
|
||||||
A filesystem is full: the recordings volume (`/media/frigate`), the cache tmpfs (`/tmp/cache`), or `/dev/shm`. Check which one, and note that inode exhaustion can produce this while `df -h` still shows free space.
|
|
||||||
|
|
||||||
See [Recordings: No space left on device](/troubleshooting/recordings#i-see-the-message-error--error-occurred-when-attempting-to-maintain-recording-cache).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="container-exits-with-no-logs" question="The container exits or restarts with no error in the logs">
|
|
||||||
|
|
||||||
A silent exit is usually the host or container out-of-memory killer. Because `/dev/shm` and `/tmp/cache` are memory-backed, they count against the container's memory limit, so aggressive shm or cache sizing can trigger it. Give the container more memory, or reduce shm/cache sizing, and check the host's OOM messages (`dmesg`).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
## Database
|
|
||||||
|
|
||||||
<FaqItem id="database-is-locked" question="database is locked">
|
|
||||||
|
|
||||||
SQLite could not acquire the write lock. Frigate's timeout already scales with camera count, so under normal local-disk operation this essentially only happens when the database is on a network share (SMB/NFS), where file locking is unreliable, or when two instances point at the same file.
|
|
||||||
|
|
||||||
See [Database is locked](/troubleshooting/faqs#error-database-is-locked).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="database-disk-image-is-malformed" question="database disk image is malformed">
|
|
||||||
|
|
||||||
The SQLite database file is corrupted, typically after hard power loss, a network-share database, or a filesystem with unsafe write semantics. Frigate does not repair it automatically, but the database can usually be recovered by hand.
|
|
||||||
|
|
||||||
**Stop Frigate first**, then work on the database file directly (by default `/config/frigate.db`). Start by checking what is actually wrong:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sqlite3 frigate.db "PRAGMA integrity_check;"
|
|
||||||
```
|
|
||||||
|
|
||||||
If the only problems reported are index-related (lines such as `row 14 missing from index recordings_path` or `non-unique entry in index ...`), rebuilding the indexes is usually enough and is the least destructive fix:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sqlite3 frigate.db "REINDEX;"
|
|
||||||
```
|
|
||||||
|
|
||||||
If the integrity check reports page or byte-level corruption instead (for example `Multiple uses for byte 2706 of page 142272`), dump the readable contents into a new database:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# dump what can still be read
|
|
||||||
sqlite3 frigate.db .dump > frigate.dump
|
|
||||||
|
|
||||||
# keep the corrupt file, then rebuild from the dump
|
|
||||||
mv frigate.db frigate.db.bak
|
|
||||||
cat frigate.dump | sqlite3 frigate.db
|
|
||||||
|
|
||||||
# confirm the rebuilt database is clean, this should print "ok"
|
|
||||||
sqlite3 frigate.db "PRAGMA integrity_check;"
|
|
||||||
```
|
|
||||||
|
|
||||||
Rows stored in the corrupted pages cannot be recovered, so expect to lose some tracked objects, review items, or thumbnails. Recordings themselves are files on disk and are not affected.
|
|
||||||
|
|
||||||
As a last resort, stop Frigate, delete `frigate.db`, and restart. Frigate recreates it, but existing recordings lose all of their metadata. If a `backup.db` exists next to your database, Frigate wrote it before the last schema migration and restoring it recovers everything up to that point.
|
|
||||||
|
|
||||||
Repeat corruption usually points at the underlying storage: move the database off a network share, and on Raspberry Pi check power delivery and the SD card or SSD.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
## Startup and web access
|
|
||||||
|
|
||||||
<FaqItem id="unable-to-start-frigate-in-safe-mode" question="Unable to start Frigate in safe mode / Starting Frigate in safe mode">
|
|
||||||
|
|
||||||
When your config fails validation at startup, Frigate prints the validation errors (with line numbers), then starts in **safe mode**: a minimal configuration with no cameras and MQTT disabled, so the UI stays reachable. In safe mode the only available page is the Config Editor, which shows the validation errors so you can fix them, then save and restart. Note that recording retention and storage cleanup do **not** run while in safe mode, so do not leave a low-disk system sitting in it.
|
|
||||||
|
|
||||||
`Unable to start Frigate in safe mode` means even the minimal config failed, which points at an error in your `auth`, `proxy`, or `database` section, or a config file that is not valid YAML at all. Safe mode is not sticky; fix the config and restart and Frigate returns to normal.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="502-bad-gateway" question="502 Bad Gateway / connection refused to 127.0.0.1:5001">
|
|
||||||
|
|
||||||
The web server is up but the Frigate backend (port 5001) is not answering yet. By far the most common reason is that the page was loaded during startup: the API binds last, after database migrations (which can take minutes on a large database), model downloads, and process startup, while the web server is already serving. Wait for startup to finish. If it persists, the backend has failed to start, and the reason is earlier in the logs. This also explains a `connection refused to 127.0.0.1:5001` seen while loading `/ws`, because every authenticated request first makes an auth subrequest to that port.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
@@ -3,31 +3,7 @@ id: cpu
|
|||||||
title: High CPU Usage
|
title: High CPU Usage
|
||||||
---
|
---
|
||||||
|
|
||||||
High CPU usage can impact Frigate's performance and responsiveness. This guide explains how to interpret the CPU values Frigate reports and outlines the most effective configuration changes to help reduce CPU consumption and optimize resource usage.
|
High CPU usage can impact Frigate's performance and responsiveness. This guide outlines the most effective configuration changes to help reduce CPU consumption and optimize resource usage.
|
||||||
|
|
||||||
## Understanding Frigate's Reported CPU Usage
|
|
||||||
|
|
||||||
Frigate's CPU percentages often look much higher than what the host reports. Usually both numbers are correct and are simply measured against different denominators, so confirm you actually have a problem before tuning anything.
|
|
||||||
|
|
||||||
### Per-process values are relative to a single core
|
|
||||||
|
|
||||||
The values Frigate reports for FFmpeg, capture, detect, detector, and other processes follow the same convention as `top`: 100% means one CPU core is fully saturated, not that the whole system is saturated. A multithreaded process such as FFmpeg can legitimately report well over 100%.
|
|
||||||
|
|
||||||
Host and hypervisor tools instead report a percentage of the machine's total capacity across all cores. This includes `docker stats`, the `htop` summary, the Proxmox summary graph, the Unraid dashboard, Synology Resource Monitor, and Home Assistant's system monitor sensors. To reconcile the two:
|
|
||||||
|
|
||||||
```
|
|
||||||
host percentage ≈ (sum of Frigate's process percentages) / (number of cores)
|
|
||||||
```
|
|
||||||
|
|
||||||
On a 4 core system, an FFmpeg process reporting 100% is consuming one quarter of the machine, so the host will show roughly 25 to 30% once the remaining Frigate processes are included. That same 100% on a 16 core system is about 6%. Frigate's own warning thresholds use the per-core convention as well, so an FFmpeg process is flagged at 20% of a single core, not 20% of the system.
|
|
||||||
|
|
||||||
### Instantaneous samples and averages measure different things
|
|
||||||
|
|
||||||
Frigate collects stats every 15 seconds, and the `cpu` value covers only the interval since the previous collection. The `cpu_average` value in the stats API and MQTT payload is the average across the entire life of the process, and it is what the high CPU usage warnings are based on. Host dashboards generally plot data averaged over a longer window, so a single Frigate sample can show a peak that a host graph never displays. A process that has just started, such as FFmpeg after a camera reconnect, reports 0 until it has been sampled twice.
|
|
||||||
|
|
||||||
### The system-wide value depends on what the container can see
|
|
||||||
|
|
||||||
The system CPU value is read from `/proc/stat`. Under Docker that file belongs to the host, so the value covers the entire machine including workloads unrelated to Frigate, and it will not match `docker stats` for the Frigate container. Under an LXC container, lxcfs virtualizes `/proc/stat` and the value reflects only the cores assigned to the container. In a virtual machine, the guest sees only its assigned vCPUs while the hypervisor divides by every physical thread on the node, so guest and host percentages will not agree even when both are accurate.
|
|
||||||
|
|
||||||
## 1. Hardware Acceleration for Video Decoding
|
## 1. Hardware Acceleration for Video Decoding
|
||||||
|
|
||||||
@@ -96,19 +72,3 @@ The model you use significantly impacts detector performance. Frigate provides d
|
|||||||
- Larger models (640x640): Slower inference, can sometimes have higher accuracy on very large objects that take up a majority of the frame.
|
- Larger models (640x640): Slower inference, can sometimes have higher accuracy on very large objects that take up a majority of the frame.
|
||||||
|
|
||||||
For more detail on picking the right size, see [Choosing a model size](../configuration/object_detectors.md#choosing-a-model-size).
|
For more detail on picking the right size, see [Choosing a model size](../configuration/object_detectors.md#choosing-a-model-size).
|
||||||
|
|
||||||
## 3. Reducing Detector CPU Usage
|
|
||||||
|
|
||||||
**Priority: High**
|
|
||||||
|
|
||||||
The **Detector CPU Usage** metric measures the CPU spent converting frames into the tensor format the model expects and post-processing the model's output. It does not include inference, so this value can be high even when you've configured a GPU, NPU, or Coral for object detection.
|
|
||||||
|
|
||||||
This metric scales with how many detections per second Frigate runs and how expensive each one is to prepare. Tuning [motion detection](../configuration/motion_detection) is usually the first recommendation to reduce the number of detections. Additionally, you can:
|
|
||||||
|
|
||||||
- **Lower `detect -> fps`.** 5 is the recommended value for nearly all cameras. Running at 10 doubles the frames eligible for detection and is one of the largest contributors to this metric.
|
|
||||||
- **Use a 320x320 model.** A 640x640 model has 4 times as many pixels to transpose, convert, and copy on every inference.
|
|
||||||
- **Prefer a model that takes integer input.** Models configured with `input_dtype: float` require each frame to be converted to float32 and normalized on the CPU first. Models taking `int` input, such as the tflite models used by the Edge TPU, skip that step.
|
|
||||||
- **Do not match the detect resolution to the model resolution.** The detect stream should match your camera's aspect ratio, for example `1280x720`, not the model's input size. Frigate crops and scales regions of motion itself, so an oversized detect stream only adds work.
|
|
||||||
- **Tune stationary object behavior.** Objects that never settle into a stationary state are re-detected continuously. Raising `detect -> stationary -> interval` reduces how often detection runs on objects that are already parked. See [stationary objects](../configuration/stationary_objects).
|
|
||||||
|
|
||||||
Adding [more detector instances](#multiple-detector-instances) spreads this work across more CPU cores, but does not reduce the total CPU used.
|
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ The per-clip variation is typically quite low and is mostly an artifact of keyfr
|
|||||||
|
|
||||||
Debug Replay lets you re-run Frigate's detection pipeline against a section of recorded video without manually configuring a dummy camera. It automatically extracts the recording, creates a temporary camera with the same detection settings as the original, and loops the clip through the pipeline so you can observe detections in real time.
|
Debug Replay lets you re-run Frigate's detection pipeline against a section of recorded video without manually configuring a dummy camera. It automatically extracts the recording, creates a temporary camera with the same detection settings as the original, and loops the clip through the pipeline so you can observe detections in real time.
|
||||||
|
|
||||||
The replay camera behaves like a live camera feed rather than History's video player: it loops the clip continuously as Frigate analyzes it and has no playback controls, so you cannot pause, scrub, or step through it frame by frame. The Debug Replay camera does not save recordings or snapshots or surface anything in Explore, but it otherwise behaves like a regular camera, including running enrichments such as Face Recognition, LPR, and custom classification.
|
Debug Replay isn't intended to be a one-stop pane for all Frigate diagnostics or a comprehensive debugging environment for every Frigate feature. It merely makes it easier to spin up a "dummy camera" and perform some common adjustments in real-time. You'll still need to use the normal tools (logs, an MQTT client, etc) to debug your feature.
|
||||||
|
|
||||||
Debug Replay isn't intended to be a one-stop pane for all Frigate diagnostics or a comprehensive debugging environment for every Frigate feature. It merely makes it easier to spin up a "dummy camera" and perform some common adjustments in real time. You'll still need to use the normal tools (logs, an MQTT client, etc) to debug your feature.
|
|
||||||
|
|
||||||
### When to use
|
### When to use
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ There are many possible causes for a USB coral not being detected and some are O
|
|||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
|
|
||||||
Using `lsusb` or checking the hardware page in HA OS will show as `1a6e:089a Global Unichip Corp.` until Frigate runs an inference using the coral. So don't worry about the identification until after Frigate has attempted to detect the coral.
|
Using `lsusb` or checking the hardware page in HA OS will show as `1a6e:089a Global Unichip Corp.` until Frigate runs an inferance using the coral. So don't worry about the identification until after Frigate has attempted to detect the coral.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -43,13 +43,13 @@ Some users have reported that this older device runs an older kernel causing iss
|
|||||||
3. Start the docker container with Coral TPU enabled in the config
|
3. Start the docker container with Coral TPU enabled in the config
|
||||||
4. The TPU would be detected but a few moments later it would disconnect.
|
4. The TPU would be detected but a few moments later it would disconnect.
|
||||||
5. While leaving the TPU device plugged in, restart the NAS using the reboot command in the UI. Do NOT unplug the NAS/power it off etc.
|
5. While leaving the TPU device plugged in, restart the NAS using the reboot command in the UI. Do NOT unplug the NAS/power it off etc.
|
||||||
6. Open the control panel - info screen. The coral TPU will now be recognized as a USB Device - google inc
|
6. Open the control panel - info scree. The coral TPU will now be recognised as a USB Device - google inc
|
||||||
7. Start the frigate container. Everything should work now!
|
7. Start the frigate container. Everything should work now!
|
||||||
|
|
||||||
### QNAP NAS
|
### QNAP NAS
|
||||||
|
|
||||||
QNAP NAS devices, such as the TS-253A, may use connected Coral TPU devices if [QuMagie](https://www.qnap.com/en/software/qumagie) is installed along with its QNAP AI Core extension. If any of the features (`facial recognition`, `object recognition`, or `similar photo recognition`) are enabled, Container Station applications such as `Frigate` or `CodeProject.AI Server` will be unable to initialize the TPU device in use.
|
QNAP NAS devices, such as the TS-253A, may use connected Coral TPU devices if [QuMagie](https://www.qnap.com/en/software/qumagie) is installed along with its QNAP AI Core extension. If any of the features (`facial recognition`, `object recognition`, or `similar photo recognition`) are enabled, Container Station applications such as `Frigate` or `CodeProject.AI Server` will be unable to initialize the TPU device in use.
|
||||||
To allow the Coral TPU device to be discovered, you must either:
|
To allow the Coral TPU device to be discovered, the you must either:
|
||||||
|
|
||||||
1. [Disable the AI recognition features in QuMagie](https://docs.qnap.com/application/qumagie/2.x/en-us/configuring-qnap-ai-core-settings-FB13CE03.html),
|
1. [Disable the AI recognition features in QuMagie](https://docs.qnap.com/application/qumagie/2.x/en-us/configuring-qnap-ai-core-settings-FB13CE03.html),
|
||||||
2. Remove the QNAP AI Core extension or
|
2. Remove the QNAP AI Core extension or
|
||||||
@@ -76,7 +76,7 @@ This is an issue due to outdated gasket driver when being used with new linux ke
|
|||||||
|
|
||||||
### Not detected on Raspberry Pi5
|
### Not detected on Raspberry Pi5
|
||||||
|
|
||||||
A kernel update to the RPi5 means an update to config.txt is required, see [the raspberry pi forum for more info](https://forums.raspberrypi.com/viewtopic.php?t=363682&sid=cb59b026a412f0dc041595951273a9ca&start=25)
|
A kernel update to the RPi5 means an upate to config.txt is required, see [the raspberry pi forum for more info](https://forums.raspberrypi.com/viewtopic.php?t=363682&sid=cb59b026a412f0dc041595951273a9ca&start=25)
|
||||||
|
|
||||||
Specifically, add the following to config.txt
|
Specifically, add the following to config.txt
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ dtoverlay=pcie-32bit-dma-pi5
|
|||||||
|
|
||||||
## Only One PCIe Coral Is Detected With Coral Dual EdgeTPU
|
## Only One PCIe Coral Is Detected With Coral Dual EdgeTPU
|
||||||
|
|
||||||
Coral Dual EdgeTPU is one card with two identical TPU cores. Each core has its own PCIe interface and motherboard needs to have two PCIe busses on the m.2 slot to make them both work.
|
Coral Dual EdgeTPU is one card with two identical TPU cores. Each core has it's own PCIe interface and motherboard needs to have two PCIe busses on the m.2 slot to make them both work.
|
||||||
|
|
||||||
E-key slot implemented to full m.2 electromechanical specification has two PCIe busses. Most motherboard manufacturers implement only one PCIe bus in m.2 E-key connector (this is why only one TPU is working). Some SBCs can have only USB bus on m.2 connector, ie none of TPUs will work.
|
E-key slot implemented to full m.2 electromechanical specification has two PCIe busses. Most motherboard manufacturers implement only one PCIe bus in m.2 E-key connector (this is why only one TPU is working). Some SBCs can have only USB bus on m.2 connector, ie none of TPUs will work.
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ You can open `chrome://media-internals/` in another tab and then try to playback
|
|||||||
|
|
||||||
### What do I do if my cameras sub stream is not good enough?
|
### What do I do if my cameras sub stream is not good enough?
|
||||||
|
|
||||||
Frigate generally [recommends cameras with configurable sub streams](/frigate/hardware.md). However, if your camera does not have a sub stream that is a suitable resolution, the main stream can be resized.
|
Frigate generally [recommends cameras with configurable sub streams](/frigate/hardware.md). However, if your camera does not have a sub stream that a suitable resolution, the main stream can be resized.
|
||||||
|
|
||||||
To do this efficiently the following setup is required:
|
To do this efficiently the following setup is required:
|
||||||
|
|
||||||
@@ -39,20 +39,6 @@ To do this efficiently the following setup is required:
|
|||||||
|
|
||||||
When this is done correctly, the GPU will do the decoding and scaling which will result in a small increase in CPU usage but with better results.
|
When this is done correctly, the GPU will do the decoding and scaling which will result in a small increase in CPU usage but with better results.
|
||||||
|
|
||||||
### How can I rotate my camera's video feed?
|
|
||||||
|
|
||||||
Rotation is best done in the camera's firmware settings (usually called rotate, flip, or corridor mode) so the video arrives already rotated and no extra processing is needed. Check there first.
|
|
||||||
|
|
||||||
If your camera does not support rotation, go2rtc's ffmpeg module can rotate the stream with the `#rotate` parameter (`90`, `180`, `270`, or `-90`), but this is not recommended: rotation requires transcoding (re-encoding) the video, which significantly increases CPU usage, especially for high resolution streams.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
go2rtc:
|
|
||||||
streams:
|
|
||||||
my_camera: "ffmpeg:rtsp://user:password@192.168.1.10:554/stream#video=h264#hardware#rotate=90"
|
|
||||||
```
|
|
||||||
|
|
||||||
Point the camera's inputs at the restream as described in the [restream docs](/configuration/restream.md), and swap `detect -> width` and `detect -> height` to match the rotated resolution.
|
|
||||||
|
|
||||||
### My mjpeg stream or snapshots look green and crazy
|
### My mjpeg stream or snapshots look green and crazy
|
||||||
|
|
||||||
This almost always means that the width/height defined for your camera are not correct. Double check the resolution with VLC or another player. Also make sure you don't have the width and height values backwards.
|
This almost always means that the width/height defined for your camera are not correct. Double check the resolution with VLC or another player. Also make sure you don't have the width and height values backwards.
|
||||||
@@ -79,17 +65,9 @@ This is because Frigate does not run in host mode so localhost points to the Fri
|
|||||||
|
|
||||||
### How do I know if my camera is offline
|
### How do I know if my camera is offline
|
||||||
|
|
||||||
Frigate publishes a per-role health status to [`frigate/<camera_name>/status/<role>`](/integrations/mqtt#frigatecamera_namestatusrole), where `<role>` is each enabled role on the camera (`detect`, `record`, and `audio`). The published value is one of:
|
A camera being offline can be detected via MQTT or /api/stats, the camera_fps for any offline camera will be 0.
|
||||||
|
|
||||||
- `online`: Frigate's process for that role is running normally
|
Also, Home Assistant will mark any offline camera as being unavailable when the camera is offline.
|
||||||
- `offline`: the process is down and Frigate is restarting it
|
|
||||||
- `disabled`: the camera is turned off, either at runtime or in the configuration file
|
|
||||||
|
|
||||||
These reflect the state of Frigate's process for that role, not the camera's reachability, so an unreachable camera alternates between `offline` and `online` as the watchdog restarts ffmpeg. Wait for the status to hold steady (for example with Home Assistant's `for:`) rather than acting on a single message.
|
|
||||||
|
|
||||||
Because the status is per role, a camera whose substream is fine but whose recording stream has dropped will report `online` for `detect` and `offline` for `record`. The status is republished whenever it changes.
|
|
||||||
|
|
||||||
You can also detect an offline camera through `/api/stats`, where `camera_fps` will be 0.
|
|
||||||
|
|
||||||
### How can I view the Frigate log files without using the Web UI?
|
### How can I view the Frigate log files without using the Web UI?
|
||||||
|
|
||||||
@@ -147,12 +125,6 @@ cameras:
|
|||||||
height: 720
|
height: 720
|
||||||
```
|
```
|
||||||
|
|
||||||
### What is the `version` key in my config file?
|
|
||||||
|
|
||||||
`version` records the config format that your config was last migrated to. On startup Frigate compares it against the format the running version expects, and if it is older it copies your config to `/config/backup_config.yaml`, rewrites it to the new format, and updates `version` as the final step. A config with no `version` key is assumed to predate 0.14 and is migrated from there.
|
|
||||||
|
|
||||||
Frigate manages this key for you, so do not set or edit it. Raising it makes Frigate skip migrations your config still needs, and lowering it re-runs migrations against config that has already been converted. Either can leave you with a config that no longer validates.
|
|
||||||
|
|
||||||
### Why does Frigate keep creating new tracked objects for my parked car?
|
### Why does Frigate keep creating new tracked objects for my parked car?
|
||||||
|
|
||||||
Stationary tracking is designed to _prevent_ this: a parked car should remain a single tracked object rather than generating new ones. If you're repeatedly getting new tracked objects for the same car, it's likely that Frigate is losing the object and re-detecting it as a new one.
|
Stationary tracking is designed to _prevent_ this: a parked car should remain a single tracked object rather than generating new ones. If you're repeatedly getting new tracked objects for the same car, it's likely that Frigate is losing the object and re-detecting it as a new one.
|
||||||
|
|||||||
@@ -78,9 +78,7 @@ go2rtc:
|
|||||||
|
|
||||||
:::warning
|
:::warning
|
||||||
|
|
||||||
The transcoding modifiers (`#video=`, `#audio=`, `#hardware`, …) **only take effect on a source that is prefixed with `ffmpeg:`**. Adding them to a bare `rtsp://…#audio=opus` source does nothing: go2rtc ignores them. Likewise, when a source references another stream by name (e.g. `ffmpeg:back#audio=aac`), the name must match the stream key **exactly** (it is case sensitive), or the transcode is silently never produced. This is the single most common configuration mistake. In the Frigate UI, the **Use compatibility mode (ffmpeg)** toggle adds the `ffmpeg:` prefix for you.
|
The `#`-modifiers (`#video=`, `#audio=`, `#hardware`, `#backchannel=0`, …) **only take effect on a source that is prefixed with `ffmpeg:`**. Adding them to a bare `rtsp://…#audio=opus` source does nothing: go2rtc ignores them. Likewise, when a source references another stream by name (e.g. `ffmpeg:back#audio=aac`), the name must match the stream key **exactly** (it is case sensitive), or the transcode is silently never produced. This is the single most common configuration mistake. In the Frigate UI, the **Use compatibility mode (ffmpeg)** toggle adds the `ffmpeg:` prefix for you.
|
||||||
|
|
||||||
A bare `rtsp://` source reads a different set of modifiers: `#backchannel=`, `#media=`, `#timeout=`, and `#transport=`. These do nothing on an `ffmpeg:` source. Adding **any** modifier to a bare `rtsp://` source also disables the camera's backchannel unless the URL explicitly contains `#backchannel=1`, so a stream dedicated to two-way talk should carry no modifiers at all.
|
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@@ -155,7 +153,7 @@ WebRTC is only attempted when MSE fails or when using a camera's two-way talk fe
|
|||||||
|
|
||||||
- **Codec mismatch**: WebRTC cannot carry H.265 or AAC. The stream backing the WebRTC view must provide Opus (or PCMA/PCMU) audio and H.264 video. Add an `ffmpeg:back#audio=opus` source as shown above.
|
- **Codec mismatch**: WebRTC cannot carry H.265 or AAC. The stream backing the WebRTC view must provide Opus (or PCMA/PCMU) audio and H.264 video. Add an `ffmpeg:back#audio=opus` source as shown above.
|
||||||
- **Port `8555` not reachable, or no candidates set**: WebRTC needs port `8555` (both TCP and UDP) open and a reachable candidate advertised. On Docker installs running on a custom/overlay network, go2rtc may advertise unreachable container IPs as ICE candidates; setting `webrtc.filters.candidates: []` and supplying only your host's LAN IP resolves this. See [WebRTC extra configuration](/configuration/live#webrtc-extra-configuration).
|
- **Port `8555` not reachable, or no candidates set**: WebRTC needs port `8555` (both TCP and UDP) open and a reachable candidate advertised. On Docker installs running on a custom/overlay network, go2rtc may advertise unreachable container IPs as ICE candidates; setting `webrtc.filters.candidates: []` and supplying only your host's LAN IP resolves this. See [WebRTC extra configuration](/configuration/live#webrtc-extra-configuration).
|
||||||
- **Two-way talk** additionally requires a secure context (HTTPS or the authenticated port `8971`, because browsers block microphone access on plain HTTP). The camera's RTSP backchannel must also be handled correctly: go2rtc seizes the backchannel by default, which blocks two-way audio for other consumers and can inject static. Disable it on the primary stream with `#backchannel=0` and use a separate dedicated stream for talk, carrying no `#` modifiers of any kind, as documented in [preventing go2rtc from blocking two-way audio](/configuration/restream#two-way-talk-restream).
|
- **Two-way talk** additionally requires a secure context (HTTPS or the authenticated port `8971`, because browsers block microphone access on plain HTTP). The camera's RTSP backchannel must also be handled correctly: go2rtc seizes the backchannel by default, which blocks two-way audio for other consumers and can inject static. Disable it on the primary stream with `#backchannel=0` and use a separate dedicated stream for talk, as documented in [preventing go2rtc from blocking two-way audio](/configuration/restream#two-way-talk-restream).
|
||||||
|
|
||||||
## High CPU usage
|
## High CPU usage
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ id: recordings
|
|||||||
title: Recordings Errors
|
title: Recordings Errors
|
||||||
---
|
---
|
||||||
|
|
||||||
import FaqItem from "@site/src/components/FaqItem";
|
|
||||||
|
|
||||||
## Why are my recordings not working? (empty Recordings, "No recordings found for this time")
|
## Why are my recordings not working? (empty Recordings, "No recordings found for this time")
|
||||||
|
|
||||||
If Frigate shows live video but the History view is empty, or you see "No recordings found for this time", the cause is almost always in one of the three categories below. Segments are first written to the RAM cache and are only moved to disk if they match a retention policy _and_ the camera's `record` stream is producing valid, storable video. Work through the categories in order: retention configuration is by far the most common cause.
|
If Frigate shows live video but the History view is empty, or you see "No recordings found for this time", the cause is almost always in one of the three categories below. Segments are first written to the RAM cache and are only moved to disk if they match a retention policy _and_ the camera's `record` stream is producing valid, storable video. Work through the categories in order: retention configuration is by far the most common cause.
|
||||||
@@ -21,7 +19,7 @@ A healthy camera logs lines like `Copied /media/frigate/recordings/{segment_path
|
|||||||
|
|
||||||
### Retention configuration issues
|
### Retention configuration issues
|
||||||
|
|
||||||
<FaqItem id="recording-is-enabled-but-nothing-is-saved" question="Recording is enabled, but nothing is saved">
|
#### Recording is enabled, but nothing is saved
|
||||||
|
|
||||||
This is the single most common cause. Setting `record.enabled: True` on its own does **not** keep any footage: **continuous recording is disabled by default**, and segments in the cache are only moved to disk if they match a configured retention policy. You must configure at least one of `continuous`, `motion`, `alerts`, or `detections` retention.
|
This is the single most common cause. Setting `record.enabled: True` on its own does **not** keep any footage: **continuous recording is disabled by default**, and segments in the cache are only moved to disk if they match a configured retention policy. You must configure at least one of `continuous`, `motion`, `alerts`, or `detections` retention.
|
||||||
|
|
||||||
@@ -36,9 +34,7 @@ record:
|
|||||||
|
|
||||||
See [Recording](/configuration/record) for the full set of common configurations, including reduced-storage and alerts-only setups.
|
See [Recording](/configuration/record) for the full set of common configurations, including reduced-storage and alerts-only setups.
|
||||||
|
|
||||||
</FaqItem>
|
#### Motion or event-only recording keeps less than you expect
|
||||||
|
|
||||||
<FaqItem id="motion-or-event-only-recording-keeps-less-than-you-expect" question="Motion or event-only recording keeps less than you expect">
|
|
||||||
|
|
||||||
If you only configured `motion`, `alerts`, or `detections` retention (with no `continuous`), Frigate keeps footage selectively based on the retention `mode`:
|
If you only configured `motion`, `alerts`, or `detections` retention (with no `continuous`), Frigate keeps footage selectively based on the retention `mode`:
|
||||||
|
|
||||||
@@ -48,26 +44,20 @@ If you only configured `motion`, `alerts`, or `detections` retention (with no `c
|
|||||||
|
|
||||||
If you expected continuous footage but only configured motion/event retention, add a `continuous` retention period as shown above. To verify motion is actually being detected, watch the motion boxes in the debug view or the Motion Tuner in the UI.
|
If you expected continuous footage but only configured motion/event retention, add a `continuous` retention period as shown above. To verify motion is actually being detected, watch the motion boxes in the debug view or the Motion Tuner in the UI.
|
||||||
|
|
||||||
</FaqItem>
|
#### Alert and detection recordings require working object detection
|
||||||
|
|
||||||
<FaqItem id="alert-and-detection-recordings-require-working-object-detection" question="Alert and detection recordings require working object detection">
|
|
||||||
|
|
||||||
`alerts` and `detections` retention only keep footage that overlaps a tracked object, so they depend on object detection running:
|
`alerts` and `detections` retention only keep footage that overlaps a tracked object, so they depend on object detection running:
|
||||||
|
|
||||||
- **Detection must be enabled.** If `detect: enabled: False`, no alerts or detections are ever created, so alert/detection retention keeps nothing. (Continuous and motion retention still work with detection disabled.)
|
- **Detection must be enabled.** If `detect: enabled: False`, no alerts or detections are ever created, so alert/detection retention keeps nothing. (Continuous and motion retention still work with detection disabled.)
|
||||||
- **The object must be supported by your model.** If you track an object your model doesn't support (for example `deer` or `license_plate` on the default model), Frigate never detects it and never records for it. Check your logs for warnings such as `... is configured to track ['deer'] objects, which are not supported by the current model` and remove unsupported objects or switch to a model (e.g. [Frigate+](/plus/)) that includes them.
|
- **The object must be supported by your model.** If you track an object your model doesn't support (for example `deer` or `license_plate` on the default model), Frigate never detects it and never records for it. Check your logs for warnings such as `... is configured to track ['deer'] objects, which are not supported by the current model` and remove unsupported objects or switch to a model (e.g. [Frigate+](/plus/)) that includes them.
|
||||||
|
|
||||||
</FaqItem>
|
#### You're following an outdated guide
|
||||||
|
|
||||||
<FaqItem id="youre-following-an-outdated-guide" question="You're following an outdated guide">
|
|
||||||
|
|
||||||
Configuration keys change between major versions. The old `clips` config, for example, has not existed for a long time. If you copied a config from an old blog post or video, verify every key against the current [reference config](/configuration/advanced/reference).
|
Configuration keys change between major versions. The old `clips` config, for example, has not existed for a long time. If you copied a config from an old blog post or video, verify every key against the current [reference config](/configuration/advanced/reference).
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
### Camera and stream issues
|
### Camera and stream issues
|
||||||
|
|
||||||
<FaqItem id="incompatible-audio-codec-recordings-silently-fail-to-save" question="Incompatible audio codec (recordings silently fail to save)">
|
#### Incompatible audio codec (recordings silently fail to save)
|
||||||
|
|
||||||
Frigate stores recordings in an MP4 container, and some camera audio codecs (most commonly `pcm_alaw`, `pcm_mulaw`, or other G.711 variants) **cannot be placed in an MP4 container**. When this happens, ffmpeg fails to write the segment and no recording is saved, even though the live view works fine. This is a frequent cause on Tapo, TP-Link VIGI, and some Reolink cameras.
|
Frigate stores recordings in an MP4 container, and some camera audio codecs (most commonly `pcm_alaw`, `pcm_mulaw`, or other G.711 variants) **cannot be placed in an MP4 container**. When this happens, ffmpeg fails to write the segment and no recording is saved, even though the live view works fine. This is a frequent cause on Tapo, TP-Link VIGI, and some Reolink cameras.
|
||||||
|
|
||||||
@@ -82,9 +72,7 @@ cameras:
|
|||||||
# or preset-record-generic to record with no audio
|
# or preset-record-generic to record with no audio
|
||||||
```
|
```
|
||||||
|
|
||||||
</FaqItem>
|
#### The record stream isn't connecting
|
||||||
|
|
||||||
<FaqItem id="the-record-stream-isnt-connecting" question="The record stream isn't connecting">
|
|
||||||
|
|
||||||
A message like `No new recording segments were created for <camera> in the last 120s` means ffmpeg cannot read the `record` stream. To diagnose:
|
A message like `No new recording segments were created for <camera> in the last 120s` means ffmpeg cannot read the `record` stream. To diagnose:
|
||||||
|
|
||||||
@@ -93,11 +81,17 @@ A message like `No new recording segments were created for <camera> in the last
|
|||||||
- Test the exact RTSP URL (with the correct path, port, and credentials) in VLC or `ffplay`.
|
- Test the exact RTSP URL (with the correct path, port, and credentials) in VLC or `ffplay`.
|
||||||
- If you restream through go2rtc, make sure the `record` input path points at the correct go2rtc stream name. Copying a config between cameras without updating the stream name is a common mistake.
|
- If you restream through go2rtc, make sure the `record` input path points at the correct go2rtc stream name. Copying a config between cameras without updating the stream name is a common mistake.
|
||||||
|
|
||||||
</FaqItem>
|
#### Recordings play back with no video (or won't play at all)
|
||||||
|
|
||||||
|
Frigate copies the `record` stream directly without re-encoding, so playback depends on your browser supporting the camera's codec. H265/HEVC recordings may not be playable in some browsers. If recordings appear as audio-only or a black screen, your camera is likely sending a codec your browser can't decode. Configure the camera to output **H264** for maximum compatibility.
|
||||||
|
|
||||||
|
#### Segments are only ~1 second long
|
||||||
|
|
||||||
|
If the record stream uses a "Smart Codec"/H.264+ mode or changes encoding parameters mid-stream, corrupt timestamps cause segments to be split far too frequently and fill the cache. This produces the "Too many unprocessed recording segments" warning. See [that section below](#i-see-the-message-warning--too-many-unprocessed-recording-segments-in-cache-for-camera-this-likely-indicates-an-issue-with-the-detect-stream) for the full diagnosis.
|
||||||
|
|
||||||
### Storage and mounting issues
|
### Storage and mounting issues
|
||||||
|
|
||||||
<FaqItem id="the-storage-volume-isnt-mounted-correctly" question="The storage volume isn't mounted correctly">
|
#### The storage volume isn't mounted correctly
|
||||||
|
|
||||||
If the recordings volume (`/media/frigate`) points at the wrong location, isn't writable, or a network/encrypted mount failed to mount at boot, Frigate cannot save recordings, or it silently writes to the boot drive and then purges aggressively because the drive appears far smaller than expected.
|
If the recordings volume (`/media/frigate`) points at the wrong location, isn't writable, or a network/encrypted mount failed to mount at boot, Frigate cannot save recordings, or it silently writes to the boot drive and then purges aggressively because the drive appears far smaller than expected.
|
||||||
|
|
||||||
@@ -106,158 +100,21 @@ If the recordings volume (`/media/frigate`) points at the wrong location, isn't
|
|||||||
- For a mount that may fail intermittently, protecting the mount point with `chattr +i` on an empty directory forces Frigate to error out (rather than silently writing to the boot drive) when the mount is missing.
|
- For a mount that may fail intermittently, protecting the mount point with `chattr +i` on an empty directory forces Frigate to error out (rather than silently writing to the boot drive) when the mount is missing.
|
||||||
- Check `dmesg` and system logs for filesystem or I/O errors around the time recordings disappeared.
|
- Check `dmesg` and system logs for filesystem or I/O errors around the time recordings disappeared.
|
||||||
|
|
||||||
If recordings _are_ being written but the copy is too slow to keep up, see the ["Unable to keep up with recording segments"](#i-see-the-message-warning--unable-to-keep-up-with-recording-segments-in-cache-for-camera-keeping-the-5-most-recent-segments-out-of-6-and-discarding-the-rest) question below.
|
If recordings _are_ being written but the copy is too slow to keep up, see the ["Unable to keep up with recording segments"](#i-see-the-message-warning--unable-to-keep-up-with-recording-segments-in-cache-for-camera-keeping-the-5-most-recent-segments-out-of-6-and-discarding-the-rest) section below.
|
||||||
|
|
||||||
</FaqItem>
|
## I have Frigate configured for motion recording only, but it still seems to be recording even with no motion. Why?
|
||||||
|
|
||||||
## Recordings won't play back
|
You'll want to:
|
||||||
|
|
||||||
<FaqItem id="pipeline-error-decode" question={"Recordings won't play back: \"PIPELINE_ERROR_DECODE\" (or \"Media failed to decode\")"}>
|
- Make sure your camera's timestamp is masked out with a motion mask. Even if there is no motion occurring in your scene, your motion settings may be sensitive enough to count your timestamp as motion.
|
||||||
|
- If you have audio detection enabled, keep in mind that audio that is heard above `min_volume` is considered motion.
|
||||||
|
- [Tune your motion detection settings](/configuration/motion_detection) either by editing your config file or by using the UI's Motion Tuner.
|
||||||
|
|
||||||
When a recording refuses to play in the Frigate UI and you see an error like `Failed to play recordings (error 3): PIPELINE_ERROR_DECODE`, the message is coming from **your browser**, not from Frigate. `PIPELINE_ERROR_DECODE` is emitted exclusively by the media pipeline in **Chromium-based browsers** (Chrome, Edge, Brave, Vivaldi, Opera, Arc, and the Android WebView used by many in-app browsers) when the browser cannot decode a video or audio packet in the recording. WebKit browsers (Safari) report the same underlying problem with a different message, usually `Media failed to decode` or `DECODER_ERROR_NOT_SUPPORTED`.
|
## I see the message: WARNING : Unable to keep up with recording segments in cache for camera. Keeping the 5 most recent segments out of 6 and discarding the rest...
|
||||||
|
|
||||||
Frigate copies the `record` stream to disk **without re-encoding it**, so the browser must decode exactly what your camera produced, and Chromium's decoder is far stricter about malformed or nonstandard media than VLC or ffmpeg.
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
The same recording playing perfectly in VLC, decoding cleanly with `ffprobe`/`ffmpeg`, or having a valid MP4 container does **not** mean the browser can decode it. VLC and ffmpeg are much more tolerant of codec quirks and damaged packets than a browser's media pipeline, so a "valid" file can still trigger `PIPELINE_ERROR_DECODE`. This is outside of Frigate's control, because Frigate never modifies the recording stream.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
#### Step 1: Confirm it is a browser issue
|
|
||||||
|
|
||||||
Open the same recording in **Firefox** or **Safari**. Firefox and Safari both use a different media engine and cannot produce `PIPELINE_ERROR_DECODE`, so if playback works there you have confirmed a client-side codec or decoder problem rather than a bad recording. Switching browsers is a workaround, not a fix; the remaining steps address the root cause so that Chromium browsers work too.
|
|
||||||
|
|
||||||
#### Step 2: Rule out H.265 / HEVC
|
|
||||||
|
|
||||||
Browser support for H.265 (HEVC) is limited and depends on the operating system, GPU, hardware acceleration, and browser version, which makes it the most common cause of this error. Options, in order of reliability:
|
|
||||||
|
|
||||||
- **Record H.264 instead.** Configure the camera's `record`/main stream to output H.264, the most compatible codec across all browsers. See [camera settings recommendations](/configuration/live#camera-settings-recommendations).
|
|
||||||
- **Transcode to H.264 with go2rtc.** If you must keep HEVC on the camera, have go2rtc re-encode the recording stream. This increases CPU usage; add `#hardware` to use the GPU where available:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
go2rtc:
|
|
||||||
streams:
|
|
||||||
your_camera:
|
|
||||||
# transcode video to h264 and audio to aac; #hardware uses the GPU if available
|
|
||||||
- "ffmpeg:rtsp://user:password@CAMERA_IP:554/stream#video=h264#audio=aac#hardware"
|
|
||||||
cameras:
|
|
||||||
your_camera:
|
|
||||||
ffmpeg:
|
|
||||||
inputs:
|
|
||||||
- path: rtsp://127.0.0.1:8554/your_camera
|
|
||||||
input_args: preset-rtsp-restream
|
|
||||||
roles:
|
|
||||||
- record
|
|
||||||
```
|
|
||||||
|
|
||||||
The `#video=h264` parameter only takes effect with the `ffmpeg:` source module; adding it to a plain `rtsp://` go2rtc source does nothing.
|
|
||||||
|
|
||||||
- **Keep HEVC but improve compatibility.** If your browser and OS do support HEVC, set [`apple_compatibility`](/configuration/camera_specific#h265-cameras-via-safari) on the camera. Some players (Safari and other clients) require a specific HEVC stream format that this option corrects:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
cameras:
|
|
||||||
your_camera:
|
|
||||||
ffmpeg:
|
|
||||||
apple_compatibility: true
|
|
||||||
```
|
|
||||||
|
|
||||||
You may also need to enable HEVC and hardware decoding in the browser itself (for example, Chrome's Settings → System → "Use hardware acceleration when available"). HEVC hardware support varies widely by GPU, OS, and browser version.
|
|
||||||
|
|
||||||
#### Step 3: Clean up damaged packets from the camera
|
|
||||||
|
|
||||||
If the error is **intermittent** (the same recording plays after a page refresh, or fails only after playing for a while), the camera is most likely emitting occasional corrupt or malformed packets. Some camera models are more prone to this than others. Routing the stream through go2rtc's `ffmpeg` module often "cleans up" the stream enough for the browser to decode it, even without changing the codec:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
go2rtc:
|
|
||||||
streams:
|
|
||||||
your_camera:
|
|
||||||
- "ffmpeg:rtsp://user:password@CAMERA_IP:554/stream#video=h264#audio=aac"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Step 4: Fix incompatible or corrupt audio
|
|
||||||
|
|
||||||
Audio is one of the most common culprits, and a decode failure on the audio track fails the whole recording. Make sure the camera outputs **AAC** audio, transcode the audio to AAC with go2rtc (`#audio=aac`), or drop audio entirely. See [Incompatible audio codec](#incompatible-audio-codec-recordings-silently-fail-to-save) for a preset-based way to do this.
|
|
||||||
|
|
||||||
#### Step 5: Avoid "smart" / "+" codecs and check the keyframe interval
|
|
||||||
|
|
||||||
- Disable any **"Smart Codec"**, **"H.264+"**, or **"H.265+"** feature in the camera. These nonstandard modes drop keyframes and change encoding parameters mid-stream, producing exactly the kind of packets a browser refuses to decode. (They also cause [short recording segments](#segments-are-only-1-second-long).)
|
|
||||||
- Set the camera's **I-frame (keyframe) interval equal to the frame rate** (for example `20` for a 20 fps stream). Long keyframe intervals slow the start of playback and make decode errors more likely.
|
|
||||||
|
|
||||||
#### Step 6: Consider bitrate and the client hardware
|
|
||||||
|
|
||||||
The browser decodes the video locally, so a stream that is too demanding can fail on one device while playing on another:
|
|
||||||
|
|
||||||
- A **very high bitrate or resolution** (for example a 4K/8MP HEVC main stream) can overwhelm a low-power tablet, phone, or SBC and stall the decoder. Test the same recording on a desktop; if it plays there, lower the camera's bitrate or record a lower-resolution profile.
|
|
||||||
- Errors that name the client's GPU decoder, such as `VaapiVideoDecoder: failed Initialize()ing the frame pool`, indicate a browser hardware-decode problem. Toggling the browser's "Use hardware acceleration" setting (on or off) often resolves these.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="recordings-play-back-with-no-video-or-wont-play-at-all" question="Recordings play back with no video (or won't play at all)">
|
|
||||||
|
|
||||||
Frigate copies the `record` stream directly without re-encoding, so playback depends on your browser supporting the camera's codec. H265/HEVC recordings may not be playable in some browsers. If recordings appear as audio-only or a black screen, your camera is likely sending a codec your browser can't decode. Configure the camera to output **H264** for maximum compatibility.
|
|
||||||
|
|
||||||
If playback instead fails with an explicit `PIPELINE_ERROR_DECODE` or `Media failed to decode` error, see [Recordings won't play back with "PIPELINE_ERROR_DECODE"](#pipeline-error-decode) above.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
## Recording cache warnings and errors
|
|
||||||
|
|
||||||
<FaqItem id="segments-are-only-1-second-long" question="Segments are only ~1 second long">
|
|
||||||
|
|
||||||
If the record stream uses a "Smart Codec"/H.264+ mode or changes encoding parameters mid-stream, corrupt timestamps cause segments to be split far too frequently and fill the cache. This produces the "Too many unprocessed recording segments" warning. See [that question below](#i-see-the-message-warning--too-many-unprocessed-recording-segments-in-cache-for-camera-this-likely-indicates-an-issue-with-the-detect-stream) for the full diagnosis.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="invalid-or-missing-video-stream-in-segment" question="I see the message: WARNING : Invalid or missing video stream in segment ... Discarding.">
|
|
||||||
|
|
||||||
Every recording segment is validated before it leaves the cache. Frigate probes each finished `.mp4` in `/tmp/cache` and requires a readable video stream and a valid duration before moving to storage. A segment that fails is deleted, so those ~10 seconds of footage are lost. Three messages come from this check:
|
|
||||||
|
|
||||||
- `Invalid or missing video stream in segment <path>. Discarding.` The segment holds no video, or could not be read at all.
|
|
||||||
- `Failed to probe corrupt segment <path>` followed by `Discarding a corrupt recording segment: <path>`. The segment was read, but its length could not be determined.
|
|
||||||
- `Discarding a corrupt recording segment: <path>` on its own. The segment's length is impossible (empty, or longer than ten minutes), which points at broken timestamps coming from the camera.
|
|
||||||
|
|
||||||
For each one, the camera watchdog also logs `Invalid recording segment detected for <camera> at <timestamp>`.
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
This is almost always a **camera or network problem**, not a Frigate one. A segment is only complete once ffmpeg has finished writing it, so anything that interrupts the stream partway through leaves behind a file that cannot be saved. Frigate is reporting the interruption, not causing it.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
#### Start with the camera and the network
|
|
||||||
|
|
||||||
- **The camera dropped the connection.** Cameras reboot, reinitialize their stream when switching to night mode, and cut clients off when they are overloaded or out of simultaneous connections. Count everything pulling from the camera at once: Frigate's detect and record streams, go2rtc, a phone app, and any other NVR each use one. Routing all roles through a single [RTSP restream](/configuration/restream#reduce-connections-to-camera) so the camera only ever sees one connection often resolves this by itself.
|
|
||||||
- **The link to the camera is unreliable.** WiFi cameras, powerline adapters, a saturated uplink, a failing switch port, or a marginal cable all produce this pattern, and usually only on one camera at a time. WiFi cameras are [not recommended](https://ipcamtalk.com/threads/multiple-cameras-high-bandwidth.77100/#post-861110).
|
|
||||||
- **The camera cannot reliably send what it is being asked for.** A high bitrate 4K stream can be more than the camera's own hardware can encode and push out under load. Lower the bitrate, or record a lower-resolution profile.
|
|
||||||
- **The camera is using a "Smart Codec", H.264+, or H.265+ mode.** These change encoding parameters mid-stream and produce the broken timestamps behind the corrupt-segment variant. Turn the mode off and set the camera's keyframe interval equal to its frame rate. See [Segments are only ~1 second long](#segments-are-only-1-second-long).
|
|
||||||
|
|
||||||
Read the rest of the Frigate and/or go2rtc log around the **first** occurrence. When the camera or the network is at fault, other messages show up with it, such as `No frames received from <camera> in 20 seconds`, `Non-monotonic DTS`, `RTP: PT=xx: bad cseq`, `error while decoding MB`, or a connection timeout. Each of those is explained in [Common error messages](/troubleshooting/common_errors). To confirm the camera is the source, open its stream in the [go2rtc web interface](/troubleshooting/go2rtc) on port `1984` or play the same URL in VLC, and leave it running long enough for the failures to happen again.
|
|
||||||
|
|
||||||
#### If the camera and network check out
|
|
||||||
|
|
||||||
- **Audio the recording cannot store.** Some cameras send G.711 audio, which cannot be saved in an MP4 and stops segments from finalizing. See [Incompatible audio codec](#incompatible-audio-codec-recordings-silently-fail-to-save).
|
|
||||||
- **Frigate itself was stopped or restarted.** A single warning per camera around a restart is expected and needs no action.
|
|
||||||
- **The system ran out of room or memory.** A full `/tmp/cache`, or the host killing Frigate for using too much memory, cuts off the segment being written. Both leave other errors in the log alongside this one. See [No space left on device](#errno-28-no-space-left-on-device).
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="no-new-recording-segments-were-created" question="I see the message: ERROR : No new recording segments were created for <camera> in the last 120s. Restarting the ffmpeg record process...">
|
|
||||||
|
|
||||||
When a camera stops producing usable recordings for two minutes, Frigate restarts that camera's record process to try to recover. The wording tells you how far the recordings got:
|
|
||||||
|
|
||||||
- **`No new recording segments were created`**: no new segment file showed up in the cache at all, so ffmpeg isn't getting video out of the record stream. The camera is unreachable or refusing the connection, the stream URL, path, or credentials are wrong, or the camera accepted the connection and then sent nothing. See [The record stream isn't connecting](#the-record-stream-isnt-connecting).
|
|
||||||
- **`No new valid recording segments were created`** and **`No valid segments created since last invalid segment`**: recordings are arriving, but they keep failing validation, so the camera is sending video that cannot be saved. See [Invalid or missing video stream in segment](#invalid-or-missing-video-stream-in-segment) above.
|
|
||||||
|
|
||||||
The restart is Frigate recovering from a problem, not causing one. One of these after a camera reboot or a brief network drop is normal. Seeing them repeat every couple of minutes means the camera or the network is still failing, and the restarts can extend the damage, because each one cuts off the segment that was being written. Work from the earliest failure in that camera's log rather than from the restarts.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="i-see-the-message-warning--unable-to-keep-up-with-recording-segments-in-cache-for-camera-keeping-the-5-most-recent-segments-out-of-6-and-discarding-the-rest" question="I see the message: WARNING : Unable to keep up with recording segments in cache for camera. Keeping the 5 most recent segments out of 6 and discarding the rest...">
|
|
||||||
|
|
||||||
This warning means the recording maintainer cannot move recording segments from the RAM cache to disk fast enough. When the cache fills up, Frigate discards the oldest segments to avoid running out of memory and crashing, so you lose recorded footage. This is almost always a storage throughput or system resource problem. Work through the steps below to identify which.
|
This warning means the recording maintainer cannot move recording segments from the RAM cache to disk fast enough. When the cache fills up, Frigate discards the oldest segments to avoid running out of memory and crashing, so you lose recorded footage. This is almost always a storage throughput or system resource problem. Work through the steps below to identify which.
|
||||||
|
|
||||||
#### Step 1: Enable recording debug logging
|
### Step 1: Enable recording debug logging
|
||||||
|
|
||||||
The first step is to measure how long each segment takes to move from the RAM cache to disk. Enable debug logging for the recording maintainer:
|
The first step is to measure how long each segment takes to move from the RAM cache to disk. Enable debug logging for the recording maintainer:
|
||||||
|
|
||||||
@@ -275,14 +132,14 @@ DEBUG : Copied /media/frigate/recordings/{segment_path} in 0.2 seconds.
|
|||||||
|
|
||||||
Let this run until the warnings begin to appear, so you can confirm whether the disk is actually slowing down at the moment the error occurs.
|
Let this run until the warnings begin to appear, so you can confirm whether the disk is actually slowing down at the moment the error occurs.
|
||||||
|
|
||||||
#### Step 2: Interpret the copy times
|
### Step 2: Interpret the copy times
|
||||||
|
|
||||||
The copy duration tells you which direction to investigate:
|
The copy duration tells you which direction to investigate:
|
||||||
|
|
||||||
- **Consistently longer than ~1 second**: your storage cannot keep up with the incoming recordings. Continue with Steps 3–5 to diagnose the slow storage.
|
- **Consistently longer than ~1 second**: your storage cannot keep up with the incoming recordings. Continue with Steps 3–5 to diagnose the slow storage.
|
||||||
- **Consistently well under 1 second**: storage is fast enough, and the problem is more likely CPU or resource contention. Skip to Step 6.
|
- **Consistently well under 1 second**: storage is fast enough, and the problem is more likely CPU or resource contention. Skip to Step 6.
|
||||||
|
|
||||||
#### Step 3: Check RAM, swap, cache, and disk utilization
|
### Step 3: Check RAM, swap, cache, and disk utilization
|
||||||
|
|
||||||
If CPU, RAM, disk throughput, or bus I/O is insufficient, nothing inside Frigate will help. Review each aspect of available system resources while the warnings are occurring.
|
If CPU, RAM, disk throughput, or bus I/O is insufficient, nothing inside Frigate will help. Review each aspect of available system resources while the warnings are occurring.
|
||||||
|
|
||||||
@@ -318,21 +175,19 @@ services:
|
|||||||
|
|
||||||
NOTE: These are hard limits for the container, so be sure there is enough headroom above what `docker stats` shows for your container. It will immediately halt if it hits `<MAXRAM>`. In general, keeping all cache and tmp filespace in RAM is preferable to disk I/O where possible.
|
NOTE: These are hard limits for the container, so be sure there is enough headroom above what `docker stats` shows for your container. It will immediately halt if it hits `<MAXRAM>`. In general, keeping all cache and tmp filespace in RAM is preferable to disk I/O where possible.
|
||||||
|
|
||||||
#### Step 4: Check your storage type
|
### Step 4: Check your storage type
|
||||||
|
|
||||||
Mounting a network share is a popular option for storing recordings, but it can lead to reduced copy times and cause problems. Some users have found that using `NFS` instead of `SMB` considerably decreased copy times and fixed the issue. It is also important to ensure that the network connection between the device running Frigate and the network share is stable and fast. A saturated or unreliable link will stall copies.
|
Mounting a network share is a popular option for storing recordings, but it can lead to reduced copy times and cause problems. Some users have found that using `NFS` instead of `SMB` considerably decreased copy times and fixed the issue. It is also important to ensure that the network connection between the device running Frigate and the network share is stable and fast. A saturated or unreliable link will stall copies.
|
||||||
|
|
||||||
#### Step 5: Check your mount options
|
### Step 5: Check your mount options
|
||||||
|
|
||||||
Some users found that mounting a drive via `fstab` with the `sync` option dramatically reduced performance and led to this issue. Using `async` instead greatly reduced copy times.
|
Some users found that mounting a drive via `fstab` with the `sync` option dramatically reduced performance and led to this issue. Using `async` instead greatly reduced copy times.
|
||||||
|
|
||||||
#### Step 6: Rule out CPU load
|
### Step 6: Rule out CPU load
|
||||||
|
|
||||||
If the copy times are consistently under 1 second but you still see the warning, the machine's CPU load is likely too high for Frigate to have the resources to keep up. Try temporarily shutting down other services, and any resource-intensive Frigate features, to see if the issue improves.
|
If the copy times are consistently under 1 second but you still see the warning, the machine's CPU load is likely too high for Frigate to have the resources to keep up. Try temporarily shutting down other services, and any resource-intensive Frigate features, to see if the issue improves.
|
||||||
|
|
||||||
</FaqItem>
|
## I see the message: WARNING : Too many unprocessed recording segments in cache for camera. This likely indicates an issue with the detect stream...
|
||||||
|
|
||||||
<FaqItem id="i-see-the-message-warning--too-many-unprocessed-recording-segments-in-cache-for-camera-this-likely-indicates-an-issue-with-the-detect-stream" question="I see the message: WARNING : Too many unprocessed recording segments in cache for camera. This likely indicates an issue with the detect stream...">
|
|
||||||
|
|
||||||
This warning means that the detect stream for the affected camera has fallen behind or stopped processing frames. Frigate's recording cache holds segments waiting to be analyzed by the detector. When more than 6 segments pile up without being processed, Frigate discards the oldest ones to prevent the cache from filling up.
|
This warning means that the detect stream for the affected camera has fallen behind or stopped processing frames. Frigate's recording cache holds segments waiting to be analyzed by the detector. When more than 6 segments pile up without being processed, Frigate discards the oldest ones to prevent the cache from filling up.
|
||||||
|
|
||||||
@@ -342,11 +197,11 @@ This error is a **symptom**, not the root cause. The actual cause is always logg
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
#### Step 1: Get the full logs
|
### Step 1: Get the full logs
|
||||||
|
|
||||||
Collect complete Frigate logs from startup through the first occurrence of the error. Look for errors or warnings that appear **before** the "Too many unprocessed" messages begin. That is where the root cause will be found.
|
Collect complete Frigate logs from startup through the first occurrence of the error. Look for errors or warnings that appear **before** the "Too many unprocessed" messages begin. That is where the root cause will be found.
|
||||||
|
|
||||||
#### Step 2: Check the cache directory
|
### Step 2: Check the cache directory
|
||||||
|
|
||||||
Exec into the Frigate container and inspect the recording cache:
|
Exec into the Frigate container and inspect the recording cache:
|
||||||
|
|
||||||
@@ -356,7 +211,7 @@ docker exec -it frigate ls -la /tmp/cache
|
|||||||
|
|
||||||
Each camera should have a small number of `.mp4` segment files. If one camera has significantly more files than others, that camera is the source of the problem. A problem with a single camera can cascade and cause all cameras to show this error.
|
Each camera should have a small number of `.mp4` segment files. If one camera has significantly more files than others, that camera is the source of the problem. A problem with a single camera can cascade and cause all cameras to show this error.
|
||||||
|
|
||||||
#### Step 3: Verify segment duration
|
### Step 3: Verify segment duration
|
||||||
|
|
||||||
Recording segments should be approximately 10 seconds long. Run `ffprobe` on segments in the cache to check:
|
Recording segments should be approximately 10 seconds long. Run `ffprobe` on segments in the cache to check:
|
||||||
|
|
||||||
@@ -378,7 +233,7 @@ You don't have to run `ffprobe` by hand to catch this. Open a camera's **Camera
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
#### Step 4: Check for a stuck detector
|
### Step 4: Check for a stuck detector
|
||||||
|
|
||||||
If the detect stream is not processing frames, segments will accumulate. Common causes:
|
If the detect stream is not processing frames, segments will accumulate. Common causes:
|
||||||
|
|
||||||
@@ -387,7 +242,7 @@ If the detect stream is not processing frames, segments will accumulate. Common
|
|||||||
- **Model too large**: Use smaller model variants (e.g., YOLO `s` or `t` size, not `e` or `x`). Use 320x320 input size rather than 640x640 unless you have a powerful dedicated detector.
|
- **Model too large**: Use smaller model variants (e.g., YOLO `s` or `t` size, not `e` or `x`). Use 320x320 input size rather than 640x640 unless you have a powerful dedicated detector.
|
||||||
- **Virtualization**: Running Frigate in a VM (especially Proxmox) can cause the detector to hang or stall. This is a known issue with GPU/TPU passthrough in virtualized environments and is not something Frigate can fix. Running Frigate in Docker on bare metal is recommended.
|
- **Virtualization**: Running Frigate in a VM (especially Proxmox) can cause the detector to hang or stall. This is a known issue with GPU/TPU passthrough in virtualized environments and is not something Frigate can fix. Running Frigate in Docker on bare metal is recommended.
|
||||||
|
|
||||||
#### Step 5: Check for GPU hangs
|
### Step 5: Check for GPU hangs
|
||||||
|
|
||||||
On the host machine, check `dmesg` for GPU-related errors:
|
On the host machine, check `dmesg` for GPU-related errors:
|
||||||
|
|
||||||
@@ -397,11 +252,19 @@ dmesg | grep -i -E "gpu|drm|reset|hang"
|
|||||||
|
|
||||||
Messages like `trying reset from guc_exec_queue_timedout_job` or similar GPU reset/hang messages indicate a driver or hardware issue. Ensure your kernel and GPU drivers (especially Intel) are up to date.
|
Messages like `trying reset from guc_exec_queue_timedout_job` or similar GPU reset/hang messages indicate a driver or hardware issue. Ensure your kernel and GPU drivers (especially Intel) are up to date.
|
||||||
|
|
||||||
#### Step 6: Verify go2rtc stream configuration
|
### Step 6: Verify hardware acceleration configuration
|
||||||
|
|
||||||
|
An incorrect `hwaccel_args` preset can cause ffmpeg to fail silently or consume excessive CPU, starving the detector of resources.
|
||||||
|
|
||||||
|
- After upgrading Frigate, verify your preset matches your hardware (e.g., `preset-intel-qsv-h264` instead of the deprecated `preset-vaapi`).
|
||||||
|
- For h265 cameras, use the corresponding h265 preset (e.g., `preset-intel-qsv-h265`).
|
||||||
|
- Note that `hwaccel_args` are only relevant for the detect stream. Frigate does not decode the record stream.
|
||||||
|
|
||||||
|
### Step 7: Verify go2rtc stream configuration
|
||||||
|
|
||||||
Ensure that the ffmpeg source names in your go2rtc configuration match the correct camera stream. A misconfigured stream name (e.g., copying a config from one camera to another without updating the stream reference) will cause the wrong stream to be used or the stream to fail entirely.
|
Ensure that the ffmpeg source names in your go2rtc configuration match the correct camera stream. A misconfigured stream name (e.g., copying a config from one camera to another without updating the stream reference) will cause the wrong stream to be used or the stream to fail entirely.
|
||||||
|
|
||||||
#### Step 7: Check system resources
|
### Step 8: Check system resources
|
||||||
|
|
||||||
If none of the above apply, the issue may be a general resource constraint. Monitor the following on your host:
|
If none of the above apply, the issue may be a general resource constraint. Monitor the following on your host:
|
||||||
|
|
||||||
@@ -412,9 +275,7 @@ If none of the above apply, the issue may be a general resource constraint. Moni
|
|||||||
|
|
||||||
Try temporarily disabling resource-intensive features like `genai` and `face_recognition` to see if the issue resolves. This can help isolate whether the detector is being starved of resources.
|
Try temporarily disabling resource-intensive features like `genai` and `face_recognition` to see if the issue resolves. This can help isolate whether the detector is being starved of resources.
|
||||||
|
|
||||||
</FaqItem>
|
## I see the message: ERROR : Error occurred when attempting to maintain recording cache
|
||||||
|
|
||||||
<FaqItem id="i-see-the-message-error--error-occurred-when-attempting-to-maintain-recording-cache" question="I see the message: ERROR : Error occurred when attempting to maintain recording cache">
|
|
||||||
|
|
||||||
This message means the recording maintainer hit an error while moving segments from the cache to disk. It is a **generic wrapper**: the actual cause is always logged on the **very next line**. Frigate usually recovers and keeps running, but any affected segments are lost, so it is worth resolving.
|
This message means the recording maintainer hit an error while moving segments from the cache to disk. It is a **generic wrapper**: the actual cause is always logged on the **very next line**. Frigate usually recovers and keeps running, but any affected segments are lost, so it is worth resolving.
|
||||||
|
|
||||||
@@ -426,57 +287,27 @@ Always read the line immediately following this message. `Error occurred when at
|
|||||||
|
|
||||||
Because these are operating-system-level errors, they must be resolved on the **host**, not within Frigate's configuration. The most common underlying errors are below.
|
Because these are operating-system-level errors, they must be resolved on the **host**, not within Frigate's configuration. The most common underlying errors are below.
|
||||||
|
|
||||||
#### [Errno 28] No space left on device
|
### [Errno 28] No space left on device
|
||||||
|
|
||||||
The filesystem Frigate is writing to is full. Things to check:
|
The filesystem Frigate is writing to is full. Things to check:
|
||||||
|
|
||||||
- **The recordings volume is genuinely full.** Check free space on the host with `df -h` for the path mapped to `/media/frigate`, and review the **Storage** page in the Frigate UI.
|
- **The recordings volume is genuinely full.** Check free space on the host with `df -h` for the path mapped to `/media/frigate`, and review the **Storage** page in the Frigate UI.
|
||||||
- **The disk shows free space but is still "full".** This usually means the filesystem has run out of **inodes** (check with `df -i`), or recordings are landing on a different, smaller filesystem than you expect because of an incorrect bind mount. See [The storage volume isn't mounted correctly](#the-storage-volume-isnt-mounted-correctly) above.
|
- **The disk shows free space but is still "full".** This usually means the filesystem has run out of **inodes** (check with `df -i`), or recordings are landing on a different, smaller filesystem than you expect because of an incorrect bind mount. See [The storage volume isn't mounted correctly](#the-storage-volume-isnt-mounted-correctly) above.
|
||||||
- **`/tmp/cache` is full.** If you mounted `/tmp/cache` as a small `tmpfs`, a backlog of segments can fill it. Increase the tmpfs size, or address whatever is causing segments to pile up (see the [Too many unprocessed recording segments](#i-see-the-message-warning--too-many-unprocessed-recording-segments-in-cache-for-camera-this-likely-indicates-an-issue-with-the-detect-stream) question above).
|
- **`/tmp/cache` is full.** If you mounted `/tmp/cache` as a small `tmpfs`, a backlog of segments can fill it. Increase the tmpfs size, or address whatever is causing segments to pile up (see the [Too many unprocessed recording segments](#i-see-the-message-warning--too-many-unprocessed-recording-segments-in-cache-for-camera-this-likely-indicates-an-issue-with-the-detect-stream) section above).
|
||||||
- **The host blocks writes before Frigate can purge.** On some systems (for example Unraid with a fill-up threshold), the host stops writes before Frigate's emergency cleanup can run. Leave more headroom on the volume, or lower your retention so Frigate purges sooner.
|
- **The host blocks writes before Frigate can purge.** On some systems (for example Unraid with a fill-up threshold), the host stops writes before Frigate's emergency cleanup can run. Leave more headroom on the volume, or lower your retention so Frigate purges sooner.
|
||||||
|
|
||||||
#### [Errno 17] File exists (with ffmpeg "Error writing trailer" or "unable to re-open output file")
|
### [Errno 17] File exists (with ffmpeg "Error writing trailer" or "unable to re-open output file")
|
||||||
|
|
||||||
Errors like `[Errno 17] File exists: '/media/frigate/recordings/.../<camera>'`, often alongside ffmpeg errors such as `Unable to re-open ... output file for shifting data` or `Error writing trailer: No such file or directory`, are a hallmark of an **unreliable network share** (NFS or SMB). The mount is dropping, serving stale directory entries, or mishandling file locking.
|
Errors like `[Errno 17] File exists: '/media/frigate/recordings/.../<camera>'`, often alongside ffmpeg errors such as `Unable to re-open ... output file for shifting data` or `Error writing trailer: No such file or directory`, are a hallmark of an **unreliable network share** (NFS or SMB). The mount is dropping, serving stale directory entries, or mishandling file locking.
|
||||||
|
|
||||||
- Confirm the network connection to the NAS is stable and fast. An intermittent link produces these errors sporadically.
|
- Confirm the network connection to the NAS is stable and fast. An intermittent link produces these errors sporadically.
|
||||||
- Prefer **NFS over SMB** for the recordings mount; several users have found NFS more reliable and faster.
|
- Prefer **NFS over SMB** for the recordings mount; several users have found NFS more reliable and faster.
|
||||||
- Review your `fstab`/mount options for settings that hurt consistency or performance (see the `sync` vs `async` note in the [Unable to keep up with recording segments](#i-see-the-message-warning--unable-to-keep-up-with-recording-segments-in-cache-for-camera-keeping-the-5-most-recent-segments-out-of-6-and-discarding-the-rest) question above).
|
- Review your `fstab`/mount options for settings that hurt consistency or performance (see the `sync` vs `async` note in the [Unable to keep up with recording segments](#i-see-the-message-warning--unable-to-keep-up-with-recording-segments-in-cache-for-camera-keeping-the-5-most-recent-segments-out-of-6-and-discarding-the-rest) section above).
|
||||||
- Enable `frigate.record.maintainer` debug logging to confirm whether the errors line up with the share becoming unavailable.
|
- Enable `frigate.record.maintainer` debug logging to confirm whether the errors line up with the share becoming unavailable.
|
||||||
|
|
||||||
#### Errors referencing a camera you manually renamed or removed
|
### Errors referencing a camera you manually renamed or removed
|
||||||
|
|
||||||
If the next-line error references a camera name that no longer exists in your config, orphaned data is left over from a rename or removal in a persistent `/tmp/cache` volume.
|
If the next-line error references a camera name that no longer exists in your config, orphaned data is left over from a rename or removal in a persistent `/tmp/cache` volume.
|
||||||
|
|
||||||
- Using a `tmpfs` mount for `/tmp/cache` as recommended in the [installation docs](/frigate/installation#storage) prevents stale cache files under the old camera name from surviving a restart, which avoids this issue entirely.
|
- Using a `tmpfs` mount for `/tmp/cache` as recommended in the [installation docs](/frigate/installation#storage) prevents stale cache files under the old camera name from surviving a restart, which avoids this issue entirely.
|
||||||
- If errors persist, stop Frigate and remove any leftover segments for the old camera name from `/tmp/cache`.
|
- If errors persist, stop Frigate and remove any leftover segments for the old camera name from `/tmp/cache`.
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
## Other recording questions
|
|
||||||
|
|
||||||
<FaqItem id="i-have-frigate-configured-for-motion-recording-only-but-it-still-seems-to-be-recording-even-with-no-motion-why" question="I have Frigate configured for motion recording only, but it still seems to be recording even with no motion. Why?">
|
|
||||||
|
|
||||||
You'll want to:
|
|
||||||
|
|
||||||
- Make sure your camera's timestamp is masked out with a motion mask. Even if there is no motion occurring in your scene, your motion settings may be sensitive enough to count your timestamp as motion.
|
|
||||||
- If you have audio detection enabled, keep in mind that audio that is heard above `min_volume` is considered motion.
|
|
||||||
- [Tune your motion detection settings](/configuration/motion_detection) either by editing your config file or by using the UI's Motion Tuner.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|
||||||
<FaqItem id="my-timeline-previews-are-black-after-restarting-frigate-or-recreating-the-container" question="My timeline previews are black after restarting Frigate or recreating the container. Why?">
|
|
||||||
|
|
||||||
The scrubbing previews (the timelapse clips shown when dragging the History timeline, the secondary-camera previews, and the preview that plays when hovering a review card) are not recorded continuously. Frigate caches low-resolution preview frames in `/tmp/cache` throughout each hour and only assembles them into a finished preview clip **at the top of the hour**.
|
|
||||||
|
|
||||||
In the recommended configuration, `/tmp/cache` is a small in-memory (`tmpfs`) area. When Frigate starts, it tries to restore the current hour's cached frames, so a **soft restart from the UI** preserves them. But if you recreate the Docker container or stop Frigate forcibly by any other means partway through an hour, the in-memory cache is discarded, so no preview clip is produced for that partial hour.
|
|
||||||
|
|
||||||
This is expected behavior, not a bug:
|
|
||||||
|
|
||||||
- Previews for hours that already completed and were written to disk are unaffected.
|
|
||||||
- The next full hour after a restart will generate previews normally.
|
|
||||||
- This is unrelated to `shm_size`; increasing shared memory does not change it.
|
|
||||||
|
|
||||||
To avoid the gap, use the **Restart Frigate** button in the UI's Settings menu rather than recreating the container when possible.
|
|
||||||
|
|
||||||
</FaqItem>
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ To act on many objects at once, Ctrl/Cmd-click or right-click to start a selecti
|
|||||||
|
|
||||||
1. Semantic Search is used in conjunction with the other filters available on the Explore page. Use a combination of traditional filtering and Semantic Search for the best results.
|
1. Semantic Search is used in conjunction with the other filters available on the Explore page. Use a combination of traditional filtering and Semantic Search for the best results.
|
||||||
2. Use the thumbnail search type when searching for particular objects in the scene. Use the description search type when attempting to discern the intent of your object.
|
2. Use the thumbnail search type when searching for particular objects in the scene. Use the description search type when attempting to discern the intent of your object.
|
||||||
3. Because of how the AI models Frigate uses have been trained, the comparison between text and image embedding distances generally means that with multi-modal (`thumbnail` and `description`) searches, results matching `description` will appear first, even if a `thumbnail` embedding may be a better match. Play with the "Search Type" setting to help find what you are looking for. Note that if you are generating descriptions for specific objects or zones only, this may cause search results to prioritize the objects with descriptions even if the ones without them are more relevant.
|
3. Because of how the AI models Frigate uses have been trained, the comparison between text and image embedding distances generally means that with multi-modal (`thumbnail` and `description`) searches, results matching `description` will appear first, even if a `thumbnail` embedding may be a better match. Play with the "Search Type" setting to help find what you are looking for. Note that if you are generating descriptions for specific objects or zones only, this may cause search results to prioritize the objects with descriptions even if the the ones without them are more relevant.
|
||||||
4. Make your search language and tone closely match exactly what you're looking for. If you are using thumbnail search, **phrase your query as an image caption**. Searching for "red car" may not work as well as "red sedan driving down a residential street on a sunny day".
|
4. Make your search language and tone closely match exactly what you're looking for. If you are using thumbnail search, **phrase your query as an image caption**. Searching for "red car" may not work as well as "red sedan driving down a residential street on a sunny day".
|
||||||
5. Semantic search on thumbnails tends to return better results when matching large subjects that take up most of the frame. Small things like "cat" tend to not work well.
|
5. Semantic search on thumbnails tends to return better results when matching large subjects that take up most of the frame. Small things like "cat" tend to not work well.
|
||||||
6. Experiment! Find a tracked object you want to test and start typing keywords and phrases to see what works for you.
|
6. Experiment! Find a tracked object you want to test and start typing keywords and phrases to see what works for you.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ All of your exports live on the **Exports** page, reachable from the main naviga
|
|||||||
- **Rename** it, and
|
- **Rename** it, and
|
||||||
- **Delete** it: deleting is the only way an export is removed.
|
- **Delete** it: deleting is the only way an export is removed.
|
||||||
|
|
||||||
You can also select multiple exports at once to **delete** them in bulk, or to **add them to** (or **remove them from**) a [case](#cases). To download multiple exports as a zip archive, add them to a **case** and use the Download button there.
|
You can also select multiple exports at once to **delete** them in bulk, or to **add them to** (or **remove them from**) a [case](#cases).
|
||||||
|
|
||||||
## Cases
|
## Cases
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ You can optionally overlay live streaming statistics (stream type, bandwidth, la
|
|||||||
|
|
||||||
Right-clicking (or long-pressing) a camera tile opens a context menu with quick controls: an **audio volume** control for streams that support audio, **Mute / Unmute all cameras**, **show or hide streaming statistics**, the **debug view**, **notification** options, and, for admins, turning the camera on or off. If the audio control doesn't appear, see [Audio Support](/configuration/live#audio-support). Audio requires go2rtc configured with a compatible codec.
|
Right-clicking (or long-pressing) a camera tile opens a context menu with quick controls: an **audio volume** control for streams that support audio, **Mute / Unmute all cameras**, **show or hide streaming statistics**, the **debug view**, **notification** options, and, for admins, turning the camera on or off. If the audio control doesn't appear, see [Audio Support](/configuration/live#audio-support). Audio requires go2rtc configured with a compatible codec.
|
||||||
|
|
||||||
A **Low-bandwidth mode** notice may also appear in the context menu with a **Reset** option when Frigate has fallen back to the lower-quality jsmpeg stream. See the [Live view FAQ](/configuration/live#live-view-faq) for why this happens.
|
A **Low-bandwidth mode** notice may also appear in the context menu with a **Reset** option appears when Frigate has fallen back to the lower-quality jsmpeg stream. See the [Live view FAQ](/configuration/live#live-view-faq) for why this happens.
|
||||||
|
|
||||||
For non-default groups, the context menu also exposes **Streaming Settings** for that camera, which let you choose:
|
For non-default groups, the context menu also exposes **Streaming Settings** for that camera, which let you choose:
|
||||||
|
|
||||||
|
|||||||
+21
-29
@@ -3,9 +3,6 @@ import * as path from "node:path";
|
|||||||
import type { Config, PluginConfig } from "@docusaurus/types";
|
import type { Config, PluginConfig } from "@docusaurus/types";
|
||||||
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
|
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
|
||||||
|
|
||||||
// Bump when a new stable release ships
|
|
||||||
const STABLE_VERSION = "0.18";
|
|
||||||
|
|
||||||
const config: Config = {
|
const config: Config = {
|
||||||
title: "Frigate",
|
title: "Frigate",
|
||||||
tagline: "NVR With Realtime Object Detection for IP Cameras",
|
tagline: "NVR With Realtime Object Detection for IP Cameras",
|
||||||
@@ -26,17 +23,17 @@ const config: Config = {
|
|||||||
mermaid: true,
|
mermaid: true,
|
||||||
},
|
},
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: "en",
|
defaultLocale: 'en',
|
||||||
locales: ["en"],
|
locales: ['en'],
|
||||||
localeConfigs: {
|
localeConfigs: {
|
||||||
en: {
|
en: {
|
||||||
label: "English",
|
label: 'English',
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
announcementBar: {
|
announcementBar: {
|
||||||
id: "frigate_plus",
|
id: 'frigate_plus',
|
||||||
content: `
|
content: `
|
||||||
<span style="margin-right: 8px; display: inline-block; animation: pulse 2s infinite;">🚀</span>
|
<span style="margin-right: 8px; display: inline-block; animation: pulse 2s infinite;">🚀</span>
|
||||||
Get more relevant and accurate detections with Frigate+ models.
|
Get more relevant and accurate detections with Frigate+ models.
|
||||||
@@ -48,8 +45,8 @@ const config: Config = {
|
|||||||
50% { transform: scale(1.1); }
|
50% { transform: scale(1.1); }
|
||||||
}
|
}
|
||||||
</style>`,
|
</style>`,
|
||||||
backgroundColor: "#005f73",
|
backgroundColor: '#005f73',
|
||||||
textColor: "#e0fbfc",
|
textColor: '#e0fbfc',
|
||||||
isCloseable: false,
|
isCloseable: false,
|
||||||
},
|
},
|
||||||
docs: {
|
docs: {
|
||||||
@@ -88,13 +85,13 @@ const config: Config = {
|
|||||||
prism: {
|
prism: {
|
||||||
magicComments:[
|
magicComments:[
|
||||||
{
|
{
|
||||||
className: "theme-code-block-highlighted-line",
|
className: 'theme-code-block-highlighted-line',
|
||||||
line: "highlight-next-line",
|
line: 'highlight-next-line',
|
||||||
block: { start: "highlight-start", end: "highlight-end" },
|
block: {start: 'highlight-start', end: 'highlight-end'},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
className: "code-block-error-line",
|
className: 'code-block-error-line',
|
||||||
line: "highlight-error-line",
|
line: 'highlight-error-line',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
additionalLanguages: ["bash", "json"],
|
additionalLanguages: ["bash", "json"],
|
||||||
@@ -134,11 +131,6 @@ const config: Config = {
|
|||||||
srcDark: "img/branding/logo-dark.svg",
|
srcDark: "img/branding/logo-dark.svg",
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
{
|
|
||||||
href: "https://github.com/blakeblackshear/frigate/releases",
|
|
||||||
label: `${STABLE_VERSION}`,
|
|
||||||
position: "left",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
to: "/",
|
to: "/",
|
||||||
activeBasePath: "docs",
|
activeBasePath: "docs",
|
||||||
@@ -156,19 +148,19 @@ const config: Config = {
|
|||||||
position: "right",
|
position: "right",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "localeDropdown",
|
type: 'localeDropdown',
|
||||||
position: "right",
|
position: 'right',
|
||||||
dropdownItemsAfter: [
|
dropdownItemsAfter: [
|
||||||
{
|
{
|
||||||
label: "简体中文(社区翻译)",
|
label: '简体中文(社区翻译)',
|
||||||
href: "https://docs.frigate-cn.video",
|
href: 'https://docs.frigate-cn.video',
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: "https://github.com/blakeblackshear/frigate",
|
href: 'https://github.com/blakeblackshear/frigate',
|
||||||
label: "GitHub",
|
label: 'GitHub',
|
||||||
position: "right",
|
position: 'right',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ const sidebars: SidebarsConfig = {
|
|||||||
],
|
],
|
||||||
Configuration: [
|
Configuration: [
|
||||||
"configuration/config",
|
"configuration/config",
|
||||||
"configuration/config_overrides",
|
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
label: "Detectors",
|
label: "Detectors",
|
||||||
@@ -166,7 +165,6 @@ const sidebars: SidebarsConfig = {
|
|||||||
],
|
],
|
||||||
Troubleshooting: [
|
Troubleshooting: [
|
||||||
"troubleshooting/faqs",
|
"troubleshooting/faqs",
|
||||||
"troubleshooting/common_errors",
|
|
||||||
"troubleshooting/go2rtc",
|
"troubleshooting/go2rtc",
|
||||||
"troubleshooting/recordings",
|
"troubleshooting/recordings",
|
||||||
"troubleshooting/dummy-camera",
|
"troubleshooting/dummy-camera",
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
|
||||||
import Heading from "@theme/Heading";
|
|
||||||
import styles from "./styles.module.css";
|
|
||||||
|
|
||||||
// A single FAQ entry.
|
|
||||||
//
|
|
||||||
// The question is a real anchored heading (via @theme/Heading), so on desktop
|
|
||||||
// it gets the standard hover "#" hash link and the answer is always shown. On
|
|
||||||
// mobile the heading text is a button that toggles its answer, keeping long
|
|
||||||
// FAQ pages short. The desktop/mobile split is pure CSS (Docusaurus breakpoint:
|
|
||||||
// 996px), so there is no hydration flash. The answer is always rendered into
|
|
||||||
// the DOM, so search engines and the docs AI bot can read it regardless of
|
|
||||||
// layout or collapsed state. The heading id resolves deep links on both layouts
|
|
||||||
// and auto-expands the entry on mobile when it is the link target.
|
|
||||||
export default function FaqItem({ id, question, children }) {
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const openIfTargeted = () => {
|
|
||||||
if (window.location.hash === `#${id}`) {
|
|
||||||
setOpen(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
openIfTargeted();
|
|
||||||
window.addEventListener("hashchange", openIfTargeted);
|
|
||||||
return () => window.removeEventListener("hashchange", openIfTargeted);
|
|
||||||
}, [id]);
|
|
||||||
|
|
||||||
const toggle = () => {
|
|
||||||
const next = !open;
|
|
||||||
setOpen(next);
|
|
||||||
// Reflect the entry in the URL like clicking the heading anchor, so an
|
|
||||||
// opened answer is shareable. Use replaceState to avoid history spam and
|
|
||||||
// an abrupt scroll. Clear it on close if it currently points here.
|
|
||||||
if (next) {
|
|
||||||
if (window.location.hash !== `#${id}`) {
|
|
||||||
window.history.replaceState(null, "", `#${id}`);
|
|
||||||
}
|
|
||||||
} else if (window.location.hash === `#${id}`) {
|
|
||||||
window.history.replaceState(
|
|
||||||
null,
|
|
||||||
"",
|
|
||||||
window.location.pathname + window.location.search,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.item} data-open={open || undefined}>
|
|
||||||
<Heading as="h4" id={id} className={styles.heading}>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className={styles.toggle}
|
|
||||||
aria-expanded={open}
|
|
||||||
aria-controls={`${id}-content`}
|
|
||||||
onClick={toggle}
|
|
||||||
>
|
|
||||||
<span className={styles.question}>{question}</span>
|
|
||||||
</button>
|
|
||||||
</Heading>
|
|
||||||
<div id={`${id}-content`} className={styles.content}>
|
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
/*
|
|
||||||
* FAQ entry: collapsible on mobile, static heading + expanded answer on
|
|
||||||
* desktop. The split is pure CSS (Docusaurus breakpoint: 996px) so there is
|
|
||||||
* no hydration flash. The answer is always rendered into the DOM, so search
|
|
||||||
* engines and the docs AI bot can read it regardless of layout or state.
|
|
||||||
*/
|
|
||||||
|
|
||||||
.item {
|
|
||||||
scroll-margin-top: calc(var(--ifm-navbar-height) + 1rem);
|
|
||||||
}
|
|
||||||
|
|
||||||
.heading {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Mobile: the heading text is a full-width clickable toggle row. */
|
|
||||||
.toggle {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.6rem;
|
|
||||||
width: 100%;
|
|
||||||
padding: 0.85rem 0;
|
|
||||||
border: none;
|
|
||||||
border-bottom: 1px solid var(--ifm-color-emphasis-200);
|
|
||||||
background: none;
|
|
||||||
color: inherit;
|
|
||||||
font: inherit;
|
|
||||||
text-align: left;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle::before {
|
|
||||||
content: "";
|
|
||||||
flex: 0 0 auto;
|
|
||||||
width: 0.5rem;
|
|
||||||
height: 0.5rem;
|
|
||||||
border-right: 2px solid currentColor;
|
|
||||||
border-bottom: 2px solid currentColor;
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
transition: transform var(--ifm-transition-fast, 200ms) ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item[data-open] .toggle::before {
|
|
||||||
transform: rotate(45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.question {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
display: none;
|
|
||||||
padding: 0 0 0.85rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item[data-open] .content {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hide the hover hash link on mobile (no hover; avoids a stray empty line). */
|
|
||||||
.heading :global(.hash-link) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Desktop: render as a normal expanded heading + answer. */
|
|
||||||
@media (min-width: 997px) {
|
|
||||||
.heading {
|
|
||||||
margin: 1.75rem 0 0.85rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle {
|
|
||||||
display: inline;
|
|
||||||
width: auto;
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toggle::before {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
display: block;
|
|
||||||
padding: 0 0 0.5rem 1rem;
|
|
||||||
border-left: 2px solid var(--ifm-color-emphasis-200);
|
|
||||||
}
|
|
||||||
|
|
||||||
.heading :global(.hash-link) {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Vendored
+9
-111
@@ -693,43 +693,6 @@ paths:
|
|||||||
**Access:** Admin role required.
|
**Access:** Admin role required.
|
||||||
|
|
||||||
Set a camera feature state. Use camera_name='*' to target all cameras.
|
Set a camera feature state. Use camera_name='*' to target all cameras.
|
||||||
|
|
||||||
The value to set is sent in the request body as `{"value": "<value>"}`.
|
|
||||||
|
|
||||||
| Feature | Accepted values |
|
|
||||||
| --- | --- |
|
|
||||||
| `enabled` | `ON`, `OFF` |
|
|
||||||
| `detect` | `ON`, `OFF` |
|
|
||||||
| `motion` | `ON`, `OFF` |
|
|
||||||
| `recordings` | `ON`, `OFF` |
|
|
||||||
| `snapshots` | `ON`, `OFF` |
|
|
||||||
| `audio` | `ON`, `OFF` |
|
|
||||||
| `audio_transcription` | `ON`, `OFF` |
|
|
||||||
| `notifications` | `ON`, `OFF` |
|
|
||||||
| `review_alerts` | `ON`, `OFF` |
|
|
||||||
| `review_detections` | `ON`, `OFF` |
|
|
||||||
| `object_descriptions` | `ON`, `OFF` |
|
|
||||||
| `review_descriptions` | `ON`, `OFF` |
|
|
||||||
| `improve_contrast` | `ON`, `OFF` |
|
|
||||||
| `ptz_autotracker` | `ON`, `OFF` |
|
|
||||||
| `birdseye` | `ON`, `OFF` |
|
|
||||||
| `birdseye_mode` | `CONTINUOUS`, `MOTION`, `OBJECTS` |
|
|
||||||
| `motion_contour_area` | integer |
|
|
||||||
| `motion_threshold` | integer |
|
|
||||||
| `motion_mask` | `ON`, `OFF` |
|
|
||||||
| `object_mask` | `ON`, `OFF` |
|
|
||||||
| `zone` | `ON`, `OFF` |
|
|
||||||
| `profile` | a profile name, or `none` to deactivate |
|
|
||||||
|
|
||||||
`motion_mask`, `object_mask`, and `zone` require the `sub_command` path
|
|
||||||
parameter to be set to the name of the mask or zone. All other features
|
|
||||||
reject a sub-command.
|
|
||||||
|
|
||||||
`profile` applies globally rather than per camera, so it requires
|
|
||||||
`camera_name` to be `*`.
|
|
||||||
|
|
||||||
These features map to the equivalent MQTT topics, which document the
|
|
||||||
behavior of each value in more detail.
|
|
||||||
operationId:
|
operationId:
|
||||||
camera_set_camera__camera_name__set__feature___sub_command__put
|
camera_set_camera__camera_name__set__feature___sub_command__put
|
||||||
parameters:
|
parameters:
|
||||||
@@ -783,43 +746,6 @@ paths:
|
|||||||
**Access:** Admin role required.
|
**Access:** Admin role required.
|
||||||
|
|
||||||
Set a camera feature state. Use camera_name='*' to target all cameras.
|
Set a camera feature state. Use camera_name='*' to target all cameras.
|
||||||
|
|
||||||
The value to set is sent in the request body as `{"value": "<value>"}`.
|
|
||||||
|
|
||||||
| Feature | Accepted values |
|
|
||||||
| --- | --- |
|
|
||||||
| `enabled` | `ON`, `OFF` |
|
|
||||||
| `detect` | `ON`, `OFF` |
|
|
||||||
| `motion` | `ON`, `OFF` |
|
|
||||||
| `recordings` | `ON`, `OFF` |
|
|
||||||
| `snapshots` | `ON`, `OFF` |
|
|
||||||
| `audio` | `ON`, `OFF` |
|
|
||||||
| `audio_transcription` | `ON`, `OFF` |
|
|
||||||
| `notifications` | `ON`, `OFF` |
|
|
||||||
| `review_alerts` | `ON`, `OFF` |
|
|
||||||
| `review_detections` | `ON`, `OFF` |
|
|
||||||
| `object_descriptions` | `ON`, `OFF` |
|
|
||||||
| `review_descriptions` | `ON`, `OFF` |
|
|
||||||
| `improve_contrast` | `ON`, `OFF` |
|
|
||||||
| `ptz_autotracker` | `ON`, `OFF` |
|
|
||||||
| `birdseye` | `ON`, `OFF` |
|
|
||||||
| `birdseye_mode` | `CONTINUOUS`, `MOTION`, `OBJECTS` |
|
|
||||||
| `motion_contour_area` | integer |
|
|
||||||
| `motion_threshold` | integer |
|
|
||||||
| `motion_mask` | `ON`, `OFF` |
|
|
||||||
| `object_mask` | `ON`, `OFF` |
|
|
||||||
| `zone` | `ON`, `OFF` |
|
|
||||||
| `profile` | a profile name, or `none` to deactivate |
|
|
||||||
|
|
||||||
`motion_mask`, `object_mask`, and `zone` require the `sub_command` path
|
|
||||||
parameter to be set to the name of the mask or zone. All other features
|
|
||||||
reject a sub-command.
|
|
||||||
|
|
||||||
`profile` applies globally rather than per camera, so it requires
|
|
||||||
`camera_name` to be `*`.
|
|
||||||
|
|
||||||
These features map to the equivalent MQTT topics, which document the
|
|
||||||
behavior of each value in more detail.
|
|
||||||
operationId: camera_set_camera__camera_name__set__feature__put
|
operationId: camera_set_camera__camera_name__set__feature__put
|
||||||
parameters:
|
parameters:
|
||||||
- name: camera_name
|
- name: camera_name
|
||||||
@@ -1476,7 +1402,7 @@ paths:
|
|||||||
- Classification
|
- Classification
|
||||||
summary: Get custom classification attributes
|
summary: Get custom classification attributes
|
||||||
description: |-
|
description: |-
|
||||||
**Access:** Authenticated user with access to all cameras.
|
**Access:** Admin role required.
|
||||||
|
|
||||||
Returns custom classification attributes for a given object type.
|
Returns custom classification attributes for a given object type.
|
||||||
Only includes models with classification_type set to 'attribute'.
|
Only includes models with classification_type set to 'attribute'.
|
||||||
@@ -1510,8 +1436,8 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/HTTPValidationError'
|
$ref: '#/components/schemas/HTTPValidationError'
|
||||||
security:
|
security:
|
||||||
- frigateUserAuth: []
|
- frigateAdminAuth: []
|
||||||
x-required-role: all_cameras
|
x-required-role: admin
|
||||||
/classification/{name}/train:
|
/classification/{name}/train:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@@ -2308,15 +2234,15 @@ paths:
|
|||||||
$ref: '#/components/schemas/HTTPValidationError'
|
$ref: '#/components/schemas/HTTPValidationError'
|
||||||
security:
|
security:
|
||||||
- frigateUserAuth: []
|
- frigateUserAuth: []
|
||||||
x-required-role: camera
|
x-required-role: any
|
||||||
description: '**Access:** Authenticated user with access to the referenced camera.'
|
description: '**Access:** Any authenticated user.'
|
||||||
/review/summarize/start/{start_ts}/end/{end_ts}:
|
/review/summarize/start/{start_ts}/end/{end_ts}:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- Review
|
- Review
|
||||||
summary: Generate Review Summary
|
summary: Generate Review Summary
|
||||||
description: |-
|
description: |-
|
||||||
**Access:** Authenticated user with access to all cameras.
|
**Access:** Admin role required.
|
||||||
|
|
||||||
Use GenAI to summarize review items over a period of time.
|
Use GenAI to summarize review items over a period of time.
|
||||||
operationId:
|
operationId:
|
||||||
@@ -2347,8 +2273,8 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/HTTPValidationError'
|
$ref: '#/components/schemas/HTTPValidationError'
|
||||||
security:
|
security:
|
||||||
- frigateUserAuth: []
|
- frigateAdminAuth: []
|
||||||
x-required-role: all_cameras
|
x-required-role: admin
|
||||||
/:
|
/:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@@ -4073,16 +3999,6 @@ paths:
|
|||||||
- type: 'null'
|
- type: 'null'
|
||||||
default: 100
|
default: 100
|
||||||
title: Limit
|
title: Limit
|
||||||
- name: offset
|
|
||||||
in: query
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
anyOf:
|
|
||||||
- type: integer
|
|
||||||
minimum: 0
|
|
||||||
- type: 'null'
|
|
||||||
default: 0
|
|
||||||
title: Offset
|
|
||||||
- name: after
|
- name: after
|
||||||
in: query
|
in: query
|
||||||
required: false
|
required: false
|
||||||
@@ -4388,16 +4304,6 @@ paths:
|
|||||||
- type: 'null'
|
- type: 'null'
|
||||||
default: 50
|
default: 50
|
||||||
title: Limit
|
title: Limit
|
||||||
- name: offset
|
|
||||||
in: query
|
|
||||||
required: false
|
|
||||||
schema:
|
|
||||||
anyOf:
|
|
||||||
- type: integer
|
|
||||||
minimum: 0
|
|
||||||
- type: 'null'
|
|
||||||
default: 0
|
|
||||||
title: Offset
|
|
||||||
- name: cameras
|
- name: cameras
|
||||||
in: query
|
in: query
|
||||||
required: false
|
required: false
|
||||||
@@ -5113,7 +5019,6 @@ paths:
|
|||||||
NOTES:
|
NOTES:
|
||||||
- Creating a manual event does not trigger an update to /events MQTT topic.
|
- Creating a manual event does not trigger an update to /events MQTT topic.
|
||||||
- If a duration is set to null, the event will need to be ended manually by calling /events/{event_id}/end.
|
- If a duration is set to null, the event will need to be ended manually by calling /events/{event_id}/end.
|
||||||
- The review item is an alert unless the label is listed in the camera's review -> detections -> labels config.
|
|
||||||
operationId: create_event_events__camera_name___label__create_post
|
operationId: create_event_events__camera_name___label__create_post
|
||||||
parameters:
|
parameters:
|
||||||
- name: camera_name
|
- name: camera_name
|
||||||
@@ -7129,9 +7034,7 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/DebugReplayStartResponse'
|
$ref: '#/components/schemas/DebugReplayStartResponse'
|
||||||
'400':
|
'400':
|
||||||
description: Invalid camera or time range
|
description: Invalid camera, time range, or no recordings
|
||||||
'404':
|
|
||||||
description: No recordings in the requested time range
|
|
||||||
'409':
|
'409':
|
||||||
description: A replay session is already active
|
description: A replay session is already active
|
||||||
'422':
|
'422':
|
||||||
@@ -8341,11 +8244,6 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
provider:
|
provider:
|
||||||
$ref: '#/components/schemas/GenAIProviderEnum'
|
$ref: '#/components/schemas/GenAIProviderEnum'
|
||||||
name:
|
|
||||||
anyOf:
|
|
||||||
- type: string
|
|
||||||
- type: 'null'
|
|
||||||
title: Name
|
|
||||||
api_key:
|
api_key:
|
||||||
anyOf:
|
anyOf:
|
||||||
- type: string
|
- type: string
|
||||||
|
|||||||
+16
-30
@@ -31,10 +31,6 @@ from frigate.api.auth import (
|
|||||||
get_allowed_cameras_for_filter,
|
get_allowed_cameras_for_filter,
|
||||||
require_role,
|
require_role,
|
||||||
)
|
)
|
||||||
from frigate.api.config_util import (
|
|
||||||
publish_camera_section_updates,
|
|
||||||
swap_runtime_config,
|
|
||||||
)
|
|
||||||
from frigate.api.defs.query.app_query_parameters import AppTimelineHourlyQueryParameters
|
from frigate.api.defs.query.app_query_parameters import AppTimelineHourlyQueryParameters
|
||||||
from frigate.api.defs.request.app_body import (
|
from frigate.api.defs.request.app_body import (
|
||||||
AppConfigSetBody,
|
AppConfigSetBody,
|
||||||
@@ -199,7 +195,7 @@ def genai_models(request: Request):
|
|||||||
"before saving the configuration."
|
"before saving the configuration."
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
async def genai_probe(request: Request, body: GenAIProbeBody):
|
async def genai_probe(body: GenAIProbeBody):
|
||||||
load_providers()
|
load_providers()
|
||||||
|
|
||||||
provider_cls = PROVIDERS.get(body.provider)
|
provider_cls = PROVIDERS.get(body.provider)
|
||||||
@@ -209,13 +205,6 @@ async def genai_probe(request: Request, body: GenAIProbeBody):
|
|||||||
content={"success": False, "message": "Unknown provider"},
|
content={"success": False, "message": "Unknown provider"},
|
||||||
)
|
)
|
||||||
|
|
||||||
api_key = body.api_key
|
|
||||||
if api_key == REDACTED_CREDENTIAL_SENTINEL:
|
|
||||||
saved_cfg = (
|
|
||||||
request.app.frigate_config.genai.get(body.name) if body.name else None
|
|
||||||
)
|
|
||||||
api_key = saved_cfg.api_key if saved_cfg else None
|
|
||||||
|
|
||||||
# The OpenAI-compatible SDKs accept "timeout" as a constructor kwarg via
|
# The OpenAI-compatible SDKs accept "timeout" as a constructor kwarg via
|
||||||
# provider_options; other plugins use GenAIClient.timeout passed below.
|
# provider_options; other plugins use GenAIClient.timeout passed below.
|
||||||
# Don't inject timeout for Gemini — its HttpOptions interprets the value
|
# Don't inject timeout for Gemini — its HttpOptions interprets the value
|
||||||
@@ -227,7 +216,7 @@ async def genai_probe(request: Request, body: GenAIProbeBody):
|
|||||||
try:
|
try:
|
||||||
transient_cfg = GenAIConfig(
|
transient_cfg = GenAIConfig(
|
||||||
provider=body.provider,
|
provider=body.provider,
|
||||||
api_key=api_key,
|
api_key=body.api_key,
|
||||||
base_url=body.base_url,
|
base_url=body.base_url,
|
||||||
provider_options=probe_provider_options,
|
provider_options=probe_provider_options,
|
||||||
# model is required by the schema but irrelevant for listing.
|
# model is required by the schema but irrelevant for listing.
|
||||||
@@ -926,7 +915,19 @@ def config_set(request: Request, body: AppConfigSetBody):
|
|||||||
|
|
||||||
if body.requires_restart == 0 or body.update_topic:
|
if body.requires_restart == 0 or body.update_topic:
|
||||||
old_config: FrigateConfig = request.app.frigate_config
|
old_config: FrigateConfig = request.app.frigate_config
|
||||||
swap_runtime_config(request.app, config)
|
request.app.frigate_config = config
|
||||||
|
request.app.genai_manager.update_config(config)
|
||||||
|
|
||||||
|
if request.app.profile_manager is not None:
|
||||||
|
request.app.profile_manager.update_config(config)
|
||||||
|
|
||||||
|
if request.app.stats_emitter is not None:
|
||||||
|
request.app.stats_emitter.config = config
|
||||||
|
|
||||||
|
if request.app.dispatcher is not None:
|
||||||
|
request.app.dispatcher.config = config
|
||||||
|
for comm in request.app.dispatcher.comms:
|
||||||
|
comm.config = config
|
||||||
|
|
||||||
if body.update_topic:
|
if body.update_topic:
|
||||||
if body.update_topic.startswith("config/cameras/"):
|
if body.update_topic.startswith("config/cameras/"):
|
||||||
@@ -966,26 +967,11 @@ def config_set(request: Request, body: AppConfigSetBody):
|
|||||||
body.update_topic, settings
|
body.update_topic, settings
|
||||||
)
|
)
|
||||||
|
|
||||||
# a config/cameras/* topic publishes camera copies, a
|
|
||||||
# global topic the global object. FrigateConfig.parse
|
|
||||||
# folds some global sections down into every camera,
|
|
||||||
# and workers read both objects, so any such section
|
|
||||||
# needs its camera copies sent alongside the global
|
|
||||||
# publish above.
|
|
||||||
if body.update_topic == "config/birdseye":
|
|
||||||
publish_camera_section_updates(
|
|
||||||
request.app, config, CameraConfigUpdateEnum.birdseye
|
|
||||||
)
|
|
||||||
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content=(
|
content=(
|
||||||
{
|
{
|
||||||
"success": True,
|
"success": True,
|
||||||
"message": (
|
"message": "Config successfully updated, restart to apply",
|
||||||
"Config successfully updated"
|
|
||||||
if body.requires_restart == 0
|
|
||||||
else "Config successfully updated, restart to apply"
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
status_code=200,
|
status_code=200,
|
||||||
|
|||||||
+17
-48
@@ -31,7 +31,7 @@ from frigate.api.media_auth import (
|
|||||||
deny_response_for_media_uri,
|
deny_response_for_media_uri,
|
||||||
is_role_restricted,
|
is_role_restricted,
|
||||||
)
|
)
|
||||||
from frigate.config import AuthConfig, ProxyConfig
|
from frigate.config import AuthConfig, NetworkingConfig, ProxyConfig
|
||||||
from frigate.const import CONFIG_DIR, JWT_SECRET_ENV_VAR, PASSWORD_HASH_ALGORITHM
|
from frigate.const import CONFIG_DIR, JWT_SECRET_ENV_VAR, PASSWORD_HASH_ALGORITHM
|
||||||
from frigate.models import User
|
from frigate.models import User
|
||||||
|
|
||||||
@@ -85,7 +85,6 @@ def require_admin_by_default():
|
|||||||
"/sub_labels",
|
"/sub_labels",
|
||||||
"/plus/models",
|
"/plus/models",
|
||||||
"/recognized_license_plates",
|
"/recognized_license_plates",
|
||||||
"/classification/attributes",
|
|
||||||
"/timeline",
|
"/timeline",
|
||||||
"/timeline/hourly",
|
"/timeline/hourly",
|
||||||
"/recordings/storage",
|
"/recordings/storage",
|
||||||
@@ -416,7 +415,7 @@ def create_encoded_jwt(user, role, expiration, secret):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def set_jwt_cookie(response: Response, cookie_name, encoded_jwt, max_age, secure):
|
def set_jwt_cookie(response: Response, cookie_name, encoded_jwt, expiration, secure):
|
||||||
# TODO: ideally this would set secure as well, but that requires TLS
|
# TODO: ideally this would set secure as well, but that requires TLS
|
||||||
# SameSite is intentionally left unset (browsers default to Lax). Setting
|
# SameSite is intentionally left unset (browsers default to Lax). Setting
|
||||||
# SameSite=Lax/Strict would stop the cookie from being sent in cross-origin
|
# SameSite=Lax/Strict would stop the cookie from being sent in cross-origin
|
||||||
@@ -428,7 +427,7 @@ def set_jwt_cookie(response: Response, cookie_name, encoded_jwt, max_age, secure
|
|||||||
key=cookie_name,
|
key=cookie_name,
|
||||||
value=encoded_jwt,
|
value=encoded_jwt,
|
||||||
httponly=True,
|
httponly=True,
|
||||||
max_age=max_age,
|
expires=expiration,
|
||||||
secure=secure,
|
secure=secure,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -621,18 +620,18 @@ def resolve_role(
|
|||||||
def auth(request: Request):
|
def auth(request: Request):
|
||||||
auth_config: AuthConfig = request.app.frigate_config.auth
|
auth_config: AuthConfig = request.app.frigate_config.auth
|
||||||
proxy_config: ProxyConfig = request.app.frigate_config.proxy
|
proxy_config: ProxyConfig = request.app.frigate_config.proxy
|
||||||
|
networking_config: NetworkingConfig = request.app.frigate_config.networking
|
||||||
|
|
||||||
success_response = Response("", status_code=202)
|
success_response = Response("", status_code=202)
|
||||||
|
|
||||||
|
# handle case where internal port is a string with ip:port
|
||||||
|
internal_port = networking_config.listen.internal
|
||||||
|
if type(internal_port) is str:
|
||||||
|
internal_port = int(internal_port.split(":")[-1])
|
||||||
|
|
||||||
# dont require auth if the request is on the internal port
|
# dont require auth if the request is on the internal port
|
||||||
# this header is set by Frigate's nginx proxy, so it cant be spoofed.
|
# this header is set by Frigate's nginx proxy, so it cant be spoofed
|
||||||
# the port is the boot-time snapshot rather than the live config value:
|
if int(request.headers.get("x-server-port", default=0)) == internal_port:
|
||||||
# nginx's listeners are fixed at container start, so an in-memory config
|
|
||||||
# change must never move the port that is trusted here
|
|
||||||
if (
|
|
||||||
int(request.headers.get("x-server-port", default=0))
|
|
||||||
== request.app.auth_internal_port
|
|
||||||
):
|
|
||||||
success_response.headers["remote-user"] = "anonymous"
|
success_response.headers["remote-user"] = "anonymous"
|
||||||
success_response.headers["remote-role"] = "admin"
|
success_response.headers["remote-role"] = "admin"
|
||||||
return success_response
|
return success_response
|
||||||
@@ -763,7 +762,7 @@ def auth(request: Request):
|
|||||||
success_response,
|
success_response,
|
||||||
JWT_COOKIE_NAME,
|
JWT_COOKIE_NAME,
|
||||||
new_encoded_jwt,
|
new_encoded_jwt,
|
||||||
JWT_SESSION_LENGTH,
|
new_expiration,
|
||||||
JWT_COOKIE_SECURE,
|
JWT_COOKIE_SECURE,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -876,11 +875,7 @@ def login(request: Request, body: AppPostLoginBody):
|
|||||||
encoded_jwt = create_encoded_jwt(user, role, expiration, request.app.jwt_token)
|
encoded_jwt = create_encoded_jwt(user, role, expiration, request.app.jwt_token)
|
||||||
response = Response("", 200)
|
response = Response("", 200)
|
||||||
set_jwt_cookie(
|
set_jwt_cookie(
|
||||||
response,
|
response, JWT_COOKIE_NAME, encoded_jwt, expiration, JWT_COOKIE_SECURE
|
||||||
JWT_COOKIE_NAME,
|
|
||||||
encoded_jwt,
|
|
||||||
JWT_SESSION_LENGTH,
|
|
||||||
JWT_COOKIE_SECURE,
|
|
||||||
)
|
)
|
||||||
# Clear admin_first_time_login flag after successful admin login so the
|
# Clear admin_first_time_login flag after successful admin login so the
|
||||||
# UI stops showing the first-time login documentation link.
|
# UI stops showing the first-time login documentation link.
|
||||||
@@ -972,7 +967,6 @@ def delete_user(request: Request, username: str):
|
|||||||
summary="Update user password",
|
summary="Update user password",
|
||||||
description="Updates a user's password. Users can only change their own password unless they have admin role. Requires the current password to verify identity for non-admin users. Password must be at least 12 characters long. If user changes their own password, a new JWT cookie is automatically issued.",
|
description="Updates a user's password. Users can only change their own password unless they have admin role. Requires the current password to verify identity for non-admin users. Password must be at least 12 characters long. If user changes their own password, a new JWT cookie is automatically issued.",
|
||||||
)
|
)
|
||||||
@limiter.limit(limit_value=rateLimiter.get_limit)
|
|
||||||
async def update_password(
|
async def update_password(
|
||||||
request: Request,
|
request: Request,
|
||||||
username: str,
|
username: str,
|
||||||
@@ -986,11 +980,10 @@ async def update_password(
|
|||||||
current_username = current_user.get("username")
|
current_username = current_user.get("username")
|
||||||
current_role = current_user.get("role")
|
current_role = current_user.get("role")
|
||||||
|
|
||||||
# Only admins may target another account. This has to cover every non-admin
|
# viewers can only change their own password
|
||||||
# role rather than just viewer, since custom roles are arbitrary names
|
if current_role == "viewer" and current_username != username:
|
||||||
if current_role != "admin" and current_username != username:
|
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=403, detail="Users can only update their own password"
|
status_code=403, detail="Viewers can only update their own password"
|
||||||
)
|
)
|
||||||
|
|
||||||
HASH_ITERATIONS = request.app.frigate_config.auth.hash_iterations
|
HASH_ITERATIONS = request.app.frigate_config.auth.hash_iterations
|
||||||
@@ -1044,11 +1037,7 @@ async def update_password(
|
|||||||
)
|
)
|
||||||
# Set new JWT cookie on response
|
# Set new JWT cookie on response
|
||||||
set_jwt_cookie(
|
set_jwt_cookie(
|
||||||
response,
|
response, JWT_COOKIE_NAME, encoded_jwt, expiration, JWT_COOKIE_SECURE
|
||||||
JWT_COOKIE_NAME,
|
|
||||||
encoded_jwt,
|
|
||||||
JWT_SESSION_LENGTH,
|
|
||||||
JWT_COOKIE_SECURE,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
@@ -1254,23 +1243,3 @@ async def get_allowed_cameras_for_filter(request: Request):
|
|||||||
all_camera_names = set(request.app.frigate_config.cameras.keys())
|
all_camera_names = set(request.app.frigate_config.cameras.keys())
|
||||||
roles_dict = request.app.frigate_config.auth.roles
|
roles_dict = request.app.frigate_config.auth.roles
|
||||||
return User.get_allowed_cameras(role, roles_dict, all_camera_names)
|
return User.get_allowed_cameras(role, roles_dict, all_camera_names)
|
||||||
|
|
||||||
|
|
||||||
async def require_full_camera_access(
|
|
||||||
request: Request,
|
|
||||||
allowed_cameras: list[str] = Depends(get_allowed_cameras_for_filter),
|
|
||||||
):
|
|
||||||
"""Dependency for endpoints returning data that spans every camera.
|
|
||||||
|
|
||||||
Some responses cannot be meaningfully scoped to a subset of cameras, so
|
|
||||||
rather than filter them the endpoint is limited to callers who can already
|
|
||||||
see every camera. Admin and viewer always qualify; a custom role qualifies
|
|
||||||
only when its camera list covers all configured cameras.
|
|
||||||
"""
|
|
||||||
all_camera_names = set(request.app.frigate_config.cameras.keys())
|
|
||||||
|
|
||||||
if not all_camera_names.issubset(allowed_cameras):
|
|
||||||
raise HTTPException(
|
|
||||||
status_code=403,
|
|
||||||
detail="Access to all cameras is required for this endpoint",
|
|
||||||
)
|
|
||||||
|
|||||||
+4
-48
@@ -25,7 +25,6 @@ from frigate.api.auth import (
|
|||||||
require_go2rtc_stream_access,
|
require_go2rtc_stream_access,
|
||||||
require_role,
|
require_role,
|
||||||
)
|
)
|
||||||
from frigate.api.config_util import swap_runtime_config
|
|
||||||
from frigate.api.defs.request.app_body import CameraSetBody
|
from frigate.api.defs.request.app_body import CameraSetBody
|
||||||
from frigate.api.defs.tags import Tags
|
from frigate.api.defs.tags import Tags
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
@@ -1255,14 +1254,9 @@ async def delete_camera(
|
|||||||
status_code=500,
|
status_code=500,
|
||||||
)
|
)
|
||||||
|
|
||||||
# rebind every collaborator to the new config and re-layer runtime
|
# Update runtime config
|
||||||
# toggles for the surviving cameras, same as /api/config/set
|
request.app.frigate_config = config
|
||||||
swap_runtime_config(request.app, config)
|
request.app.genai_manager.update_config(config)
|
||||||
|
|
||||||
# drop the deleted camera's persisted overrides so a camera later
|
|
||||||
# added under the same name doesn't inherit them
|
|
||||||
if request.app.dispatcher is not None:
|
|
||||||
request.app.dispatcher.clear_runtime_state_for_camera(camera_name)
|
|
||||||
|
|
||||||
# Publish removal to stop ffmpeg processes and clean up runtime state
|
# Publish removal to stop ffmpeg processes and clean up runtime state
|
||||||
request.app.config_publisher.publish_update(
|
request.app.config_publisher.publish_update(
|
||||||
@@ -1328,45 +1322,7 @@ def camera_set(
|
|||||||
body: CameraSetBody,
|
body: CameraSetBody,
|
||||||
sub_command: str | None = None,
|
sub_command: str | None = None,
|
||||||
):
|
):
|
||||||
"""Set a camera feature state. Use camera_name='*' to target all cameras.
|
"""Set a camera feature state. Use camera_name='*' to target all cameras."""
|
||||||
|
|
||||||
The value to set is sent in the request body as `{"value": "<value>"}`.
|
|
||||||
|
|
||||||
| Feature | Accepted values |
|
|
||||||
| --- | --- |
|
|
||||||
| `enabled` | `ON`, `OFF` |
|
|
||||||
| `detect` | `ON`, `OFF` |
|
|
||||||
| `motion` | `ON`, `OFF` |
|
|
||||||
| `recordings` | `ON`, `OFF` |
|
|
||||||
| `snapshots` | `ON`, `OFF` |
|
|
||||||
| `audio` | `ON`, `OFF` |
|
|
||||||
| `audio_transcription` | `ON`, `OFF` |
|
|
||||||
| `notifications` | `ON`, `OFF` |
|
|
||||||
| `review_alerts` | `ON`, `OFF` |
|
|
||||||
| `review_detections` | `ON`, `OFF` |
|
|
||||||
| `object_descriptions` | `ON`, `OFF` |
|
|
||||||
| `review_descriptions` | `ON`, `OFF` |
|
|
||||||
| `improve_contrast` | `ON`, `OFF` |
|
|
||||||
| `ptz_autotracker` | `ON`, `OFF` |
|
|
||||||
| `birdseye` | `ON`, `OFF` |
|
|
||||||
| `birdseye_mode` | `CONTINUOUS`, `MOTION`, `OBJECTS` |
|
|
||||||
| `motion_contour_area` | integer |
|
|
||||||
| `motion_threshold` | integer |
|
|
||||||
| `motion_mask` | `ON`, `OFF` |
|
|
||||||
| `object_mask` | `ON`, `OFF` |
|
|
||||||
| `zone` | `ON`, `OFF` |
|
|
||||||
| `profile` | a profile name, or `none` to deactivate |
|
|
||||||
|
|
||||||
`motion_mask`, `object_mask`, and `zone` require the `sub_command` path
|
|
||||||
parameter to be set to the name of the mask or zone. All other features
|
|
||||||
reject a sub-command.
|
|
||||||
|
|
||||||
`profile` applies globally rather than per camera, so it requires
|
|
||||||
`camera_name` to be `*`.
|
|
||||||
|
|
||||||
These features map to the equivalent MQTT topics, which document the
|
|
||||||
behavior of each value in more detail.
|
|
||||||
"""
|
|
||||||
dispatcher = request.app.dispatcher
|
dispatcher = request.app.dispatcher
|
||||||
frigate_config: FrigateConfig = request.app.frigate_config
|
frigate_config: FrigateConfig = request.app.frigate_config
|
||||||
|
|
||||||
|
|||||||
+7
-28
@@ -7,7 +7,7 @@ import operator
|
|||||||
import time
|
import time
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
from typing import Any, Literal
|
from typing import Any
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
from fastapi import APIRouter, Body, Depends, HTTPException, Request
|
from fastapi import APIRouter, Body, Depends, HTTPException, Request
|
||||||
@@ -37,7 +37,6 @@ from frigate.api.defs.response.chat_response import (
|
|||||||
from frigate.api.defs.tags import Tags
|
from frigate.api.defs.tags import Tags
|
||||||
from frigate.api.event import _build_attribute_filter_clause, events
|
from frigate.api.event import _build_attribute_filter_clause, events
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
from frigate.config.classification import SemanticSearchModelEnum
|
|
||||||
from frigate.genai.prompts import (
|
from frigate.genai.prompts import (
|
||||||
build_chat_system_prompt,
|
build_chat_system_prompt,
|
||||||
get_attribute_classifications,
|
get_attribute_classifications,
|
||||||
@@ -87,23 +86,10 @@ def get_tools(request: Request) -> JSONResponse:
|
|||||||
tools = get_tool_definitions(
|
tools = get_tool_definitions(
|
||||||
semantic_search_enabled=semantic_search_enabled,
|
semantic_search_enabled=semantic_search_enabled,
|
||||||
attribute_classifications=attribute_classifications,
|
attribute_classifications=attribute_classifications,
|
||||||
embeddings_language=_embeddings_language(config),
|
|
||||||
)
|
)
|
||||||
return JSONResponse(content={"tools": tools})
|
return JSONResponse(content={"tools": tools})
|
||||||
|
|
||||||
|
|
||||||
def _embeddings_language(config: FrigateConfig) -> Literal["english", "multi"]:
|
|
||||||
"""Return the language capability of the configured embeddings model.
|
|
||||||
|
|
||||||
JinaV1 is English-only; every other option (JinaV2 or a GenAI embeddings
|
|
||||||
provider) handles multiple languages.
|
|
||||||
"""
|
|
||||||
if config.semantic_search.model == SemanticSearchModelEnum.jinav1:
|
|
||||||
return "english"
|
|
||||||
|
|
||||||
return "multi"
|
|
||||||
|
|
||||||
|
|
||||||
def _resolve_zones(
|
def _resolve_zones(
|
||||||
zones: list[str],
|
zones: list[str],
|
||||||
config: FrigateConfig,
|
config: FrigateConfig,
|
||||||
@@ -112,14 +98,11 @@ def _resolve_zones(
|
|||||||
"""Map zone names to their canonical config keys, case-insensitively.
|
"""Map zone names to their canonical config keys, case-insensitively.
|
||||||
|
|
||||||
LLMs frequently echo a user's casing ("Front Yard") instead of the
|
LLMs frequently echo a user's casing ("Front Yard") instead of the
|
||||||
configured key ("front_yard"), or fall back to a zone's friendly name
|
configured key ("front_yard"). The downstream zone filter is a SQLite GLOB
|
||||||
("Front Walkway") instead of its ID ("front_walk"). The downstream zone
|
over the JSON-encoded zones column, which is case-sensitive — so an
|
||||||
filter is a SQLite GLOB over the JSON-encoded zones column, which stores
|
unnormalized name silently returns zero matches. Build a lookup over the
|
||||||
config keys and is case-sensitive — so an unnormalized name silently
|
relevant cameras' configured zones and substitute when we find a match;
|
||||||
returns zero matches. Build a lookup over the relevant cameras' configured
|
unknown names pass through so behavior matches what the model asked for.
|
||||||
zones, keyed by both the config key and the friendly name, and substitute
|
|
||||||
when we find a match; unknown names pass through so behavior matches what
|
|
||||||
the model asked for.
|
|
||||||
"""
|
"""
|
||||||
if not zones:
|
if not zones:
|
||||||
return zones
|
return zones
|
||||||
@@ -129,11 +112,8 @@ def _resolve_zones(
|
|||||||
camera_config = config.cameras.get(camera_id)
|
camera_config = config.cameras.get(camera_id)
|
||||||
if camera_config is None:
|
if camera_config is None:
|
||||||
continue
|
continue
|
||||||
for zone_name, zone_config in camera_config.zones.items():
|
for zone_name in camera_config.zones.keys():
|
||||||
lookup.setdefault(zone_name.lower(), zone_name)
|
lookup.setdefault(zone_name.lower(), zone_name)
|
||||||
lookup.setdefault(
|
|
||||||
zone_config.get_formatted_name(zone_name).lower(), zone_name
|
|
||||||
)
|
|
||||||
|
|
||||||
return [lookup.get(z.lower(), z) for z in zones]
|
return [lookup.get(z.lower(), z) for z in zones]
|
||||||
|
|
||||||
@@ -1154,7 +1134,6 @@ async def chat_completion(
|
|||||||
tools = get_tool_definitions(
|
tools = get_tool_definitions(
|
||||||
semantic_search_enabled=semantic_search_enabled,
|
semantic_search_enabled=semantic_search_enabled,
|
||||||
attribute_classifications=attribute_classifications,
|
attribute_classifications=attribute_classifications,
|
||||||
embeddings_language=_embeddings_language(config),
|
|
||||||
)
|
)
|
||||||
conversation = []
|
conversation = []
|
||||||
|
|
||||||
|
|||||||
+64
-134
@@ -11,10 +11,11 @@ from typing import Any
|
|||||||
import cv2
|
import cv2
|
||||||
from fastapi import APIRouter, Depends, Request, UploadFile
|
from fastapi import APIRouter, Depends, Request, UploadFile
|
||||||
from fastapi.responses import JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
|
from pathvalidate import sanitize_filename
|
||||||
from peewee import DoesNotExist
|
from peewee import DoesNotExist
|
||||||
from playhouse.shortcuts import model_to_dict
|
from playhouse.shortcuts import model_to_dict
|
||||||
|
|
||||||
from frigate.api.auth import require_full_camera_access, require_role
|
from frigate.api.auth import require_role
|
||||||
from frigate.api.defs.request.classification_body import (
|
from frigate.api.defs.request.classification_body import (
|
||||||
AudioTranscriptionBody,
|
AudioTranscriptionBody,
|
||||||
DeleteFaceImagesBody,
|
DeleteFaceImagesBody,
|
||||||
@@ -42,21 +43,12 @@ from frigate.util.classification import (
|
|||||||
write_training_metadata,
|
write_training_metadata,
|
||||||
)
|
)
|
||||||
from frigate.util.file import get_event_snapshot
|
from frigate.util.file import get_event_snapshot
|
||||||
from frigate.util.path import safe_join, sanitize_path_component
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
router = APIRouter(tags=[Tags.classification])
|
router = APIRouter(tags=[Tags.classification])
|
||||||
|
|
||||||
|
|
||||||
def invalid_name_response(value: str) -> JSONResponse:
|
|
||||||
"""Response for a name that cannot be used as a path component."""
|
|
||||||
return JSONResponse(
|
|
||||||
content={"success": False, "message": f"Invalid name: {value}"},
|
|
||||||
status_code=400,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/faces",
|
"/faces",
|
||||||
response_model=FacesResponse,
|
response_model=FacesResponse,
|
||||||
@@ -106,7 +98,9 @@ def reclassify_face(request: Request, body: dict = None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
json: dict[str, Any] = body or {}
|
json: dict[str, Any] = body or {}
|
||||||
training_file = safe_join(FACE_DIR, "train", json.get("training_file", ""))
|
training_file = os.path.join(
|
||||||
|
FACE_DIR, f"train/{sanitize_filename(json.get('training_file', ''))}"
|
||||||
|
)
|
||||||
|
|
||||||
if not training_file or not os.path.isfile(training_file):
|
if not training_file or not os.path.isfile(training_file):
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@@ -156,10 +150,8 @@ def train_face(request: Request, name: str, body: dict = None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
json: dict[str, Any] = body or {}
|
json: dict[str, Any] = body or {}
|
||||||
training_file_name = json.get("training_file", "")
|
training_file_name = sanitize_filename(json.get("training_file", ""))
|
||||||
training_file = (
|
training_file = os.path.join(FACE_DIR, f"train/{training_file_name}")
|
||||||
safe_join(FACE_DIR, "train", training_file_name) if training_file_name else None
|
|
||||||
)
|
|
||||||
event_id = json.get("event_id")
|
event_id = json.get("event_id")
|
||||||
|
|
||||||
if not training_file_name and not event_id:
|
if not training_file_name and not event_id:
|
||||||
@@ -173,9 +165,7 @@ def train_face(request: Request, name: str, body: dict = None):
|
|||||||
status_code=400,
|
status_code=400,
|
||||||
)
|
)
|
||||||
|
|
||||||
if training_file_name and (
|
if training_file_name and not os.path.isfile(training_file):
|
||||||
training_file is None or not os.path.isfile(training_file)
|
|
||||||
):
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content=(
|
content=(
|
||||||
{
|
{
|
||||||
@@ -186,13 +176,9 @@ def train_face(request: Request, name: str, body: dict = None):
|
|||||||
status_code=404,
|
status_code=404,
|
||||||
)
|
)
|
||||||
|
|
||||||
sanitized_name = sanitize_path_component(name)
|
sanitized_name = sanitize_filename(name)
|
||||||
new_file_folder = safe_join(FACE_DIR, name)
|
|
||||||
|
|
||||||
if sanitized_name is None or new_file_folder is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
new_name = f"{sanitized_name}-{datetime.datetime.now().timestamp()}.webp"
|
new_name = f"{sanitized_name}-{datetime.datetime.now().timestamp()}.webp"
|
||||||
|
new_file_folder = os.path.join(FACE_DIR, f"{sanitized_name}")
|
||||||
|
|
||||||
os.makedirs(new_file_folder, exist_ok=True)
|
os.makedirs(new_file_folder, exist_ok=True)
|
||||||
|
|
||||||
@@ -275,12 +261,9 @@ async def create_face(request: Request, name: str):
|
|||||||
content={"message": "Face recognition is not enabled.", "success": False},
|
content={"message": "Face recognition is not enabled.", "success": False},
|
||||||
)
|
)
|
||||||
|
|
||||||
face_folder = safe_join(FACE_DIR, name.replace(" ", "_"))
|
os.makedirs(
|
||||||
|
os.path.join(FACE_DIR, sanitize_filename(name.replace(" ", "_"))), exist_ok=True
|
||||||
if face_folder is None:
|
)
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
os.makedirs(face_folder, exist_ok=True)
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
status_code=200,
|
status_code=200,
|
||||||
content={"success": False, "message": "Successfully created face folder."},
|
content={"success": False, "message": "Successfully created face folder."},
|
||||||
@@ -304,9 +287,6 @@ def register_face(request: Request, name: str, file: UploadFile):
|
|||||||
content={"message": "Face recognition is not enabled.", "success": False},
|
content={"message": "Face recognition is not enabled.", "success": False},
|
||||||
)
|
)
|
||||||
|
|
||||||
if sanitize_path_component(name) is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
context: EmbeddingsContext = request.app.embeddings
|
context: EmbeddingsContext = request.app.embeddings
|
||||||
result = None if context is None else context.register_face(name, file.file.read())
|
result = None if context is None else context.register_face(name, file.file.read())
|
||||||
|
|
||||||
@@ -376,8 +356,8 @@ def reclassify_face_image(request: Request, name: str, body: dict = None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
json: dict[str, Any] = body or {}
|
json: dict[str, Any] = body or {}
|
||||||
image_id = sanitize_path_component(json.get("id", ""))
|
image_id = sanitize_filename(json.get("id", ""))
|
||||||
new_name = sanitize_path_component(json.get("new_name", ""))
|
new_name = sanitize_filename(json.get("new_name", ""))
|
||||||
|
|
||||||
if not image_id or not new_name:
|
if not image_id or not new_name:
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@@ -401,12 +381,7 @@ def reclassify_face_image(request: Request, name: str, body: dict = None):
|
|||||||
status_code=400,
|
status_code=400,
|
||||||
)
|
)
|
||||||
|
|
||||||
source_folder = safe_join(FACE_DIR, name)
|
source_folder = os.path.join(FACE_DIR, sanitize_filename(name))
|
||||||
target_folder = safe_join(FACE_DIR, new_name)
|
|
||||||
|
|
||||||
if source_folder is None or target_folder is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
source_file = os.path.join(source_folder, image_id)
|
source_file = os.path.join(source_folder, image_id)
|
||||||
|
|
||||||
if not os.path.isfile(source_file):
|
if not os.path.isfile(source_file):
|
||||||
@@ -421,6 +396,7 @@ def reclassify_face_image(request: Request, name: str, body: dict = None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_filename = f"{new_name}-{datetime.datetime.now().timestamp()}.webp"
|
target_filename = f"{new_name}-{datetime.datetime.now().timestamp()}.webp"
|
||||||
|
target_folder = os.path.join(FACE_DIR, new_name)
|
||||||
|
|
||||||
os.makedirs(target_folder, exist_ok=True)
|
os.makedirs(target_folder, exist_ok=True)
|
||||||
shutil.move(source_file, os.path.join(target_folder, target_filename))
|
shutil.move(source_file, os.path.join(target_folder, target_filename))
|
||||||
@@ -454,19 +430,8 @@ def deregister_faces(request: Request, name: str, body: DeleteFaceImagesBody):
|
|||||||
content={"message": "Face recognition is not enabled.", "success": False},
|
content={"message": "Face recognition is not enabled.", "success": False},
|
||||||
)
|
)
|
||||||
|
|
||||||
sanitized_name = sanitize_path_component(name)
|
|
||||||
|
|
||||||
if sanitized_name is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
sanitized_ids = [
|
|
||||||
component
|
|
||||||
for component in map(sanitize_path_component, body.ids)
|
|
||||||
if component is not None
|
|
||||||
]
|
|
||||||
|
|
||||||
context: EmbeddingsContext = request.app.embeddings
|
context: EmbeddingsContext = request.app.embeddings
|
||||||
context.delete_face_ids(sanitized_name, sanitized_ids)
|
context.delete_face_ids(name, map(lambda file: sanitize_filename(file), body.ids))
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content=({"success": True, "message": "Successfully deleted faces."}),
|
content=({"success": True, "message": "Successfully deleted faces."}),
|
||||||
status_code=200,
|
status_code=200,
|
||||||
@@ -677,11 +642,7 @@ def transcribe_audio(request: Request, body: AudioTranscriptionBody):
|
|||||||
def get_classification_dataset(name: str):
|
def get_classification_dataset(name: str):
|
||||||
dataset_dict: dict[str, list[str]] = {}
|
dataset_dict: dict[str, list[str]] = {}
|
||||||
|
|
||||||
sanitized_name = sanitize_path_component(name)
|
dataset_dir = os.path.join(CLIPS_DIR, sanitize_filename(name), "dataset")
|
||||||
dataset_dir = safe_join(CLIPS_DIR, name, "dataset")
|
|
||||||
|
|
||||||
if sanitized_name is None or dataset_dir is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
if not os.path.exists(dataset_dir):
|
if not os.path.exists(dataset_dir):
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@@ -703,8 +664,8 @@ def get_classification_dataset(name: str):
|
|||||||
dataset_dict[category_name].append(file)
|
dataset_dict[category_name].append(file)
|
||||||
|
|
||||||
# Get training metadata
|
# Get training metadata
|
||||||
metadata = read_training_metadata(sanitized_name)
|
metadata = read_training_metadata(sanitize_filename(name))
|
||||||
current_image_count = get_dataset_image_count(sanitized_name)
|
current_image_count = get_dataset_image_count(sanitize_filename(name))
|
||||||
|
|
||||||
if metadata is None:
|
if metadata is None:
|
||||||
training_metadata = {
|
training_metadata = {
|
||||||
@@ -741,7 +702,6 @@ def get_classification_dataset(name: str):
|
|||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/classification/attributes",
|
"/classification/attributes",
|
||||||
dependencies=[Depends(require_full_camera_access)],
|
|
||||||
summary="Get custom classification attributes",
|
summary="Get custom classification attributes",
|
||||||
description="""Returns custom classification attributes for a given object type.
|
description="""Returns custom classification attributes for a given object type.
|
||||||
Only includes models with classification_type set to 'attribute'.
|
Only includes models with classification_type set to 'attribute'.
|
||||||
@@ -769,8 +729,8 @@ def get_custom_attributes(
|
|||||||
if object_type is not None and object_type not in model_objects:
|
if object_type is not None and object_type not in model_objects:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
dataset_dir = safe_join(CLIPS_DIR, model_key, "dataset")
|
dataset_dir = os.path.join(CLIPS_DIR, sanitize_filename(model_key), "dataset")
|
||||||
if dataset_dir is None or not os.path.exists(dataset_dir):
|
if not os.path.exists(dataset_dir):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
attributes = []
|
attributes = []
|
||||||
@@ -800,10 +760,7 @@ def get_custom_attributes(
|
|||||||
The name must exist in the classification models. Returns a success message or an error if the name is invalid.""",
|
The name must exist in the classification models. Returns a success message or an error if the name is invalid.""",
|
||||||
)
|
)
|
||||||
def get_classification_images(name: str):
|
def get_classification_images(name: str):
|
||||||
train_dir = safe_join(CLIPS_DIR, name, "train")
|
train_dir = os.path.join(CLIPS_DIR, sanitize_filename(name), "train")
|
||||||
|
|
||||||
if train_dir is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
if not os.path.exists(train_dir):
|
if not os.path.exists(train_dir):
|
||||||
return JSONResponse(status_code=200, content=[])
|
return JSONResponse(status_code=200, content=[])
|
||||||
@@ -874,17 +831,15 @@ def delete_classification_dataset_images(
|
|||||||
|
|
||||||
json: dict[str, Any] = body or {}
|
json: dict[str, Any] = body or {}
|
||||||
list_of_ids = json.get("ids", "")
|
list_of_ids = json.get("ids", "")
|
||||||
sanitized_name = sanitize_path_component(name)
|
folder = os.path.join(
|
||||||
folder = safe_join(CLIPS_DIR, name, "dataset", category)
|
CLIPS_DIR, sanitize_filename(name), "dataset", sanitize_filename(category)
|
||||||
|
)
|
||||||
if sanitized_name is None or folder is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
deleted_count = 0
|
deleted_count = 0
|
||||||
for id in list_of_ids:
|
for id in list_of_ids:
|
||||||
file_path = safe_join(folder, id)
|
file_path = os.path.join(folder, sanitize_filename(id))
|
||||||
|
|
||||||
if file_path and os.path.isfile(file_path):
|
if os.path.isfile(file_path):
|
||||||
os.unlink(file_path)
|
os.unlink(file_path)
|
||||||
deleted_count += 1
|
deleted_count += 1
|
||||||
|
|
||||||
@@ -895,6 +850,7 @@ def delete_classification_dataset_images(
|
|||||||
# This ensures the dataset is marked as changed after deletion
|
# This ensures the dataset is marked as changed after deletion
|
||||||
# (even if the total count happens to be the same after adding and deleting)
|
# (even if the total count happens to be the same after adding and deleting)
|
||||||
if deleted_count > 0:
|
if deleted_count > 0:
|
||||||
|
sanitized_name = sanitize_filename(name)
|
||||||
metadata = read_training_metadata(sanitized_name)
|
metadata = read_training_metadata(sanitized_name)
|
||||||
if metadata:
|
if metadata:
|
||||||
last_count = metadata.get("last_training_image_count", 0)
|
last_count = metadata.get("last_training_image_count", 0)
|
||||||
@@ -932,8 +888,8 @@ def reclassify_classification_image(
|
|||||||
)
|
)
|
||||||
|
|
||||||
json: dict[str, Any] = body or {}
|
json: dict[str, Any] = body or {}
|
||||||
image_id = sanitize_path_component(json.get("id", ""))
|
image_id = sanitize_filename(json.get("id", ""))
|
||||||
new_category = sanitize_path_component(json.get("new_category", ""))
|
new_category = sanitize_filename(json.get("new_category", ""))
|
||||||
|
|
||||||
if not image_id or not new_category:
|
if not image_id or not new_category:
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@@ -957,13 +913,10 @@ def reclassify_classification_image(
|
|||||||
status_code=400,
|
status_code=400,
|
||||||
)
|
)
|
||||||
|
|
||||||
sanitized_name = sanitize_path_component(name)
|
sanitized_name = sanitize_filename(name)
|
||||||
source_folder = safe_join(CLIPS_DIR, name, "dataset", category)
|
source_folder = os.path.join(
|
||||||
target_folder = safe_join(CLIPS_DIR, name, "dataset", new_category)
|
CLIPS_DIR, sanitized_name, "dataset", sanitize_filename(category)
|
||||||
|
)
|
||||||
if sanitized_name is None or source_folder is None or target_folder is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
source_file = os.path.join(source_folder, image_id)
|
source_file = os.path.join(source_folder, image_id)
|
||||||
|
|
||||||
if not os.path.isfile(source_file):
|
if not os.path.isfile(source_file):
|
||||||
@@ -980,6 +933,7 @@ def reclassify_classification_image(
|
|||||||
random_id = "".join(random.choices(string.ascii_lowercase + string.digits, k=6))
|
random_id = "".join(random.choices(string.ascii_lowercase + string.digits, k=6))
|
||||||
timestamp = datetime.datetime.now().timestamp()
|
timestamp = datetime.datetime.now().timestamp()
|
||||||
new_name = f"{new_category}-{timestamp}-{random_id}.png"
|
new_name = f"{new_category}-{timestamp}-{random_id}.png"
|
||||||
|
target_folder = os.path.join(CLIPS_DIR, sanitized_name, "dataset", new_category)
|
||||||
|
|
||||||
os.makedirs(target_folder, exist_ok=True)
|
os.makedirs(target_folder, exist_ok=True)
|
||||||
|
|
||||||
@@ -1029,7 +983,7 @@ def rename_classification_category(
|
|||||||
)
|
)
|
||||||
|
|
||||||
json: dict[str, Any] = body or {}
|
json: dict[str, Any] = body or {}
|
||||||
new_category = sanitize_path_component(json.get("new_category", ""))
|
new_category = sanitize_filename(json.get("new_category", ""))
|
||||||
|
|
||||||
if not new_category:
|
if not new_category:
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@@ -1042,12 +996,12 @@ def rename_classification_category(
|
|||||||
status_code=400,
|
status_code=400,
|
||||||
)
|
)
|
||||||
|
|
||||||
sanitized_name = sanitize_path_component(name)
|
old_folder = os.path.join(
|
||||||
old_folder = safe_join(CLIPS_DIR, name, "dataset", old_category)
|
CLIPS_DIR, sanitize_filename(name), "dataset", sanitize_filename(old_category)
|
||||||
new_folder = safe_join(CLIPS_DIR, name, "dataset", new_category)
|
)
|
||||||
|
new_folder = os.path.join(
|
||||||
if sanitized_name is None or old_folder is None or new_folder is None:
|
CLIPS_DIR, sanitize_filename(name), "dataset", new_category
|
||||||
return invalid_name_response(name)
|
)
|
||||||
|
|
||||||
if not os.path.exists(old_folder):
|
if not os.path.exists(old_folder):
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@@ -1076,6 +1030,7 @@ def rename_classification_category(
|
|||||||
|
|
||||||
# Mark dataset as ready to train by resetting training metadata
|
# Mark dataset as ready to train by resetting training metadata
|
||||||
# This ensures the dataset is marked as changed after renaming
|
# This ensures the dataset is marked as changed after renaming
|
||||||
|
sanitized_name = sanitize_filename(name)
|
||||||
write_training_metadata(sanitized_name, 0)
|
write_training_metadata(sanitized_name, 0)
|
||||||
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@@ -1123,20 +1078,13 @@ def categorize_classification_image(request: Request, name: str, body: dict = No
|
|||||||
)
|
)
|
||||||
|
|
||||||
json: dict[str, Any] = body or {}
|
json: dict[str, Any] = body or {}
|
||||||
category = sanitize_path_component(json.get("category", ""))
|
category = sanitize_filename(json.get("category", ""))
|
||||||
training_file_name = json.get("training_file", "")
|
training_file_name = sanitize_filename(json.get("training_file", ""))
|
||||||
training_file = (
|
training_file = os.path.join(
|
||||||
safe_join(CLIPS_DIR, name, "train", training_file_name)
|
CLIPS_DIR, sanitize_filename(name), "train", training_file_name
|
||||||
if training_file_name
|
|
||||||
else None
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if category is None:
|
if training_file_name and not os.path.isfile(training_file):
|
||||||
return invalid_name_response(json.get("category", ""))
|
|
||||||
|
|
||||||
if training_file_name and (
|
|
||||||
training_file is None or not os.path.isfile(training_file)
|
|
||||||
):
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content=(
|
content=(
|
||||||
{
|
{
|
||||||
@@ -1150,10 +1098,9 @@ def categorize_classification_image(request: Request, name: str, body: dict = No
|
|||||||
random_id = "".join(random.choices(string.ascii_lowercase + string.digits, k=6))
|
random_id = "".join(random.choices(string.ascii_lowercase + string.digits, k=6))
|
||||||
timestamp = datetime.datetime.now().timestamp()
|
timestamp = datetime.datetime.now().timestamp()
|
||||||
new_name = f"{category}-{timestamp}-{random_id}.png"
|
new_name = f"{category}-{timestamp}-{random_id}.png"
|
||||||
new_file_folder = safe_join(CLIPS_DIR, name, "dataset", category)
|
new_file_folder = os.path.join(
|
||||||
|
CLIPS_DIR, sanitize_filename(name), "dataset", category
|
||||||
if new_file_folder is None:
|
)
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
os.makedirs(new_file_folder, exist_ok=True)
|
os.makedirs(new_file_folder, exist_ok=True)
|
||||||
|
|
||||||
@@ -1191,10 +1138,9 @@ def create_classification_category(request: Request, name: str, category: str):
|
|||||||
status_code=404,
|
status_code=404,
|
||||||
)
|
)
|
||||||
|
|
||||||
category_folder = safe_join(CLIPS_DIR, name, "dataset", category)
|
category_folder = os.path.join(
|
||||||
|
CLIPS_DIR, sanitize_filename(name), "dataset", sanitize_filename(category)
|
||||||
if category_folder is None:
|
)
|
||||||
return invalid_name_response(category)
|
|
||||||
|
|
||||||
os.makedirs(category_folder, exist_ok=True)
|
os.makedirs(category_folder, exist_ok=True)
|
||||||
|
|
||||||
@@ -1233,15 +1179,12 @@ def delete_classification_train_images(request: Request, name: str, body: dict =
|
|||||||
|
|
||||||
json: dict[str, Any] = body or {}
|
json: dict[str, Any] = body or {}
|
||||||
list_of_ids = json.get("ids", "")
|
list_of_ids = json.get("ids", "")
|
||||||
folder = safe_join(CLIPS_DIR, name, "train")
|
folder = os.path.join(CLIPS_DIR, sanitize_filename(name), "train")
|
||||||
|
|
||||||
if folder is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
for id in list_of_ids:
|
for id in list_of_ids:
|
||||||
file_path = safe_join(folder, id)
|
file_path = os.path.join(folder, sanitize_filename(id))
|
||||||
|
|
||||||
if file_path and os.path.isfile(file_path):
|
if os.path.isfile(file_path):
|
||||||
os.unlink(file_path)
|
os.unlink(file_path)
|
||||||
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@@ -1258,11 +1201,7 @@ def delete_classification_train_images(request: Request, name: str, body: dict =
|
|||||||
)
|
)
|
||||||
async def generate_state_examples(request: Request, body: GenerateStateExamplesBody):
|
async def generate_state_examples(request: Request, body: GenerateStateExamplesBody):
|
||||||
"""Generate examples for state classification."""
|
"""Generate examples for state classification."""
|
||||||
model_name = sanitize_path_component(body.model_name)
|
model_name = sanitize_filename(body.model_name)
|
||||||
|
|
||||||
if model_name is None:
|
|
||||||
return invalid_name_response(body.model_name)
|
|
||||||
|
|
||||||
cameras_normalized = {
|
cameras_normalized = {
|
||||||
camera_name: tuple(crop)
|
camera_name: tuple(crop)
|
||||||
for camera_name, crop in body.cameras.items()
|
for camera_name, crop in body.cameras.items()
|
||||||
@@ -1285,11 +1224,7 @@ async def generate_state_examples(request: Request, body: GenerateStateExamplesB
|
|||||||
)
|
)
|
||||||
async def generate_object_examples(request: Request, body: GenerateObjectExamplesBody):
|
async def generate_object_examples(request: Request, body: GenerateObjectExamplesBody):
|
||||||
"""Generate examples for object classification."""
|
"""Generate examples for object classification."""
|
||||||
model_name = sanitize_path_component(body.model_name)
|
model_name = sanitize_filename(body.model_name)
|
||||||
|
|
||||||
if model_name is None:
|
|
||||||
return invalid_name_response(body.model_name)
|
|
||||||
|
|
||||||
collect_object_classification_examples(model_name, body.label)
|
collect_object_classification_examples(model_name, body.label)
|
||||||
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
@@ -1308,16 +1243,10 @@ async def generate_object_examples(request: Request, body: GenerateObjectExample
|
|||||||
Returns a success message.""",
|
Returns a success message.""",
|
||||||
)
|
)
|
||||||
def delete_classification_model(request: Request, name: str):
|
def delete_classification_model(request: Request, name: str):
|
||||||
# This endpoint intentionally accepts models that are not in the config, so
|
sanitized_name = sanitize_filename(name)
|
||||||
# there is no allow list to fall back on. Both paths below are recursive
|
|
||||||
# deletes, so an unusable name has to be rejected outright.
|
|
||||||
data_dir = safe_join(CLIPS_DIR, name)
|
|
||||||
model_dir = safe_join(MODEL_CACHE_DIR, name)
|
|
||||||
|
|
||||||
if data_dir is None or model_dir is None:
|
|
||||||
return invalid_name_response(name)
|
|
||||||
|
|
||||||
# Delete the classification model's data directory in clips
|
# Delete the classification model's data directory in clips
|
||||||
|
data_dir = os.path.join(CLIPS_DIR, sanitized_name)
|
||||||
if os.path.exists(data_dir):
|
if os.path.exists(data_dir):
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(data_dir)
|
shutil.rmtree(data_dir)
|
||||||
@@ -1326,6 +1255,7 @@ def delete_classification_model(request: Request, name: str):
|
|||||||
logger.debug(f"Failed to delete data directory for {name}: {e}")
|
logger.debug(f"Failed to delete data directory for {name}: {e}")
|
||||||
|
|
||||||
# Delete the classification model's files in model_cache
|
# Delete the classification model's files in model_cache
|
||||||
|
model_dir = os.path.join(MODEL_CACHE_DIR, sanitized_name)
|
||||||
if os.path.exists(model_dir):
|
if os.path.exists(model_dir):
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(model_dir)
|
shutil.rmtree(model_dir)
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
"""Shared helpers for applying a freshly parsed config to the running app."""
|
|
||||||
|
|
||||||
from fastapi import FastAPI
|
|
||||||
|
|
||||||
from frigate.config import FrigateConfig
|
|
||||||
from frigate.config.camera.updater import (
|
|
||||||
CameraConfigUpdateEnum,
|
|
||||||
CameraConfigUpdateTopic,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def publish_camera_section_updates(
|
|
||||||
app: FastAPI, config: FrigateConfig, update_type: CameraConfigUpdateEnum
|
|
||||||
) -> None:
|
|
||||||
"""Broadcast every camera's re-resolved value for a global section.
|
|
||||||
|
|
||||||
Global sections are folded into each camera at parse time and the camera
|
|
||||||
copies are what workers read, so send them rather than leave a worker to
|
|
||||||
guess which cameras were inheriting.
|
|
||||||
"""
|
|
||||||
for camera_name, camera_config in config.cameras.items():
|
|
||||||
settings = getattr(camera_config, update_type.name, None)
|
|
||||||
|
|
||||||
if settings is None:
|
|
||||||
continue
|
|
||||||
|
|
||||||
app.config_publisher.publish_update(
|
|
||||||
CameraConfigUpdateTopic(update_type, camera_name), settings
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def swap_runtime_config(app: FastAPI, config: FrigateConfig) -> None:
|
|
||||||
"""Point every long-lived collaborator at a newly parsed config object.
|
|
||||||
|
|
||||||
Both /api/config/set and camera deletion re-parse yaml into a fresh
|
|
||||||
FrigateConfig and must rebind the same set of references, or the API and
|
|
||||||
the dispatcher drift onto different objects (the API reports one camera
|
|
||||||
state while the dispatcher acts on another). Runtime toggle overrides are
|
|
||||||
re-layered last: the swap rebuilt every camera from yaml, so without this a
|
|
||||||
camera the user turned off would silently come back on.
|
|
||||||
"""
|
|
||||||
app.frigate_config = config
|
|
||||||
|
|
||||||
if app.config_holder is not None:
|
|
||||||
app.config_holder.set(config)
|
|
||||||
|
|
||||||
app.genai_manager.update_config(config)
|
|
||||||
|
|
||||||
if app.profile_manager is not None:
|
|
||||||
app.profile_manager.update_config(config)
|
|
||||||
|
|
||||||
if app.stats_emitter is not None:
|
|
||||||
app.stats_emitter.config = config
|
|
||||||
|
|
||||||
if app.dispatcher is not None:
|
|
||||||
app.dispatcher.config = config
|
|
||||||
|
|
||||||
for comm in app.dispatcher.comms:
|
|
||||||
comm.config = config
|
|
||||||
|
|
||||||
# workers still hold the live toggle values, so correct only the
|
|
||||||
# config object here rather than re-broadcasting every override
|
|
||||||
app.dispatcher.reapply_runtime_state_to_config()
|
|
||||||
@@ -13,7 +13,6 @@ from frigate.api.auth import require_role
|
|||||||
from frigate.api.defs.tags import Tags
|
from frigate.api.defs.tags import Tags
|
||||||
from frigate.jobs.debug_replay import (
|
from frigate.jobs.debug_replay import (
|
||||||
ExportDebugReplaySource,
|
ExportDebugReplaySource,
|
||||||
NoRecordingsError,
|
|
||||||
RecordingDebugReplaySource,
|
RecordingDebugReplaySource,
|
||||||
start_debug_replay_job,
|
start_debug_replay_job,
|
||||||
)
|
)
|
||||||
@@ -75,8 +74,7 @@ class DebugReplayStopResponse(BaseModel):
|
|||||||
response_model=DebugReplayStartResponse,
|
response_model=DebugReplayStartResponse,
|
||||||
status_code=202,
|
status_code=202,
|
||||||
responses={
|
responses={
|
||||||
400: {"description": "Invalid camera or time range"},
|
400: {"description": "Invalid camera, time range, or no recordings"},
|
||||||
404: {"description": "No recordings in the requested time range"},
|
|
||||||
409: {"description": "A replay session is already active"},
|
409: {"description": "A replay session is already active"},
|
||||||
},
|
},
|
||||||
dependencies=[Depends(require_role(["admin"]))],
|
dependencies=[Depends(require_role(["admin"]))],
|
||||||
@@ -115,14 +113,6 @@ async def start_debug_replay(request: Request, body: DebugReplayStartBody):
|
|||||||
},
|
},
|
||||||
status_code=409,
|
status_code=409,
|
||||||
)
|
)
|
||||||
except NoRecordingsError:
|
|
||||||
return JSONResponse(
|
|
||||||
content={
|
|
||||||
"success": False,
|
|
||||||
"message": "No recordings found in the selected time range",
|
|
||||||
},
|
|
||||||
status_code=404,
|
|
||||||
)
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
logger.exception("Rejected debug replay start request")
|
logger.exception("Rejected debug replay start request")
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class EventsQueryParams(BaseModel):
|
|||||||
zone: str | None = "all"
|
zone: str | None = "all"
|
||||||
zones: str | None = "all"
|
zones: str | None = "all"
|
||||||
limit: int | None = 100
|
limit: int | None = 100
|
||||||
offset: int | None = Field(0, ge=0)
|
|
||||||
after: float | None = None
|
after: float | None = None
|
||||||
before: float | None = None
|
before: float | None = None
|
||||||
time_range: str | None = DEFAULT_TIME_RANGE
|
time_range: str | None = DEFAULT_TIME_RANGE
|
||||||
@@ -56,7 +55,6 @@ class EventsSearchQueryParams(BaseModel):
|
|||||||
deprecated=True,
|
deprecated=True,
|
||||||
)
|
)
|
||||||
limit: int | None = 50
|
limit: int | None = 50
|
||||||
offset: int | None = Field(0, ge=0)
|
|
||||||
cameras: str | None = "all"
|
cameras: str | None = "all"
|
||||||
labels: str | None = "all"
|
labels: str | None = "all"
|
||||||
sub_labels: str | None = "all"
|
sub_labels: str | None = "all"
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class AppConfigSetBody(BaseModel):
|
|||||||
|
|
||||||
class GenAIProbeBody(BaseModel):
|
class GenAIProbeBody(BaseModel):
|
||||||
provider: GenAIProviderEnum
|
provider: GenAIProviderEnum
|
||||||
name: str | None = None
|
|
||||||
api_key: str | None = None
|
api_key: str | None = None
|
||||||
base_url: str | None = None
|
base_url: str | None = None
|
||||||
provider_options: dict[str, Any] = Field(default_factory=dict)
|
provider_options: dict[str, Any] = Field(default_factory=dict)
|
||||||
|
|||||||
+43
-62
@@ -16,6 +16,7 @@ import numpy as np
|
|||||||
from fastapi import APIRouter, Request
|
from fastapi import APIRouter, Request
|
||||||
from fastapi.params import Depends
|
from fastapi.params import Depends
|
||||||
from fastapi.responses import JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
|
from pathvalidate import sanitize_filename
|
||||||
from peewee import JOIN, DoesNotExist, fn, operator
|
from peewee import JOIN, DoesNotExist, fn, operator
|
||||||
from playhouse.shortcuts import model_to_dict
|
from playhouse.shortcuts import model_to_dict
|
||||||
|
|
||||||
@@ -55,12 +56,11 @@ from frigate.api.defs.response.generic_response import GenericResponse
|
|||||||
from frigate.api.defs.tags import Tags
|
from frigate.api.defs.tags import Tags
|
||||||
from frigate.comms.event_metadata_updater import EventMetadataTypeEnum
|
from frigate.comms.event_metadata_updater import EventMetadataTypeEnum
|
||||||
from frigate.config.classification import ObjectClassificationType
|
from frigate.config.classification import ObjectClassificationType
|
||||||
from frigate.const import CLIPS_DIR
|
from frigate.const import CLIPS_DIR, TRIGGER_DIR
|
||||||
from frigate.embeddings import EmbeddingsContext
|
from frigate.embeddings import EmbeddingsContext
|
||||||
from frigate.models import Event, ReviewSegment, Timeline, Trigger
|
from frigate.models import Event, ReviewSegment, Timeline, Trigger
|
||||||
from frigate.track.object_processing import TrackedObject
|
from frigate.track.object_processing import TrackedObject
|
||||||
from frigate.util.file import get_event_thumbnail_bytes, load_event_snapshot_image
|
from frigate.util.file import get_event_thumbnail_bytes, load_event_snapshot_image
|
||||||
from frigate.util.path import get_trigger_thumbnail_path, safe_join
|
|
||||||
from frigate.util.time import get_dst_transitions, get_tz_modifiers
|
from frigate.util.time import get_dst_transitions, get_tz_modifiers
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -129,7 +129,6 @@ def events(
|
|||||||
zones = zone
|
zones = zone
|
||||||
|
|
||||||
limit = params.limit
|
limit = params.limit
|
||||||
offset = params.offset
|
|
||||||
after = params.after
|
after = params.after
|
||||||
before = params.before
|
before = params.before
|
||||||
time_range = params.time_range
|
time_range = params.time_range
|
||||||
@@ -362,15 +361,11 @@ def events(
|
|||||||
else:
|
else:
|
||||||
order_by = Event.start_time.desc()
|
order_by = Event.start_time.desc()
|
||||||
|
|
||||||
# offset paging needs a stable order when scores or speeds tie
|
|
||||||
tiebreaker = [Event.id] if sort and sort.startswith(("score", "speed")) else []
|
|
||||||
|
|
||||||
events = (
|
events = (
|
||||||
Event.select(*selected_columns)
|
Event.select(*selected_columns)
|
||||||
.where(reduce(operator.and_, clauses))
|
.where(reduce(operator.and_, clauses))
|
||||||
.order_by(order_by, *tiebreaker)
|
.order_by(order_by)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.offset(offset)
|
|
||||||
.dicts()
|
.dicts()
|
||||||
.iterator()
|
.iterator()
|
||||||
)
|
)
|
||||||
@@ -523,7 +518,6 @@ def events_search(
|
|||||||
search_type = params.search_type
|
search_type = params.search_type
|
||||||
include_thumbnails = params.include_thumbnails
|
include_thumbnails = params.include_thumbnails
|
||||||
limit = params.limit
|
limit = params.limit
|
||||||
offset = params.offset
|
|
||||||
sort = params.sort
|
sort = params.sort
|
||||||
|
|
||||||
# Filters
|
# Filters
|
||||||
@@ -830,9 +824,6 @@ def events_search(
|
|||||||
if search_results:
|
if search_results:
|
||||||
events_query = events_query.where(Event.id << list(search_results.keys()))
|
events_query = events_query.where(Event.id << list(search_results.keys()))
|
||||||
|
|
||||||
# sorts below are stable, so this orders ties for offset paging
|
|
||||||
events_query = events_query.order_by(Event.id)
|
|
||||||
|
|
||||||
# Fetch events and process them in a single pass
|
# Fetch events and process them in a single pass
|
||||||
processed_events = []
|
processed_events = []
|
||||||
for event in events_query.dicts():
|
for event in events_query.dicts():
|
||||||
@@ -890,7 +881,7 @@ def events_search(
|
|||||||
processed_events.sort(key=lambda x: x["start_time"], reverse=True)
|
processed_events.sort(key=lambda x: x["start_time"], reverse=True)
|
||||||
|
|
||||||
# Limit the number of events returned
|
# Limit the number of events returned
|
||||||
processed_events = processed_events[offset:][:limit]
|
processed_events = processed_events[:limit]
|
||||||
|
|
||||||
return JSONResponse(content=processed_events)
|
return JSONResponse(content=processed_events)
|
||||||
|
|
||||||
@@ -1461,10 +1452,10 @@ async def set_attributes(
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# Get available labels from dataset directory
|
# Get available labels from dataset directory
|
||||||
dataset_dir = safe_join(CLIPS_DIR, model_key, "dataset")
|
dataset_dir = os.path.join(CLIPS_DIR, sanitize_filename(model_key), "dataset")
|
||||||
available_labels = set()
|
available_labels = set()
|
||||||
|
|
||||||
if dataset_dir and os.path.exists(dataset_dir):
|
if os.path.exists(dataset_dir):
|
||||||
for category_name in os.listdir(dataset_dir):
|
for category_name in os.listdir(dataset_dir):
|
||||||
category_dir = os.path.join(dataset_dir, category_name)
|
category_dir = os.path.join(dataset_dir, category_name)
|
||||||
if os.path.isdir(category_dir):
|
if os.path.isdir(category_dir):
|
||||||
@@ -1547,18 +1538,15 @@ async def set_description(
|
|||||||
event.data["description"] = new_description
|
event.data["description"] = new_description
|
||||||
event.save()
|
event.save()
|
||||||
|
|
||||||
context: EmbeddingsContext | None = request.app.embeddings
|
|
||||||
|
|
||||||
if context is not None:
|
|
||||||
if len(new_description) > 0:
|
|
||||||
# If semantic search is enabled, update the index
|
# If semantic search is enabled, update the index
|
||||||
if request.app.frigate_config.semantic_search.enabled:
|
if request.app.frigate_config.semantic_search.enabled:
|
||||||
|
context: EmbeddingsContext = request.app.embeddings
|
||||||
|
if len(new_description) > 0:
|
||||||
context.update_description(
|
context.update_description(
|
||||||
event_id,
|
event_id,
|
||||||
new_description,
|
new_description,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
# embeddings are always cleaned up so they don't outlive their description
|
|
||||||
context.db.delete_embeddings_description(event_ids=[event_id])
|
context.db.delete_embeddings_description(event_ids=[event_id])
|
||||||
|
|
||||||
response_message = (
|
response_message = (
|
||||||
@@ -1687,11 +1675,9 @@ async def delete_single_event(event_id: str, request: Request) -> dict:
|
|||||||
event.delete_instance()
|
event.delete_instance()
|
||||||
Timeline.delete().where(Timeline.source_id == event_id).execute()
|
Timeline.delete().where(Timeline.source_id == event_id).execute()
|
||||||
|
|
||||||
# embeddings are always cleaned up, even when semantic search is disabled,
|
# If semantic search is enabled, update the index
|
||||||
# so that they don't outlive their events
|
if request.app.frigate_config.semantic_search.enabled:
|
||||||
context: EmbeddingsContext | None = request.app.embeddings
|
context: EmbeddingsContext = request.app.embeddings
|
||||||
|
|
||||||
if context is not None:
|
|
||||||
context.db.delete_embeddings_thumbnail(event_ids=[event_id])
|
context.db.delete_embeddings_thumbnail(event_ids=[event_id])
|
||||||
context.db.delete_embeddings_description(event_ids=[event_id])
|
context.db.delete_embeddings_description(event_ids=[event_id])
|
||||||
|
|
||||||
@@ -1757,7 +1743,6 @@ async def delete_events(request: Request, body: EventsDeleteBody):
|
|||||||
NOTES:
|
NOTES:
|
||||||
- Creating a manual event does not trigger an update to /events MQTT topic.
|
- Creating a manual event does not trigger an update to /events MQTT topic.
|
||||||
- If a duration is set to null, the event will need to be ended manually by calling /events/{event_id}/end.
|
- If a duration is set to null, the event will need to be ended manually by calling /events/{event_id}/end.
|
||||||
- The review item is an alert unless the label is listed in the camera's review -> detections -> labels config.
|
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
def create_event(
|
def create_event(
|
||||||
@@ -1968,13 +1953,18 @@ def create_trigger_embedding(
|
|||||||
if body.type == "thumbnail":
|
if body.type == "thumbnail":
|
||||||
# Save image to the triggers directory
|
# Save image to the triggers directory
|
||||||
try:
|
try:
|
||||||
webp_path = get_trigger_thumbnail_path(camera_name, body.data)
|
os.makedirs(
|
||||||
|
os.path.join(TRIGGER_DIR, sanitize_filename(camera_name)),
|
||||||
if webp_path is None:
|
exist_ok=True,
|
||||||
raise ValueError(f"Invalid trigger thumbnail path for {body.data}")
|
)
|
||||||
|
with open(
|
||||||
os.makedirs(os.path.dirname(webp_path), exist_ok=True)
|
os.path.join(
|
||||||
with open(webp_path, "wb") as f:
|
TRIGGER_DIR,
|
||||||
|
sanitize_filename(camera_name),
|
||||||
|
f"{sanitize_filename(body.data)}.webp",
|
||||||
|
),
|
||||||
|
"wb",
|
||||||
|
) as f:
|
||||||
f.write(thumbnail)
|
f.write(thumbnail)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Writing thumbnail for trigger with data {body.data} in {camera_name}."
|
f"Writing thumbnail for trigger with data {body.data} in {camera_name}."
|
||||||
@@ -2046,15 +2036,9 @@ def update_trigger_embedding(
|
|||||||
if body.type == "description":
|
if body.type == "description":
|
||||||
embedding = context.generate_description_embedding(body.data)
|
embedding = context.generate_description_embedding(body.data)
|
||||||
elif body.type == "thumbnail":
|
elif body.type == "thumbnail":
|
||||||
webp_path = get_trigger_thumbnail_path(camera_name, body.data)
|
webp_file = sanitize_filename(body.data) + ".webp"
|
||||||
|
webp_path = os.path.join(
|
||||||
if webp_path is None:
|
TRIGGER_DIR, sanitize_filename(camera_name), webp_file
|
||||||
return JSONResponse(
|
|
||||||
content={
|
|
||||||
"success": False,
|
|
||||||
"message": f"Invalid data for {body.type} trigger",
|
|
||||||
},
|
|
||||||
status_code=400,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -2112,14 +2096,13 @@ def update_trigger_embedding(
|
|||||||
# Update existing trigger
|
# Update existing trigger
|
||||||
if trigger.data != body.data: # Delete old thumbnail only if data changes
|
if trigger.data != body.data: # Delete old thumbnail only if data changes
|
||||||
try:
|
try:
|
||||||
old_path = get_trigger_thumbnail_path(camera_name, trigger.data)
|
os.remove(
|
||||||
|
os.path.join(
|
||||||
if old_path is None:
|
TRIGGER_DIR,
|
||||||
raise ValueError(
|
sanitize_filename(camera_name),
|
||||||
f"Invalid trigger thumbnail path for {trigger.data}"
|
f"{trigger.data}.webp",
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
os.remove(old_path)
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Deleted thumbnail for trigger with data {trigger.data} in {camera_name}."
|
f"Deleted thumbnail for trigger with data {trigger.data} in {camera_name}."
|
||||||
)
|
)
|
||||||
@@ -2153,13 +2136,12 @@ def update_trigger_embedding(
|
|||||||
if body.type == "thumbnail":
|
if body.type == "thumbnail":
|
||||||
# Save image to the triggers directory
|
# Save image to the triggers directory
|
||||||
try:
|
try:
|
||||||
thumbnail_path = get_trigger_thumbnail_path(camera_name, body.data)
|
camera_path = os.path.join(TRIGGER_DIR, sanitize_filename(camera_name))
|
||||||
|
os.makedirs(camera_path, exist_ok=True)
|
||||||
if thumbnail_path is None:
|
with open(
|
||||||
raise ValueError(f"Invalid trigger thumbnail path for {body.data}")
|
os.path.join(camera_path, f"{sanitize_filename(body.data)}.webp"),
|
||||||
|
"wb",
|
||||||
os.makedirs(os.path.dirname(thumbnail_path), exist_ok=True)
|
) as f:
|
||||||
with open(thumbnail_path, "wb") as f:
|
|
||||||
f.write(thumbnail)
|
f.write(thumbnail)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Writing thumbnail for trigger with data {body.data} in {camera_name}."
|
f"Writing thumbnail for trigger with data {body.data} in {camera_name}."
|
||||||
@@ -2230,12 +2212,11 @@ def delete_trigger_embedding(
|
|||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
thumbnail_path = get_trigger_thumbnail_path(camera_name, trigger.data)
|
os.remove(
|
||||||
|
os.path.join(
|
||||||
if thumbnail_path is None:
|
TRIGGER_DIR, sanitize_filename(camera_name), f"{trigger.data}.webp"
|
||||||
raise ValueError(f"Invalid trigger thumbnail path for {trigger.data}")
|
)
|
||||||
|
)
|
||||||
os.remove(thumbnail_path)
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Deleted thumbnail for trigger with data {trigger.data} in {camera_name}."
|
f"Deleted thumbnail for trigger with data {trigger.data} in {camera_name}."
|
||||||
)
|
)
|
||||||
|
|||||||
+13
-28
@@ -9,12 +9,11 @@ import zipfile
|
|||||||
from collections import deque
|
from collections import deque
|
||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from urllib.parse import quote
|
|
||||||
|
|
||||||
import psutil
|
import psutil
|
||||||
from fastapi import APIRouter, Depends, Query, Request
|
from fastapi import APIRouter, Depends, Query, Request
|
||||||
from fastapi.responses import JSONResponse, StreamingResponse
|
from fastapi.responses import JSONResponse, StreamingResponse
|
||||||
from pathvalidate import sanitize_filename
|
from pathvalidate import sanitize_filename, sanitize_filepath
|
||||||
from peewee import DoesNotExist
|
from peewee import DoesNotExist
|
||||||
from playhouse.shortcuts import model_to_dict
|
from playhouse.shortcuts import model_to_dict
|
||||||
|
|
||||||
@@ -69,12 +68,10 @@ from frigate.jobs.export import (
|
|||||||
from frigate.models import Export, ExportCase, Previews, Recordings
|
from frigate.models import Export, ExportCase, Previews, Recordings
|
||||||
from frigate.record.export import (
|
from frigate.record.export import (
|
||||||
DEFAULT_TIME_LAPSE_FFMPEG_ARGS,
|
DEFAULT_TIME_LAPSE_FFMPEG_ARGS,
|
||||||
DEFAULT_TIME_LAPSE_FFMPEG_INPUT_ARGS,
|
|
||||||
ChaptersEnum,
|
ChaptersEnum,
|
||||||
PlaybackSourceEnum,
|
PlaybackSourceEnum,
|
||||||
validate_ffmpeg_args,
|
validate_ffmpeg_args,
|
||||||
)
|
)
|
||||||
from frigate.util.path import sanitize_contained_path
|
|
||||||
from frigate.util.time import is_current_hour
|
from frigate.util.time import is_current_hour
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -132,12 +129,18 @@ def _validate_export_case(export_case_id: str | None) -> JSONResponse | None:
|
|||||||
def _sanitize_existing_image(
|
def _sanitize_existing_image(
|
||||||
image_path: str | None,
|
image_path: str | None,
|
||||||
) -> tuple[str | None, JSONResponse | None]:
|
) -> tuple[str | None, JSONResponse | None]:
|
||||||
if not image_path:
|
# sanitize_filepath normalizes "\" to "/" but leaves ".." intact, so a path
|
||||||
return None, None
|
# like "clips\..\..\etc/passwd" passes the CLIPS_DIR prefix check yet still
|
||||||
|
# escapes the directory once resolved. A valid snapshot path never uses "..".
|
||||||
|
if image_path and ".." in image_path:
|
||||||
|
return None, JSONResponse(
|
||||||
|
content={"success": False, "message": "Invalid image path"},
|
||||||
|
status_code=400,
|
||||||
|
)
|
||||||
|
|
||||||
existing_image = sanitize_contained_path(image_path, CLIPS_DIR)
|
existing_image = sanitize_filepath(image_path) if image_path else None
|
||||||
|
|
||||||
if existing_image is None:
|
if existing_image and not existing_image.startswith(CLIPS_DIR):
|
||||||
return None, JSONResponse(
|
return None, JSONResponse(
|
||||||
content={"success": False, "message": "Invalid image path"},
|
content={"success": False, "message": "Invalid image path"},
|
||||||
status_code=400,
|
status_code=400,
|
||||||
@@ -455,22 +458,6 @@ def _stream_case_archive(exports: list[Export]) -> Iterator[bytes]:
|
|||||||
yield from buffer.drain()
|
yield from buffer.drain()
|
||||||
|
|
||||||
|
|
||||||
def _content_disposition(filename: str, ascii_fallback: str) -> str:
|
|
||||||
"""Build an attachment Content-Disposition that survives non-ASCII names.
|
|
||||||
|
|
||||||
Header values are encoded as latin-1, so a name outside that range cannot
|
|
||||||
go in filename at all. RFC 6266 handles this with a pair: a plain ASCII
|
|
||||||
filename for old clients, plus a percent-encoded UTF-8 filename* that
|
|
||||||
every current browser prefers.
|
|
||||||
"""
|
|
||||||
ascii_name = filename if filename.isascii() else ascii_fallback
|
|
||||||
|
|
||||||
return (
|
|
||||||
f'attachment; filename="{ascii_name}"; '
|
|
||||||
f"filename*=UTF-8''{quote(filename, safe='')}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/cases/{case_id}/download",
|
"/cases/{case_id}/download",
|
||||||
dependencies=[Depends(allow_any_authenticated())],
|
dependencies=[Depends(allow_any_authenticated())],
|
||||||
@@ -513,9 +500,7 @@ def download_export_case(
|
|||||||
_stream_case_archive(exports),
|
_stream_case_archive(exports),
|
||||||
media_type="application/zip",
|
media_type="application/zip",
|
||||||
headers={
|
headers={
|
||||||
"Content-Disposition": _content_disposition(
|
"Content-Disposition": f'attachment; filename="{archive_base}.zip"',
|
||||||
f"{archive_base}.zip", f"{case_id}.zip"
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1013,7 +998,7 @@ def export_recording_custom(
|
|||||||
|
|
||||||
# Set default values if not provided (timelapse defaults)
|
# Set default values if not provided (timelapse defaults)
|
||||||
if ffmpeg_input_args is None:
|
if ffmpeg_input_args is None:
|
||||||
ffmpeg_input_args = DEFAULT_TIME_LAPSE_FFMPEG_INPUT_ARGS
|
ffmpeg_input_args = ""
|
||||||
|
|
||||||
if ffmpeg_output_args is None:
|
if ffmpeg_output_args is None:
|
||||||
ffmpeg_output_args = DEFAULT_TIME_LAPSE_FFMPEG_ARGS
|
ffmpeg_output_args = DEFAULT_TIME_LAPSE_FFMPEG_ARGS
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ from frigate.comms.event_metadata_updater import (
|
|||||||
)
|
)
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
from frigate.config.camera.updater import CameraConfigUpdatePublisher
|
from frigate.config.camera.updater import CameraConfigUpdatePublisher
|
||||||
from frigate.config.holder import ConfigHolder
|
|
||||||
from frigate.config.profile_manager import ProfileManager
|
from frigate.config.profile_manager import ProfileManager
|
||||||
from frigate.debug_replay import DebugReplayManager, debug_replay_auto_stop_watchdog
|
from frigate.debug_replay import DebugReplayManager, debug_replay_auto_stop_watchdog
|
||||||
from frigate.embeddings import EmbeddingsContext
|
from frigate.embeddings import EmbeddingsContext
|
||||||
@@ -75,7 +74,6 @@ def create_fastapi_app(
|
|||||||
dispatcher: Dispatcher | None = None,
|
dispatcher: Dispatcher | None = None,
|
||||||
profile_manager: ProfileManager | None = None,
|
profile_manager: ProfileManager | None = None,
|
||||||
enforce_default_admin: bool = True,
|
enforce_default_admin: bool = True,
|
||||||
config_holder: ConfigHolder | None = None,
|
|
||||||
):
|
):
|
||||||
logger.info("Starting FastAPI app")
|
logger.info("Starting FastAPI app")
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
@@ -152,8 +150,6 @@ def create_fastapi_app(
|
|||||||
app.include_router(debug_replay.router)
|
app.include_router(debug_replay.router)
|
||||||
# App Properties
|
# App Properties
|
||||||
app.frigate_config = frigate_config
|
app.frigate_config = frigate_config
|
||||||
# snapshot the port nginx bound at startup, the live config can be swapped
|
|
||||||
app.auth_internal_port = frigate_config.networking.listen.internal_port
|
|
||||||
app.genai_manager = GenAIClientManager(frigate_config)
|
app.genai_manager = GenAIClientManager(frigate_config)
|
||||||
app.embeddings = embeddings
|
app.embeddings = embeddings
|
||||||
app.detected_frames_processor = detected_frames_processor
|
app.detected_frames_processor = detected_frames_processor
|
||||||
@@ -166,7 +162,6 @@ def create_fastapi_app(
|
|||||||
app.replay_manager = replay_manager
|
app.replay_manager = replay_manager
|
||||||
app.dispatcher = dispatcher
|
app.dispatcher = dispatcher
|
||||||
app.profile_manager = profile_manager
|
app.profile_manager = profile_manager
|
||||||
app.config_holder = config_holder
|
|
||||||
|
|
||||||
if frigate_config.auth.enabled:
|
if frigate_config.auth.enabled:
|
||||||
secret = get_jwt_secret()
|
secret = get_jwt_secret()
|
||||||
|
|||||||
+1
-16
@@ -53,7 +53,6 @@ from frigate.util.file import (
|
|||||||
)
|
)
|
||||||
from frigate.util.image import get_image_from_recording, get_image_quality_params
|
from frigate.util.image import get_image_from_recording, get_image_quality_params
|
||||||
from frigate.util.media import get_keyframe_before
|
from frigate.util.media import get_keyframe_before
|
||||||
from frigate.util.object import create_empty_regions_grid
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -1084,21 +1083,7 @@ def clear_region_grid(request: Request, camera_name: str):
|
|||||||
status_code=404,
|
status_code=404,
|
||||||
)
|
)
|
||||||
|
|
||||||
# store an empty grid instead of deleting the row so the grid is
|
Regions.delete().where(Regions.camera == camera_name).execute()
|
||||||
# rebuilt from newly tracked objects and not from all past history
|
|
||||||
region = {
|
|
||||||
Regions.camera: camera_name,
|
|
||||||
Regions.grid: create_empty_regions_grid(),
|
|
||||||
Regions.last_update: datetime.now().timestamp(),
|
|
||||||
}
|
|
||||||
(
|
|
||||||
Regions.insert(region)
|
|
||||||
.on_conflict(
|
|
||||||
conflict_target=[Regions.camera],
|
|
||||||
update=region,
|
|
||||||
)
|
|
||||||
.execute()
|
|
||||||
)
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content={"success": True, "message": "Region grid cleared"},
|
content={"success": True, "message": "Region grid cleared"},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ async def get_motion_search_status_endpoint(
|
|||||||
)
|
)
|
||||||
|
|
||||||
job = get_motion_search_job(job_id)
|
job = get_motion_search_job(job_id)
|
||||||
if not job or job.camera != camera_name:
|
if not job:
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content={"success": False, "message": "Job not found"},
|
content={"success": False, "message": "Job not found"},
|
||||||
status_code=404,
|
status_code=404,
|
||||||
@@ -253,7 +253,7 @@ async def cancel_motion_search_endpoint(
|
|||||||
)
|
)
|
||||||
|
|
||||||
job = get_motion_search_job(job_id)
|
job = get_motion_search_job(job_id)
|
||||||
if not job or job.camera != camera_name:
|
if not job:
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content={"success": False, "message": "Job not found"},
|
content={"success": False, "message": "Job not found"},
|
||||||
status_code=404,
|
status_code=404,
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
"""Notification apis."""
|
"""Notification apis."""
|
||||||
|
|
||||||
import ipaddress
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from urllib.parse import urlparse
|
|
||||||
|
|
||||||
from cryptography.hazmat.primitives import serialization
|
from cryptography.hazmat.primitives import serialization
|
||||||
from fastapi import APIRouter, Depends, Request
|
from fastapi import APIRouter, Depends, Request
|
||||||
@@ -21,95 +19,6 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
router = APIRouter(tags=[Tags.notifications])
|
router = APIRouter(tags=[Tags.notifications])
|
||||||
|
|
||||||
# Push endpoints are opaque URLs but stay well under this in practice
|
|
||||||
MAX_ENDPOINT_LENGTH = 2048
|
|
||||||
|
|
||||||
# Suffixes that only ever resolve on the local network
|
|
||||||
INTERNAL_HOST_SUFFIXES = (".local", ".localdomain", ".internal", ".home.arpa")
|
|
||||||
|
|
||||||
|
|
||||||
def _validate_push_endpoint(endpoint: Any) -> str | None:
|
|
||||||
"""Return a reason the endpoint is unusable, or None when it is valid.
|
|
||||||
|
|
||||||
Subscriptions are issued by the browser vendor's push service, so a valid
|
|
||||||
endpoint is always a public https URL. Anything else is either a broken
|
|
||||||
registration or an attempt to aim the notification sender somewhere it
|
|
||||||
should not reach.
|
|
||||||
"""
|
|
||||||
if not isinstance(endpoint, str) or not endpoint:
|
|
||||||
return "endpoint must be a url"
|
|
||||||
|
|
||||||
if len(endpoint) > MAX_ENDPOINT_LENGTH:
|
|
||||||
return "endpoint is too long"
|
|
||||||
|
|
||||||
try:
|
|
||||||
parsed = urlparse(endpoint)
|
|
||||||
port = parsed.port
|
|
||||||
except ValueError:
|
|
||||||
return "endpoint is not a valid url"
|
|
||||||
|
|
||||||
if parsed.scheme != "https":
|
|
||||||
return "endpoint must use https"
|
|
||||||
|
|
||||||
if parsed.username or parsed.password:
|
|
||||||
return "endpoint must not include credentials"
|
|
||||||
|
|
||||||
if port is not None and port != 443:
|
|
||||||
return "endpoint must use the default https port"
|
|
||||||
|
|
||||||
hostname = parsed.hostname
|
|
||||||
|
|
||||||
if not hostname:
|
|
||||||
return "endpoint must include a hostname"
|
|
||||||
|
|
||||||
try:
|
|
||||||
address = ipaddress.ip_address(hostname)
|
|
||||||
except ValueError:
|
|
||||||
address = None
|
|
||||||
|
|
||||||
if address is not None:
|
|
||||||
# A push service is never reachable at an address only this network can
|
|
||||||
# route, so anything non-global is a misconfiguration at best
|
|
||||||
if not address.is_global:
|
|
||||||
return "endpoint must not use a private address"
|
|
||||||
elif hostname == "localhost" or "." not in hostname:
|
|
||||||
return "endpoint must use a fully qualified hostname"
|
|
||||||
elif hostname.endswith(INTERNAL_HOST_SUFFIXES):
|
|
||||||
return "endpoint must not use an internal hostname"
|
|
||||||
|
|
||||||
# The subscription token lives in the path, and webpush.py assumes there is
|
|
||||||
# a separator after the host when it builds the VAPID audience
|
|
||||||
if len(parsed.path) <= 1:
|
|
||||||
return "endpoint must include a subscription path"
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _validate_subscription(sub: Any) -> str | None:
|
|
||||||
"""Return a reason the subscription is unusable, or None when it is valid."""
|
|
||||||
if not isinstance(sub, dict):
|
|
||||||
return "subscription must be an object"
|
|
||||||
|
|
||||||
reason = _validate_push_endpoint(sub.get("endpoint"))
|
|
||||||
|
|
||||||
if reason:
|
|
||||||
return reason
|
|
||||||
|
|
||||||
keys = sub.get("keys")
|
|
||||||
|
|
||||||
if not isinstance(keys, dict):
|
|
||||||
return "subscription must include keys"
|
|
||||||
|
|
||||||
# WebPusher raises on a missing key, which would break every send for the
|
|
||||||
# user rather than just this registration
|
|
||||||
for name in ("p256dh", "auth"):
|
|
||||||
value = keys.get(name)
|
|
||||||
|
|
||||||
if not isinstance(value, str) or not value:
|
|
||||||
return f"subscription keys must include {name}"
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/notifications/pubkey",
|
"/notifications/pubkey",
|
||||||
@@ -162,17 +71,6 @@ def register_notifications(request: Request, body: dict = None):
|
|||||||
status_code=400,
|
status_code=400,
|
||||||
)
|
)
|
||||||
|
|
||||||
reason = _validate_subscription(sub)
|
|
||||||
|
|
||||||
if reason:
|
|
||||||
logger.warning(
|
|
||||||
"Rejected notification registration for %s: %s", username, reason
|
|
||||||
)
|
|
||||||
return JSONResponse(
|
|
||||||
content={"success": False, "message": f"Invalid subscription: {reason}"},
|
|
||||||
status_code=400,
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
User.update(notification_tokens=User.notification_tokens.append(sub)).where(
|
User.update(notification_tokens=User.notification_tokens.append(sub)).where(
|
||||||
User.username == username
|
User.username == username
|
||||||
|
|||||||
+12
-28
@@ -17,7 +17,6 @@ from frigate.api.auth import (
|
|||||||
get_allowed_cameras_for_filter,
|
get_allowed_cameras_for_filter,
|
||||||
get_current_user,
|
get_current_user,
|
||||||
require_camera_access,
|
require_camera_access,
|
||||||
require_full_camera_access,
|
|
||||||
require_role,
|
require_role,
|
||||||
)
|
)
|
||||||
from frigate.api.defs.query.review_query_parameters import (
|
from frigate.api.defs.query.review_query_parameters import (
|
||||||
@@ -43,22 +42,6 @@ logger = logging.getLogger(__name__)
|
|||||||
router = APIRouter(tags=[Tags.review])
|
router = APIRouter(tags=[Tags.review])
|
||||||
|
|
||||||
|
|
||||||
def get_label_clause(label: str, include_audio: bool = True):
|
|
||||||
"""Build a clause matching a label within a review segment's data.
|
|
||||||
|
|
||||||
Verified objects are stored with a `-verified` suffix (eg. `person-verified`)
|
|
||||||
so that variant is matched as well.
|
|
||||||
"""
|
|
||||||
clause = (ReviewSegment.data["objects"].cast("text") % f'*"{label}"*') | (
|
|
||||||
ReviewSegment.data["objects"].cast("text") % f'*"{label}-verified"*'
|
|
||||||
)
|
|
||||||
|
|
||||||
if include_audio:
|
|
||||||
clause |= ReviewSegment.data["audio"].cast("text") % f'*"{label}"*'
|
|
||||||
|
|
||||||
return clause
|
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/review",
|
"/review",
|
||||||
response_model=list[ReviewSegmentResponse],
|
response_model=list[ReviewSegmentResponse],
|
||||||
@@ -108,7 +91,10 @@ async def review(
|
|||||||
filtered_labels = labels.split(",")
|
filtered_labels = labels.split(",")
|
||||||
|
|
||||||
for label in filtered_labels:
|
for label in filtered_labels:
|
||||||
label_clauses.append(get_label_clause(label))
|
label_clauses.append(
|
||||||
|
(ReviewSegment.data["objects"].cast("text") % f'*"{label}"*')
|
||||||
|
| (ReviewSegment.data["audio"].cast("text") % f'*"{label}"*')
|
||||||
|
)
|
||||||
clauses.append(reduce(operator.or_, label_clauses))
|
clauses.append(reduce(operator.or_, label_clauses))
|
||||||
|
|
||||||
if zones != "all":
|
if zones != "all":
|
||||||
@@ -249,7 +235,10 @@ async def review_summary(
|
|||||||
filtered_labels = labels.split(",")
|
filtered_labels = labels.split(",")
|
||||||
|
|
||||||
for label in filtered_labels:
|
for label in filtered_labels:
|
||||||
label_clauses.append(get_label_clause(label))
|
label_clauses.append(
|
||||||
|
(ReviewSegment.data["objects"].cast("text") % f'*"{label}"*')
|
||||||
|
| (ReviewSegment.data["audio"].cast("text") % f'*"{label}"*')
|
||||||
|
)
|
||||||
clauses.append(reduce(operator.or_, label_clauses))
|
clauses.append(reduce(operator.or_, label_clauses))
|
||||||
if zones != "all":
|
if zones != "all":
|
||||||
# use matching so segments with multiple zones
|
# use matching so segments with multiple zones
|
||||||
@@ -347,8 +336,9 @@ async def review_summary(
|
|||||||
filtered_labels = labels.split(",")
|
filtered_labels = labels.split(",")
|
||||||
|
|
||||||
for label in filtered_labels:
|
for label in filtered_labels:
|
||||||
label_clauses.append(get_label_clause(label, include_audio=False))
|
label_clauses.append(
|
||||||
|
ReviewSegment.data["objects"].cast("text") % f'*"{label}"*'
|
||||||
|
)
|
||||||
clauses.append(reduce(operator.or_, label_clauses))
|
clauses.append(reduce(operator.or_, label_clauses))
|
||||||
|
|
||||||
# Find the time range of available data
|
# Find the time range of available data
|
||||||
@@ -719,7 +709,6 @@ async def get_review(request: Request, review_id: str):
|
|||||||
dependencies=[Depends(allow_any_authenticated())],
|
dependencies=[Depends(allow_any_authenticated())],
|
||||||
)
|
)
|
||||||
async def set_not_reviewed(
|
async def set_not_reviewed(
|
||||||
request: Request,
|
|
||||||
review_id: str,
|
review_id: str,
|
||||||
current_user: dict = Depends(get_current_user),
|
current_user: dict = Depends(get_current_user),
|
||||||
):
|
):
|
||||||
@@ -738,8 +727,6 @@ async def set_not_reviewed(
|
|||||||
status_code=404,
|
status_code=404,
|
||||||
)
|
)
|
||||||
|
|
||||||
await require_camera_access(review.camera, request=request)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
user_review = UserReviewStatus.get(
|
user_review = UserReviewStatus.get(
|
||||||
UserReviewStatus.user_id == user_id,
|
UserReviewStatus.user_id == user_id,
|
||||||
@@ -756,12 +743,9 @@ async def set_not_reviewed(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# Intentionally not camera scoped, as the summary correlates each flagged event
|
|
||||||
# with overlapping activity on other cameras. Restricted to callers who can
|
|
||||||
# already see every camera, so the unscoped query discloses nothing.
|
|
||||||
@router.post(
|
@router.post(
|
||||||
"/review/summarize/start/{start_ts}/end/{end_ts}",
|
"/review/summarize/start/{start_ts}/end/{end_ts}",
|
||||||
dependencies=[Depends(require_full_camera_access)],
|
dependencies=[Depends(require_role(["admin"]))],
|
||||||
description="Use GenAI to summarize review items over a period of time.",
|
description="Use GenAI to summarize review items over a period of time.",
|
||||||
)
|
)
|
||||||
def generate_review_summary(request: Request, start_ts: float, end_ts: float):
|
def generate_review_summary(request: Request, start_ts: float, end_ts: float):
|
||||||
|
|||||||
+38
-27
@@ -30,7 +30,6 @@ from frigate.comms.ws import WebSocketClient
|
|||||||
from frigate.comms.zmq_proxy import ZmqProxy
|
from frigate.comms.zmq_proxy import ZmqProxy
|
||||||
from frigate.config.camera.updater import CameraConfigUpdatePublisher
|
from frigate.config.camera.updater import CameraConfigUpdatePublisher
|
||||||
from frigate.config.config import FrigateConfig
|
from frigate.config.config import FrigateConfig
|
||||||
from frigate.config.holder import ConfigHolder
|
|
||||||
from frigate.config.profile_manager import ProfileManager
|
from frigate.config.profile_manager import ProfileManager
|
||||||
from frigate.const import (
|
from frigate.const import (
|
||||||
CACHE_DIR,
|
CACHE_DIR,
|
||||||
@@ -103,25 +102,27 @@ class FrigateApp:
|
|||||||
self.detection_shms: list[mp.shared_memory.SharedMemory] = []
|
self.detection_shms: list[mp.shared_memory.SharedMemory] = []
|
||||||
self.log_queue: Queue = mp.Queue()
|
self.log_queue: Queue = mp.Queue()
|
||||||
self.camera_metrics: DictProxy = self.metrics_manager.dict()
|
self.camera_metrics: DictProxy = self.metrics_manager.dict()
|
||||||
|
self.embeddings_metrics: DataProcessorMetrics | None = (
|
||||||
self.embeddings_metrics = DataProcessorMetrics(
|
DataProcessorMetrics(
|
||||||
self.metrics_manager, list(config.classification.custom.keys())
|
self.metrics_manager, list(config.classification.custom.keys())
|
||||||
)
|
)
|
||||||
|
if (
|
||||||
|
config.semantic_search.enabled
|
||||||
|
or any(
|
||||||
|
c.objects.genai.enabled or c.review.genai.enabled
|
||||||
|
for c in config.cameras.values()
|
||||||
|
)
|
||||||
|
or config.lpr.enabled
|
||||||
|
or config.face_recognition.enabled
|
||||||
|
or len(config.classification.custom) > 0
|
||||||
|
)
|
||||||
|
else None
|
||||||
|
)
|
||||||
self.ptz_metrics: dict[str, PTZMetrics] = {}
|
self.ptz_metrics: dict[str, PTZMetrics] = {}
|
||||||
self.processes: dict[str, int] = {}
|
self.processes: dict[str, int] = {}
|
||||||
self.embeddings: EmbeddingsContext | None = None
|
self.embeddings: EmbeddingsContext | None = None
|
||||||
self.config_holder = ConfigHolder(config)
|
self.profile_manager: ProfileManager | None = None
|
||||||
|
self.config = config
|
||||||
@property
|
|
||||||
def config(self) -> FrigateConfig:
|
|
||||||
"""The current config, not the one Frigate booted with.
|
|
||||||
|
|
||||||
Read through the holder so the deferred watchdog factories below build
|
|
||||||
a replacement process from the config as it is now. There is no setter
|
|
||||||
on purpose: a plain attribute would let a caller pin this back to a
|
|
||||||
single object and reintroduce the staleness.
|
|
||||||
"""
|
|
||||||
return self.config_holder.config
|
|
||||||
|
|
||||||
def ensure_dirs(self) -> None:
|
def ensure_dirs(self) -> None:
|
||||||
dirs = [
|
dirs = [
|
||||||
@@ -269,7 +270,7 @@ class FrigateApp:
|
|||||||
10
|
10
|
||||||
* len([c for c in self.config.cameras.values() if c.enabled_in_config]),
|
* len([c for c in self.config.cameras.values() if c.enabled_in_config]),
|
||||||
),
|
),
|
||||||
load_vec_extension=True,
|
load_vec_extension=self.config.semantic_search.enabled,
|
||||||
)
|
)
|
||||||
models = [
|
models = [
|
||||||
Event,
|
Event,
|
||||||
@@ -342,6 +343,25 @@ class FrigateApp:
|
|||||||
)
|
)
|
||||||
self.dispatcher.profile_manager = self.profile_manager
|
self.dispatcher.profile_manager = self.profile_manager
|
||||||
|
|
||||||
|
def restore_active_profile(self) -> None:
|
||||||
|
"""Re-activate the persisted profile after subscribers are connected.
|
||||||
|
|
||||||
|
ZMQ PUB/SUB drops messages with no subscribers, so activation must
|
||||||
|
run after every config_updater subscriber is up.
|
||||||
|
"""
|
||||||
|
if self.profile_manager is None:
|
||||||
|
return
|
||||||
|
|
||||||
|
persisted = ProfileManager.load_persisted_profile()
|
||||||
|
if persisted and any(
|
||||||
|
persisted in cam.profiles for cam in self.config.cameras.values()
|
||||||
|
):
|
||||||
|
logger.info("Restoring persisted profile '%s'", persisted)
|
||||||
|
# runtime overrides are layered on top via restore_runtime_state()
|
||||||
|
self.profile_manager.activate_profile(
|
||||||
|
persisted, clear_runtime_overrides=False
|
||||||
|
)
|
||||||
|
|
||||||
def start_detectors(self) -> None:
|
def start_detectors(self) -> None:
|
||||||
for name in self.config.cameras.keys():
|
for name in self.config.cameras.keys():
|
||||||
try:
|
try:
|
||||||
@@ -590,13 +610,6 @@ class FrigateApp:
|
|||||||
self.start_detectors()
|
self.start_detectors()
|
||||||
self.init_dispatcher()
|
self.init_dispatcher()
|
||||||
self.init_profile_manager()
|
self.init_profile_manager()
|
||||||
|
|
||||||
# workers get a copy of the config and can miss the broadcast below, so
|
|
||||||
# apply both layers here. must stay after init_profile_manager(), which
|
|
||||||
# snapshots the base config that profile deactivation resets to
|
|
||||||
self.profile_manager.restore_persisted_profile_to_config()
|
|
||||||
self.dispatcher.reapply_runtime_state_to_config()
|
|
||||||
|
|
||||||
self.init_embeddings_client()
|
self.init_embeddings_client()
|
||||||
self.start_video_output_processor()
|
self.start_video_output_processor()
|
||||||
self.start_ptz_autotracker()
|
self.start_ptz_autotracker()
|
||||||
@@ -611,9 +624,8 @@ class FrigateApp:
|
|||||||
self.start_record_cleanup()
|
self.start_record_cleanup()
|
||||||
self.start_watchdog()
|
self.start_watchdog()
|
||||||
|
|
||||||
# publish for the recording/review/embeddings processes, which start
|
# restore persisted runtime overrides on top of config
|
||||||
# before the config can be corrected, and for the retained MQTT states
|
self.restore_active_profile()
|
||||||
self.profile_manager.restore_persisted_profile()
|
|
||||||
self.dispatcher.restore_runtime_state()
|
self.dispatcher.restore_runtime_state()
|
||||||
|
|
||||||
self.init_auth()
|
self.init_auth()
|
||||||
@@ -633,7 +645,6 @@ class FrigateApp:
|
|||||||
self.replay_manager,
|
self.replay_manager,
|
||||||
self.dispatcher,
|
self.dispatcher,
|
||||||
self.profile_manager,
|
self.profile_manager,
|
||||||
config_holder=self.config_holder,
|
|
||||||
),
|
),
|
||||||
host="127.0.0.1",
|
host="127.0.0.1",
|
||||||
port=5001,
|
port=5001,
|
||||||
|
|||||||
@@ -103,13 +103,12 @@ class CameraActivityManager:
|
|||||||
all_objects: list[dict[str, Any]] = []
|
all_objects: list[dict[str, Any]] = []
|
||||||
|
|
||||||
for camera in new_activity.keys():
|
for camera in new_activity.keys():
|
||||||
camera_config = self.config.cameras.get(camera)
|
if camera not in self.config.cameras:
|
||||||
if camera_config is None:
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# handle cameras that were added dynamically
|
# handle cameras that were added dynamically
|
||||||
if camera not in self.camera_all_object_counts:
|
if camera not in self.camera_all_object_counts:
|
||||||
self.__init_camera(camera_config)
|
self.__init_camera(self.config.cameras[camera])
|
||||||
|
|
||||||
new_objects = new_activity[camera].get("objects", [])
|
new_objects = new_activity[camera].get("objects", [])
|
||||||
all_objects.extend(new_objects)
|
all_objects.extend(new_objects)
|
||||||
@@ -234,13 +233,12 @@ class AudioActivityManager:
|
|||||||
now = datetime.datetime.now().timestamp()
|
now = datetime.datetime.now().timestamp()
|
||||||
|
|
||||||
for camera in new_activity.keys():
|
for camera in new_activity.keys():
|
||||||
camera_config = self.config.cameras.get(camera)
|
if camera not in self.config.cameras:
|
||||||
if camera_config is None:
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# handle cameras that were added dynamically
|
# handle cameras that were added dynamically
|
||||||
if camera not in self.current_audio_detections:
|
if camera not in self.current_audio_detections:
|
||||||
self.__init_camera(camera_config)
|
self.__init_camera(self.config.cameras[camera])
|
||||||
|
|
||||||
new_detections = new_activity[camera].get("detections", [])
|
new_detections = new_activity[camera].get("detections", [])
|
||||||
if self.compare_audio_activity(camera, new_detections, now):
|
if self.compare_audio_activity(camera, new_detections, now):
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user