Local realtime person detection for RTSP cameras

Any indictaion of why the current_zones is empty in the after object of my MQTT message? It’s screwing up my automations. Based on the “box”, the object is clearly in one of my zones (and also meets all the filtering requirements for that zone). Ironically, in the very next MQTT message, the current_zones was populated correctly in the before object.

{"before":{"id":"1672102387.274661-4gigs3","camera":"driveway_cam","frame_time":1672103572.98488,"snapshot_time":1672103572.523118,"label":"car","sub_label":null,"top_score":0.84375,"false_positive":false,"start_time":1672102387.274661,"end_time":null,"score":0.71484375,"box":[367,111,503,256],"area":19720,"ratio":0.9379310344827586,"region":[175,0,535,360],"stationary":false,"motionless_count":5,"position_changes":3,"current_zones":["street_zone"],"entered_zones":["street_zone"],"has_clip":false,"has_snapshot":false},"after":{"id":"1672102387.274661-4gigs3","camera":"driveway_cam","frame_time":1672103574.78718,"snapshot_time":1672103574.78718,"label":"car","sub_label":null,"top_score":0.84375,"false_positive":false,"start_time":1672102387.274661,"end_time":null,"score":0.7265625,"box":[350,132,539,317],"area":34965,"ratio":1.0216216216216216,"region":[251,34,635,418],"stationary":false,"motionless_count":2,"position_changes":3,"current_zones":[],"entered_zones":["street_zone"],"has_clip":false,"has_snapshot":false},"type":"update"}}

I don’t know if you are already tried to exclude the Audio of the camera, sometimes this could be the problem.

You can disable the audio with this config:

input_args: -an

Setting args is a replacement for all the default args. It does not add to them. You almost certainly want to copy the default args and modify rather than replace them like this.

1 Like

Every once in a while, my feed gets all wonky and it detects a “Person”.
In the attached, it detected a “Person” with a 71% confidence but when I click Snapshot, it shows the detected “Person” is only at 55% and is nowhere near the “Front Porch” zone
Checking through previous glitches, most are detected at around 70% to 73%
Raising the confidence won’t work for me but the “min_area” might.
Most legit "Person"s are detected with a range of around 80% but there are some that are detected as low as 73% and I’d miss those.

How can I make Frigate NOT see these glitches as a “Person”?

thanks

the “Front Porch” zone is just the area of concrete to the right of the posts.

This image shows that the confidence is 71%.
The snapshot shows the detected area is near the top left and the confidence at 55% but it is nowhere near the “Front Porch” zone.

Add this lines and test it in day/night. Play with the numbers but not lower than 0.75

    objects:
      filters:
        person:
          min_score: 0.8
          threshold: 0.82

I’m suddenly having issues with massive CPU usage (100%) from Frigate, but I don’t really know how to diagnose the issue.

It’s been working perfectly for well over a year, but now when a camera temporarily disconnects the CPU usage goes through the roof and crashes my HA! I thought it might be a power issue, so added a powered USB hub, but the issue keeps happening.

I’m thinking perhaps my NUC is on it’s last legs, but does anyone know how I could go about finding what the issue is?

I’ve got an i3 processor with 16GB of ram, so can easily handle Frigate, and has done for a long time.

Thanks in advance!

How do you enable birdseye restream in beta version (V12). I read the docs but still not clear to me

EDIT
figured it out.
added global value.


restream: 
  birdseye: true

Hi have thiss error on latest 0.12 beta, any help?


