Local realtime person detection for RTSP cameras

I’m actually running the HASSIO VM in Virtual Machine Manager or I think that your solution would be the ticket. I may switch to Docker, but I like the supervisor…

If you like the VM just keep HASSIO in that and run Frigate in Docker. They don’t have to be in the same system.

Didn’t think about that! Thanks I’ll give it a try!

@blakeblackshear after one day the docker “chocked” “broken mpeg”.
Ok Beta :slight_smile:

I restarted the docker .
Question: do I have to cleanup someway the directories or your app take care of it?

Thanks

The retention settings for clips and recordings are in the config.

Ok so that will drive the cleanup even after a docker pause/restart.
tx

I have a question about the camera entities that get made when using the integration and the beta addon together.
I’m testing this using a couple cams. In the integration I end up with one of the cameras named camera.frigate_frontyard.
When a person is detected I get a clip recorded and can view that clip with media browser. No problem there. My issue comes when I look to camera.frigate_frontyard_person.
It showed me a snapshot of the last person detected on the day I installed it, but then never again.

I have restarted the addon, reloaded the integration, restarted Home Assistant and even rebooted the host PC. No change.
Any suggestions on what to look into?

Thanks

That snapshot comes through MQTT. Do you have anything in the logs for Frigate?

Using the Mosquitto Broker from the official addons. I restarted the frigate beta addon and see this in the Mosquittto addon logs:

1608417341: New connection from 172.30.32.1 on port 1883.
1608417341: New client connected from 172.30.32.1 as frigate (p2, c1, k60).
1608418808: Saving in-memory database to /data/mosquitto.db.

Do you see any errors on the homeassistant logs related to MQTT?

logs show:

Timeout error fetching information from http://ccab4aaf-frigate-beta:5000/stats -
4:35:32 PM – Frigate (ERROR) - message first occurred at 4:35:17 PM and shows up 2 times
Error fetching information from http://ccab4aaf-frigate-beta:5000/stats - 502, message='Bad Gateway', url=URL('http://ccab4aaf-frigate-beta:5000/stats')
4:35:02 PM – Frigate (ERROR) - message first occurred at 4:34:52 PM and shows up 2 times
Error fetching frigate data:
4:34:52 PM – Frigate (ERROR)

And the supervisor logs show:

20-12-19 22:34:57 INFO (SyncWorker_7) [supervisor.docker.addon] Starting Docker add-on ccab4aaf/amd64-addon-frigate-beta with version 1.0
20-12-19 22:35:15 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with ccab4aaf_frigate-beta!
20-12-19 22:35:15 INFO (SyncWorker_3) [supervisor.docker.interface] Cleaning addon_ccab4aaf_frigate-beta application
20-12-19 22:35:15 INFO (SyncWorker_3) [supervisor.docker.addon] Starting Docker add-on ccab4aaf/amd64-addon-frigate-beta with version 1.0
20-12-19 22:35:18 WARNING (MainThread) [supervisor.misc.tasks] Watchdog missing application response from ccab4aaf_frigate-beta
20-12-19 22:35:40 INFO (SyncWorker_8) [supervisor.docker.interface] Cleaning addon_ccab4aaf_frigate-beta application
20-12-19 22:35:40 INFO (SyncWorker_7) [supervisor.docker.addon] Starting Docker add-on ccab4aaf/amd64-addon-frigate-beta with version 1.0

Then did another reboot of host and the supervisor errors aren’t there anymore, but these still are:

Error fetching frigate data:
7:21:41 PM – Frigate (ERROR) - message first occurred at 7:21:16 PM and shows up 3 times
Error fetching information from http://ccab4aaf-frigate-beta:5000/stats - Cannot connect to host ccab4aaf-frigate-beta:5000 ssl:default [Try again]
7:21:41 PM – Frigate (ERROR) - message first occurred at 7:21:16 PM and shows up 3 times

I see nothing related to mqtt for errors.

Hmm. That seems to indicate that you have several issues. Can you open an issue and provide the info requested in the template?

I’m not real familiar with github (which is where I’m assuming you mean to open an issue), but I’ll certainly try!

Just published 0.8.0 Beta 2

NOTICE
If you are specifying your thresholds for person detection, 0.85 will now be WAY too high. Update them to 0.7 or remove from your config and use the default. The new model doesn’t score detections as high, but has a much lower false positive rate.

5 Likes

Thanks for the update with more configuration options. I see that the GPU acceleration setting for 10th gen has also been updated… This has fixed the problem I had :slight_smile:
I only installed this for the first time yesterday and its working beautifully. Thank you.

I’d like to ask. Could Frigate convert the camera stream to HLS format, that Chromecast could play?
I don’t use HomeAssistant, so I’m not able to do that with HA. I hope if Frigate could create RTMP stream, maybe could stream HLS also.
Thanks

Should be possible

1 Like

with 0.8, would it be possible to record one clip on motion using the same filename every time which i can than send with telegram?

