Local realtime person detection for RTSP cameras

I’ve always wondered how frigate looks at things because it seems like it only ever sees one thing in a picture. I understand the people and cars are separated out, but if my whole family is in the driveway moving I only see one person detected at a time.
I’m only noticing this because I am comparing to full tensorflow or deepstack which will show every person in a frame in a bounding box.

Yeah, I use a delay with notifications for HA so I only get one notification every 45 seconds. But for this “edge case” I’m doing, I’m using rsync to copy the snapshots out of the Frigate snapshot directory and into another folder that is shared out via SAMBA so they can be viewed on the network. So I’m really only interested in the snapshots for this particular case. Delay is meant for HA or Node Red notifications. I don’t think there is any built-in delay for Frigate itself to prevent it from saving multiple snapshots.

Been searching for that too… Dont know how github works but you could add the delay function as a “enhancement”?

Need some info from the pros here… :slight_smile:

In the documentation for motion i found this:

# Optional: Height of the resized motion frame  (default: 1/6th of the original frame height)
  # This operates as an efficient blur alternative. Higher values will result in more granular motion detection at the expense of higher CPU usage.
  # Lower values result in less CPU, but small changes may not register as motion.
  frame_height: 180

My cams produce a 640x480 stream for detection. As I can see there is a default value of 180.
But if I divide 480/6 = 80 …

Should I put 80 here to reduce my CPU usage and faster object detection?

Another question.

My NUC is a little powerless to run Frigate and I want to run the docker on a another machine (doing so today). Everything works smooth and nice. But I miss the possibility to open the Frigate NVR on my side panel. I’ve done a icon to open the Frigate url on my local machine, but it wont show up when using NabuCasa… How to solve that?

Question 2:
How to run Frigate on Portainer? Cant make it work… :slight_smile:

1 Like

Hi @danbutter

This is a known issue with the intel-media-va-driver
Have a look at this github issue

Ho id u setup this graphs mate? I also use coral but pci :). Btw is the created camera by frigate not the rtmp stream? And how would i setup this rtmp stream as a camera please ? :slight_smile: seems much less delay than the camera entity created by frigate.

This happens when frigate loses an object and detects it as a new one. You can try increasing the max_disappeared setting so frigate keeps looking longer before giving up. Overuse of masks and filters can also cause frigate to lose the object more easily.

1 Like

Thanks for pointing that out!
I’ll try to keep an eye on that discussion.

The thumbnails for each event are specific to the object that was being tracked. It only draws the bounding box for the object associated with the event. Other objects are being tracked as separate events.

I don’t recommend specifying any optional parameters in your config unless you are going to change them from the default values. It just makes upgrading versions more difficult. Frigate will calculate that particular value from your frame height dynamically if you don’t specify it.

Unfortunately, I have to use several masks as I have parked cars in view of the camera. So when frigate locks onto a moving car (which is what I want), and the car moves out of the frame, it then locks onto the parked cars without the appropriate object masks drawn all over the screen to prevent it from doing so. So I have to have several masks drawn which probably messes with its tracking ability as you point out.

I may just have to wait and see if you add some type of feature that will prevent this in the future without the use of so many masks.

I just got a Google Coral usb device and try to setup Frigate HassOS add-on. I can’t seem to detect the Coral with Frigate, any advice? Running HassOS 64bit through SSD (USB3.0) on a RPI4.

Just wanted to say a massive thanks to @blakeblackshear for the latest update. I upgraded today to the latest version running the full addon and HACS integration on HomeAssistantOS. Took me a couple of hours to upgrade for a two camera setup - a bit of time for migration of the config, then re-integration with my custom alarms and notifications and some tests.

The new web frontend is excellent, everything a solid NVR needs to provide an no extra fluff, plus it looks great and seems to be running solidly so far.

I’d encourage anyone who hasn’t already to make the upgrade.

Thanks again Blake!

4 Likes

Hi, I just installed Frigate today on RPi4 4gb running Home Assistant OS, using a wyze cam V2. I have been testing, and I have the stream successfully appearing in the Web UI. Person detection appears to be working with rudimentary testing. I’m having some issues with MQTT though. Nothing appears in my logs or MQTT Explorer to show that Frigate is registering. My Frigate log shows the following after restarting:

 * Starting nginx nginx
   ...done.
frigate.app                    INFO    : Creating directory: /tmp/cache
Starting migrations
peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
peewee_migrate                 INFO    : There is nothing to migrate
frigate.mqtt                   ERROR   : MQTT Not authorized
frigate.mqtt                   INFO    : MQTT connected
frigate.app                    INFO    : Camera processor started for back: 36
detector.cpu1                  INFO    : Starting detection process: 33
frigate.app                    INFO    : Capture process started for back: 37
frigate.mqtt                   ERROR   : MQTT Not authorized
frigate.mqtt                   INFO    : MQTT connected
frigate.mqtt                   ERROR   : MQTT Not authorized

Here’s my Frigate MQTT config:

mqtt:
  host: 192.168.1.19

And my MQTT Broker logs show the following:

[20:00:42] INFO: Setup mosquitto configuration
[20:00:42] INFO: No local user available
[20:00:42] INFO: Initialize Hass.io Add-on services
[20:00:42] INFO: Initialize Home Assistant discovery
[20:00:42] INFO: Start Mosquitto daemon
1612231242: mosquitto version 1.6.3 starting
1612231242: Config loaded from /etc/mosquitto.conf.
1612231242: Loading plugin: /usr/share/mosquitto/auth-plug.so
1612231242: |-- *** auth-plug: startup
1612231242:  ├── Username/password checking enabled.
1612231242:  ├── TLS-PSK checking enabled.
1612231242:  └── Extended authentication not enabled.
1612231242: Opening ipv4 listen socket on port 1883.
1612231242: Opening ipv6 listen socket on port 1883.
1612231242: Opening websockets listen socket on port 1884.
1612231242: Opening ipv4 listen socket on port 8883.
1612231242: Opening ipv6 listen socket on port 8883.
1612231242: Opening websockets listen socket on port 8884.
1612231242: Warning: Mosquitto should not be run as root/administrator.
1612231244: New connection from 192.168.1.12 on port 1883.
[INFO] found jake on Home Assistant
1612231244: New client connected from 192.168.1.12 as mqtt-explorer (p2, c1, k60, u'jake').
1612231248: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1612231249: New client connected from 172.30.32.1 as 1v1y1c2bgYp1cPhs8ZZZaB (p2, c1, k60, u'homeassistant').
1612231288: New connection from 172.30.32.1 on port 1883.
1612231288: Socket error on client <unknown>, disconnecting.

What am I missing or where did I go wrong? TIA

A handful of people have had success adding a username and password to the mqtt config

1 Like

Thanks mate, just tried that and it worked. I defined a username/password in the Mosquito broker add-on, then added it under mqtt in the config for the frigate addon, and finally also added it under the Configuration -> MQTT settings. Up and running now.

It would be nice to be able to separate the clips into folders for each camera, would this be possible?

You can write a script to move the files, but it will break the homeassistant addon and the WebUI.

Can it works with a camera MJPEG stream? I have my own DIY cameras build on motion and I wonder if they can be connected to frigate.

Thx