s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/prepare-logs.sh
cont-init: info: /etc/cont-init.d/prepare-logs.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun frigate (no readiness notification)
services-up: info: copying legacy longrun go2rtc (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
Traceback (most recent call last):
  File "/usr/local/go2rtc/create_config.py", line 23, in <module>
    go2rtc_config: dict[str, any] = config["go2rtc"]
KeyError: 'go2rtc'
s6-rc: info: service legacy-services successfully started
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Did you add the separate config file for go2rtc?
What is your install method? Show docker run or how you run frigate?

addon in Home Assistant. From what I remember i don’t have anything go2rtc

EDIT: Ohh I have WebRTC HACS. I removed it, restarted HA, still same error

Frigate Beta adds go2rtc

I think it runs without go2rtc config but just in case you should add the frigate-go2rtc.yaml file next to frigate.yml

Ok I added and now it started,


go2rtc:
 # streams:
 #   test_cam: ...
  webrtc:
    candidates:
      - 192.168.1.12:8555
      - stun:8555

but I receive these errors


023-01-18 09:23:50.873330849  [2023-01-18 10:23:50] frigate.video                  ERROR   : door12n: Unable to read frames from ffmpeg process.
2023-01-18 09:23:50.874020651  [2023-01-18 10:23:50] frigate.video                  ERROR   : door12n: ffmpeg process is not running. exiting capture thread...
2023-01-18 09:23:50.878963544  [2023-01-18 10:23:50] frigate.video                  ERROR   : door14n: Unable to read frames from ffmpeg process.
2023-01-18 09:23:50.879450849  [2023-01-18 10:23:50] frigate.video                  ERROR   : door14n: ffmpeg process is not running. exiting capture thread...
2023-01-18 09:23:53.714923379  [2023-01-18 10:23:53] frigate.video                  ERROR   : garage_front: Unable to read frames from ffmpeg process.
2023-01-18 09:23:53.715025932  [2023-01-18 10:23:53] frigate.video                  ERROR   : garage_front: ffmpeg process is not running. exiting capture thread...
2023-01-18 09:23:53.967581296  [2023-01-18 10:23:53] frigate.video                  ERROR   : office2: Unable to read frames from ffmpeg process.
2023-01-18 09:23:53.967848008  [2023-01-18 10:23:53] frigate.video                  ERROR   : office2: ffmpeg process is not running. exiting capture thread...

also this, but it was reading the coral before, I dont understand so many changes

023-01-18 09:24:15.450052701  [2023-01-18 10:24:15] frigate.detectors.plugins.edgetpu_tfl ERROR   : No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors.
2023-01-18 09:24:15.451154829  Process detector:coral:
2023-01-18 09:24:15.456265282  Traceback (most recent call last):
2023-01-18 09:24:15.456338043    File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 160, in load_delegate
2023-01-18 09:24:15.456340317      delegate = Delegate(library, options)
2023-01-18 09:24:15.456373151    File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 119, in __init__
2023-01-18 09:24:15.456374933      raise ValueError(capture.message)
2023-01-18 09:24:15.456415863  ValueError
2023-01-18 09:24:15.456454382  
2023-01-18 09:24:15.456456228  During handling of the above exception, another exception occurred:
2023-01-18 09:24:15.456457371  
2023-01-18 09:24:15.456487294  Traceback (most recent call last):
2023-01-18 09:24:15.456548727    File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2023-01-18 09:24:15.456550173      self.run()
2023-01-18 09:24:15.456597888    File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2023-01-18 09:24:15.456599563      self._target(*self._args, **self._kwargs)
2023-01-18 09:24:15.456648151    File "/opt/frigate/frigate/object_detection.py", line 97, in run_detector
2023-01-18 09:24:15.456662711      object_detector = LocalObjectDetector(detector_config=detector_config)
2023-01-18 09:24:15.456706075    File "/opt/frigate/frigate/object_detection.py", line 52, in __init__
2023-01-18 09:24:15.456707990      self.detect_api = create_detector(detector_config)
2023-01-18 09:24:15.456738311    File "/opt/frigate/frigate/detectors/__init__.py", line 24, in create_detector
2023-01-18 09:24:15.456739800      return api(detector_config)
2023-01-18 09:24:15.456768200    File "/opt/frigate/frigate/detectors/plugins/edgetpu_tfl.py", line 34, in __init__
2023-01-18 09:24:15.456769855      edge_tpu_delegate = load_delegate("libedgetpu.so.1.0", device_config)
2023-01-18 09:24:15.456798405    File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 162, in load_delegate
2023-01-18 09:24:15.456800194      raise ValueError('Failed to load delegate from {}\n{}'.format(
2023-01-18 09:24:15.456836800  ValueError: Failed to load delegate from libedgetpu.so.1.0

and this (was working before)


2023-01-18 09:24:20.814801856  [2023-01-18 10:24:20] watchdog.door12n               ERROR   : Ffmpeg process crashed unexpectedly for door12n.
2023-01-18 09:24:20.814805537  [2023-01-18 10:24:20] watchdog.door12n               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-01-18 09:24:20.814806955  [2023-01-18 10:24:20] ffmpeg.door12n.detect          ERROR   : [rtsp @ 0x560d25ef0f80] method DESCRIBE failed: 401 Unauthorized
2023-01-18 09:24:20.814808452  [2023-01-18 10:24:20] ffmpeg.door12n.detect          ERROR   : rtsp://*:*@192.168.1.74:554/Streaming/Channels/102: Server returned 401 Unauthorized (authorization failed)
2023-01-18 09:24:20.842564005  [2023-01-18 10:24:20] watchdog.door14n               ERROR   : Ffmpeg process crashed unexpectedly for door14n.
2023-01-18 09:24:20.842567440  [2023-01-18 10:24:20] watchdog.door14n               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-01-18 09:24:20.842568827  [2023-01-18 10:24:20] ffmpeg.door14n.detect          ERROR   : [rtsp @ 0x556f702d8f80] method DESCRIBE failed: 401 Unauthorized
2023-01-18 09:24:20.842570329  [2023-01-18 10:24:20] ffmpeg.door14n.detect          ERROR   : rtsp://*:*@192.168.1.76:554/Streaming/Channels/102: Server returned 401 Unauthorized (authorization failed)
2023-01-18 09:24:20.863572469  [2023-01-18 10:24:20] frigate.video                  ERROR   : door12n: Unable to read frames from ffmpeg process.
2023-01-18 09:24:20.863575787  [2023-01-18 10:24:20] frigate.video                  ERROR   : door12n: Unable to read frames from ffmpeg process.
2023-01-18 09:24:20.863577269  [2023-01-18 10:24:20] frigate.video                  ERROR   : door12n: Unable to read frames from ffmpeg process.
2023-01-18 09:24:20.867169248  [2023-01-18 10:24:20] frigate.video                  ERROR   : door12n: Unable to read frames from ffmpeg process.
2023-01-18 09:24:20.867173113  [2023-01-18 10:24:20] frigate.video                  ERROR   : door12n: ffmpeg process is not running. exiting capture thread...
2023-01-18 09:24:20.895365223  [2023-01-18 10:24:20] frigate.video                  ERROR   : door14n: Unable to read frames from ffmpeg process.
2023-01-18 09:24:20.895743137  [2023-01-18 10:24:20] frigate.video                  ERROR   : door14n: Unable to read frames from ffmpeg process.
2023-01-18 09:24:20.896265121  [2023-01-18 10:24:20] frigate.video                  ERROR   : door14n: ffmpeg process is not running. exiting capture thread...
2023-01-18 09:24:20.912957754  [2023-01-18 10:24:20] watchdog.office2               ERROR   : Ffmpeg process crashed unexpectedly for office2.
2023-01-18 09:24:20.912962526  [2023-01-18 10:24:20] watchdog.office2               ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-01-18 09:24:20.912964032  [2023-01-18 10:24:20] ffmpeg.office2.detect          ERROR   : [tcp @ 0x55c1ed279240] Connection to tcp://192.168.1.45:554?timeout=5000000 failed: No route to host
2023-01-18 09:24:20.912965425  [2023-01-18 10:24:20] ffmpeg.office2.detect          ERROR   : rtsp://*:*@192.168.1.45:554/rtsp_live0: No route to host
2023-01-18 09:24:21.111660405  [2023-01-18 10:24:21] frigate.watchdog               INFO    : Detection appears to have stopped. Exiting Frigate...
s6-rc: info: service legacy-services: stopping
2023-01-18 09:24:21.136420735  exit OK
2023-01-18 09:24:21.139319901  [2023-01-18 10:24:21] frigate.app                    INFO    : Stopping...
2023-01-18 09:24:21.146033573  [2023-01-18 10:24:21] ws4py                          INFO    : Closing all websockets with [1001] 'Server is shutting down'

A lot changed so need to treat like new install really and read the beta docs

Tpu issues are unrelated to beta update

With tpu not working other errors will occur. Troubleshoot tpu error then move on to others.

1 Like

Did you completely reinstall home assistant or just the Frigate add-on? The same error cropped up on me today too.

Just reinstalled Frigate. I hope it works for you too.

Hi,

I don’t understand how to use the frigate add-on when frigate is running on a different box than HA
I have frigate successfully running on a dedicate host with docker, but the I’m able to successfully configure only the proxy

I don’t understand how to setup the add-on to expose the entities in HA

Can anyone help me to understand the correct steps?

regards

The add-on is what allows you to see frigate in the HA sidebar and view the frigate web interface within HA.

To see the entities you don’t need the add-on, you need the integration

@SgtBatten , does integration allow me to connect to an “external” frigate instance?
where I can find the instructions?

Yes it does. Same way the proxy add-on does.