Skip to content

Commit

Permalink
Merge branch 'master' into detector-abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
NateMeyer committed Sep 26, 2022
2 parents 2c421e1 + 3846a13 commit b201e97
Show file tree
Hide file tree
Showing 28 changed files with 486 additions and 213 deletions.
84 changes: 84 additions & 0 deletions .github/ISSUE_TEMPLATE/edgetpu_support_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: EdgeTpu Support Request
description: Support for setting up EdgeTPU in Frigate
title: "[EdgeTPU Support]: "
labels: ["support", "triage"]
assignees: []
body:
- type: textarea
id: description
attributes:
label: Describe the problem you are having
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: Visible on the Debug page in the Web UI
validations:
required: true
- type: textarea
id: config
attributes:
label: Frigate config file
description: This will be automatically formatted into code, so no need for backticks.
render: yaml
validations:
required: true
- type: textarea
id: docker
attributes:
label: docker-compose file or Docker CLI command
description: This will be automatically formatted into code, so no need for backticks.
render: yaml
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating system
options:
- HassOS
- Debian
- Other Linux
- Proxmox
- UNRAID
- Windows
- Other
validations:
required: true
- type: dropdown
id: install-method
attributes:
label: Install method
options:
- HassOS Addon
- Docker Compose
- Docker CLI
validations:
required: true
- type: dropdown
id: coral
attributes:
label: Coral version
options:
- USB
- PCIe
- M.2
- Dev Board
- Other
- CPU (no coral)
validations:
required: true
- type: textarea
id: other
attributes:
label: Any other information that may be helpful
96 changes: 96 additions & 0 deletions .github/ISSUE_TEMPLATE/hwaccel_support_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Hardware Acceleration Support Request
description: Support for setting up GPU hardware acceleration in Frigate
title: "[HW Accel Support]: "
labels: ["support", "triage"]
assignees: []
body:
- type: textarea
id: description
attributes:
label: Describe the problem you are having
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: Visible on the Debug page in the Web UI
validations:
required: true
- type: textarea
id: config
attributes:
label: Frigate config file
description: This will be automatically formatted into code, so no need for backticks.
render: yaml
validations:
required: true
- type: textarea
id: docker
attributes:
label: docker-compose file or Docker CLI command
description: This will be automatically formatted into code, so no need for backticks.
render: yaml
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: true
- type: textarea
id: ffprobe
attributes:
label: FFprobe output from your camera
description: Run `ffprobe <camera_url>` and provide output below
render: shell
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating system
options:
- HassOS
- Debian
- Other Linux
- Proxmox
- UNRAID
- Windows
- Other
validations:
required: true
- type: dropdown
id: install-method
attributes:
label: Install method
options:
- HassOS Addon
- Docker Compose
- Docker CLI
validations:
required: true
- type: dropdown
id: network
attributes:
label: Network connection
options:
- Wired
- Wireless
- Mixed
validations:
required: true
- type: input
id: camera
attributes:
label: Camera make and model
description: Dahua, hikvision, amcrest, reolink, etc and model number
validations:
required: true
- type: textarea
id: other
attributes:
label: Any other information that may be helpful
17 changes: 0 additions & 17 deletions .github/stale.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Close Stale Issues
# Warns and then closes issues and PRs that have had no activity for a specified amount of time.
# https://github.com/actions/stale

name: "Stalebot"
on:
schedule:
- cron: "0 0 * * *" # run stalebot once a day

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@main
id: stale
with:
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
close-issue-message: ''
days-before-stale: 30
days-before-close: 3
exempt-draft-pr: true
exempt-issue-labels: 'pinned,security'
exempt-pr-labels: 'pinned,security'
- name: Print outputs
run: echo ${{ join(steps.stale.outputs.*, ',') }}
20 changes: 13 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ RUN pip3 wheel --wheel-dir=/wheels -r requirements-wheels.txt
FROM debian:11-slim
ARG TARGETARCH