1 Like

I literally just came here to ask about something similar. So the new model might get rid of this ‘person’ ?

image

Just updated to Beta 2. The only change I made to my config was to remove the person filters as suggested so everything including filters is gone from my config now

objects:
  track:
    - person
    - car
  filters:
    person:
      min_score: 0.6
      threshold: 0.7

And I took advantage of the restart just to plug in docker variables for MQTT

mqtt:
  host: homeassistant
  topic_prefix: motion
  client_id: home
  user: "{FRIGATE_MQTT_USER}"
  password: "{FRIGATE_MQTT_PASSWORD}"

Now I am getting this error when starting:

* Starting nginx nginx
...done.
frigate.app ERROR : Error parsing config: 'NoneType' object has no attribute 'size'

Here is my full config

detectors:
  coral:
    type: edgetpu
    device: usb

mqtt:
  host: homeassistant
  topic_prefix: motion
  client_id: home
  user: "{FRIGATE_MQTT_USER}"
  password: "{FRIGATE_MQTT_PASSWORD}"

save_clips:
  max_seconds: 300
  retain:
    default: 60

objects:
  track:
    - person
    - car
  filters:
    person:
      #min_area: 5000
      #max_area: 100000
      #min_score: 0.6
      threshold: 0.7

record:
  enabled: True
  retain_days: 7

cameras:
  porch:
    width: 1280
    height: 720
    fps: 5
    mask: poly,1,1,0,130,62,114,103,87,205,23,237,0
    ffmpeg:
      inputs:
        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.20:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips

        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.20:554/cam/realmonitor?channel=1&subtype=2
          roles:
            - detect
            - rtmp
            - record
          #global_args: -hide_banner -loglevel info

    save_clips:
      pre_capture: 5
      enabled: True

  driveway:
    width: 1280
    height: 720
    fps: 5
    mask: poly,0,0,3,212,253,184,532,161,683,151,1005,139,1191,153,1279,151,1279,0
    ffmpeg:
      inputs:
        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.21:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips

        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.21:554/cam/realmonitor?channel=1&subtype=2
          roles:
            - detect
            - rtmp
            - record

    save_clips:
      pre_capture: 5
      enabled: True

  patio:
    width: 1280
    height: 720
    fps: 5
    mask: poly,3,1,0,349,32,324,70,289,74,262,78,236,65,196,73,173,115,147,203,128,254,118,295,111,343,96,372,99,402,98,428,91,474,82,519,74,553,74,589,73,630,74,761,78,817,73,871,71,902,69,920,60,964,58,1012,65,1048,60,1071,77,1100,92,1115,110,1141,129,1166,159,1182,190,1191,223,1225,253,1247,278,1273,301,1277,0
    ffmpeg:
      inputs:
        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.22:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips

        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.22:554/cam/realmonitor?channel=1&subtype=2
          roles:
            - detect
            - rtmp
            - record

    save_clips:
      pre_capture: 5
      enabled: True

  north:
    width: 1280
    height: 720
    fps: 5
    mask: poly,50,0,3,21,220,30,393,58,529,81,694,124,795,155,869,172,939,205,976,209,1034,231,1077,257,1148,276,1178,295,1222,309,1195,364,1187,387,1248,440,1279,356,1279,258,1279,3
    ffmpeg:
      inputs:
        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.23:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips

        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.23:554/cam/realmonitor?channel=1&subtype=2
          roles:
            - detect
            - rtmp
            - record

    save_clips:
      pre_capture: 5
      enabled: True

  south:
    width: 1280
    height: 720
    fps: 5
    mask: poly,0,0,1,68,200,63,284,71,423,79,575,95,664,109,685,81,695,44,819,25,900,51,1032,92,1183,150,1279,193,1276,0
    ffmpeg:
      inputs:
        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.24:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips

        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.24:554/cam/realmonitor?channel=1&subtype=2
          roles:
            - detect
            - rtmp
            - record

    save_clips:
      pre_capture: 5
      enabled: True

  yard:
    width: 1280
    height: 720
    fps: 5
    mask: 1,1,3,218,41,198,146,154,188,132,238,110,299,84,354,102,364,139,450,120,474,117,485,158,516,177,545,179,570,181,551,212,551,245,562,302,617,323,702,350,769,361,816,356,820,330,824,293,823,246,780,216,720,185,705,154,717,139,747,124,748,88,744,77,779,70,852,60,887,62,909,87,931,107,942,82,957,92,965,139,968,181,1000,214,1056,289,1112,398,1166,502,1215,614,1237,684,1270,716,1272,360,1277,11
    ffmpeg:
      inputs:
        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.25:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips

        - path: rtsp://{FRIGATE_RTSP_USER}:{FRIGATE_RTSP_PASSWORD}@192.168.0.25:554/cam/realmonitor?channel=1&subtype=2
          roles:
            - detect
            - rtmp
            - record

    save_clips:
      pre_capture: 5
      enabled: True