ARG JELLYFIN_FFMPEG_VERSION=5.0.1-7
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
ARG DEBIAN_FRONTEND="noninteractive"
# http://stackoverflow.com/questions/48162574/ddg#49462622
Expand Down Expand Up @@ -80,14 +79,21 @@ RUN apt-get -qq update \
# coral drivers
libedgetpu1-max python3-tflite-runtime python3-pycoral \
&& pip3 install -U /wheels/*.whl \
# jellyfin-ffmpeg
&& wget -O jellyfin.deb "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/${JELLYFIN_FFMPEG_VERSION}/jellyfin-ffmpeg5_${JELLYFIN_FFMPEG_VERSION}-$( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release )_$( dpkg --print-architecture ).deb" \
&& apt-get -qq install --no-install-recommends --no-install-suggests -y ./jellyfin.deb \
&& rm jellyfin.deb \
# btbn-ffmpeg -> amd64 / arm64
&& if [ "${TARGETARCH}" = "amd64" ] || [ "${TARGETARCH}" = "arm64" ]; then \
mkdir -p /usr/lib/btbn-ffmpeg \
&& wget -O btbn-ffmpeg.tar.xz "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2022-07-31-12-37/ffmpeg-n5.1-2-g915ef932a3-linux$( [ "$TARGETARCH" = "amd64" ] && echo "64" || echo "arm64" )-gpl-5.1.tar.xz" \
&& tar -xf btbn-ffmpeg.tar.xz -C /usr/lib/btbn-ffmpeg --strip-components 1 \
&& rm btbn-ffmpeg.tar.xz; \
fi \
# ffmpeg -> arm32
&& if [ "${TARGETARCH}" = "arm" ]; then \
apt-get -qq install --no-install-recommends --no-install-suggests -y ffmpeg; \
fi \
# arch specific packages
&& if [ "${TARGETARCH}" = "amd64" ]; then \
apt-get -qq install --no-install-recommends --no-install-suggests -y \
mesa-va-drivers intel-media-va-driver-non-free; \
mesa-va-drivers libva-drm2 intel-media-va-driver-non-free i965-va-driver libmfx1; \
fi \
&& if [ "${TARGETARCH}" = "arm64" ]; then \
apt-get -qq install --no-install-recommends --no-install-suggests -y \
Expand All @@ -109,7 +115,7 @@ RUN apt-get -qq update \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*

ENV PATH=$PATH:/usr/lib/jellyfin-ffmpeg
ENV PATH=$PATH:/usr/lib/btbn-ffmpeg/bin

COPY --from=nginx /usr/local/nginx/ /usr/local/nginx/

Expand Down
6 changes: 4 additions & 2 deletions docker/rootfs/usr/local/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ http {
vod_upstream_location /api;
vod_align_segments_to_key_frames on;
vod_manifest_segment_durations_mode accurate;
vod_ignore_edit_list on;

# vod caches
vod_metadata_cache metadata_cache 512m;
Expand Down Expand Up @@ -172,10 +173,11 @@ http {
proxy_set_header Host $host;
}

location ~* /api/(.*\.(jpg|jpeg|png)$) {
location ~* /api/.*\.(jpg|jpeg|png)$ {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
proxy_pass http://frigate_api/$1$is_args$args;
rewrite ^/api/(.*)$ $1 break;
proxy_pass http://frigate_api;
proxy_pass_request_headers on;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
11 changes: 11 additions & 0 deletions docs/docs/configuration/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,14 @@ model:
```

Note that if you rename objects in the labelmap, you will also need to update your `objects -> track` list as well.

## Custom ffmpeg build

Included with Frigate is a build of ffmpeg that works for the vast majority of users. However, there exists some hardware setups which have incompatibilities with the included build. In this case, a docker volume mapping can be used to overwrite the included ffmpeg build with an ffmpeg build that works for your specific hardware setup.

To do this:
1. Download your ffmpeg build and uncompress to a folder on the host (let's use `/home/appdata/frigate/custom-ffmpeg` for this example).
2. Update your docker-compose or docker CLI to include `'/home/appdata/frigate/custom-ffmpeg':'/usr/lib/btbn-ffmpeg':'ro'` in the volume mappings.
3. Restart frigate and the custom version will be used if the mapping was done correctly.

NOTE: The folder that is mapped from the host needs to be the folder that contains `/bin`. So if the full structure is `/home/appdata/frigate/custom-ffmpeg/bin/ffmpeg` then `/home/appdata/frigate/custom-ffmpeg` needs to be mapped to `/usr/lib/btbn-ffmpeg`.
16 changes: 13 additions & 3 deletions docs/docs/configuration/camera_specific.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,17 @@ ffmpeg:
### Reolink 410/520 (possibly others)
According to [this discussion](https://github.com/blakeblackshear/frigate/issues/1713#issuecomment-932976305), the http video streams seem to be the most reliable for Reolink.
According to [this discussion](https://github.com/blakeblackshear/frigate/issues/3235#issuecomment-1135876973), the http video streams seem to be the most reliable for Reolink.
```yaml
cameras:
reolink:
ffmpeg:
hwaccel_args:
input_args:
- -avoid_negative_ts
- make_zero
- -fflags
- nobuffer+genpts+discardcorrupt
- +genpts+discardcorrupt
- -flags
- low_delay
- -strict
Expand Down Expand Up @@ -113,3 +112,14 @@ If your cameras do not support TCP connections for RTSP, you can use UDP.
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport udp -timeout 5000000 -use_wallclock_as_timestamps 1
```

### Unifi Protect Cameras

In the Unifi 2.0 update Unifi Protect Cameras had a change in audio sample rate which causes issues for ffmpeg. The input rate needs to be set for record and rtmp.

```yaml
ffmpeg:
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -ar 44100 -c:a aac
rtmp: -c:v copy -f flv -ar 44100 -c:a aac
```
2 changes: 1 addition & 1 deletion docs/docs/configuration/hardware_acceleration.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ffmpeg:
ffmpeg:
hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
```
**NOTICE**: With some of the processors, like the J4125, the default driver `iHD` doesn't seem to work correctly for hardware acceleration. You may need to change the driver to `i965` by adding the following environment variable `LIBVA_DRIVER_NAME_JELLYFIN=i965` to your docker-compose file.
**NOTICE**: With some of the processors, like the J4125, the default driver `iHD` doesn't seem to work correctly for hardware acceleration. You may need to change the driver to `i965` by adding the following environment variable `LIBVA_DRIVER_NAME=i965` to your docker-compose file.

### Intel-based CPUs (>=10th Generation) via Quicksync

Expand Down
10 changes: 10 additions & 0 deletions docs/docs/guides/events_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
id: events_setup
title: Setting Up Events
---

[Snapshots](../configuration/snapshots.md) and/or [Recordings](../configuration/record.md) must be enabled for events to be created for detected objects.

## Limiting Events to Areas of Interest

The best way to limit events to areas of interest is to use [zones](../configuration/zones.md) along with `required_zones` for events and snapshots to only have events created in areas of interest.
6 changes: 6 additions & 0 deletions docs/docs/guides/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ More details on available detectors can be found [here](/configuration/detectors
Now let's add the first camera:
:::caution
Note that passwords that contain special characters often cause issues with ffmpeg connecting to the cameara. If recieving `end-of-file` or `unauthorized` errors with a verified correct password, try changing the password to something simple to rule out the possibility that the password is the issue.

:::

```yaml
mqtt:
host: <ip of your mqtt server>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/stationary_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: stationary_objects
title: Avoiding stationary objects
---

Many people use Frigate to detect cars entering their driveway, and they often run into an issue with repeated events of a parked car being repeatedly detected. This is because object tracking stops when motion ends and the event ends. Motion detection works by determining if a sufficient number of pixels have changed between frames. Shadows or other lighting changes will be detected as motion. This will often cause a new event for a parked car.
Many people use Frigate to detect cars entering their driveway, and they often run into an issue with repeated events of a parked car being repeatedly detected over the course of multiple days (for example if the car is lost at night and detected again the following morning.

You can use zones to restrict events and notifications to objects that have entered specific areas.

Expand Down
Loading

0 comments on commit b201e97

Please sign in to comment.