Local realtime person detection for RTSP cameras

I’ve reverted back to just three cameras and I’m still seeing the same issue, so I’ve clearly done something stupid here.

The IP address in the URL is correct, however, I have just tried it in VLC too and it says it can’t be opened, so doesn’t seem like the problem is localised to HA.

I’ve got Frigate running in a Docker, the Frigate app is running and showing the video just perfectly, the stills and detection snapshots show fine in HA, just when I click a video to watch within HA there is no stream rendered and the error shown in the log…

Is it possible that I need to allow the HA docker to talk to the Frigate docker over the rtmp port 1935?

I’ve fixed it, my Frigate docker compose wasn’t allowing port 1935 (rtmp), only 4000 > 5000.

What I don’t remember is setting this up at all, just the 4000 > 5000 mapping (I’m running docker on a QNAP NAS).

Spotted the port settings in a YouTube video of someone setting it up and once I changed that, I could connect to the 1935 port from my local machine and then HA was back up and showing streams.

Turns out there is an (undocumented?) field “type” that is either “new” or “update” (in-progress). That should fix the issue, but there seems to be something broken about how this whole in-progress thing works.

Sometimes Frigate seems to stuck in endless loops with the same event (same eventid) and never gets out of it. I get the same mqtt data over and over and over again, even with the same image as the latest one (according to the docs, we should only get a new event if there is a ‘better’ image).

Going to HA → Frigate → Events, I can see that some events are “in-progress” and has been so for several hours. They don’t go away until manually deleting them. In theory, I could just ignore it (by checking type=ignore), but since Frigate is stuck with this old event it doesn’t always notice that something new has happened.

For example, one person shows up and I get a new event (type=new) for this. A few minutes later, a second person shows up. There is no way for me to know about this since Frigate is stuck with a “in-progress” event, spamming me with type=update events containing just the first person. For hours and hours. Some times there are also in-progress events that don’t even show up in the GUI, and only disappear when the addon is restarted.

I would just like to turn this entire in-progress thing off, I see absolute no use for this myself even if it would work as expected, but as far as I can tell there is no way to do that.

It’s not stuck. You likely have stationary objects that are being tracked and you should see them in the debug view for the camera. Stationary objects will publish an update message once per minute or when position changes occur. This allows you to build automations for lingering objects based on how long they have been stationary.

Deleting in progress events doesn’t stop them. They will end up getting reinserted into the database when complete.

The second person will have a different ID.

The type parameter is documented on the mqtt page for the events topic.

You can disable stationary object tracking in the config by setting a max frames value for object types. However, it helps frigate not accidentally assume a person in the background is the same person in the foreground when tracking to know what is already in view.

All of this was covered in the release notes.

2 Likes

Are there any instructions on how to get frigate working with an nvidia gpu in home assistant?
I have this working in Unraid but can’t for the life of me, figure out how to do this in HA. Any guidance would be appreciated. Thanks

Can the time before and after an event was detected be configured?

for example, if a person is detected, I’d like to be able to specify to save X minutes before and after.

events:
    # Optional: Maximum length of time to retain video during long events. (default: shown below)
    # NOTE: If an object is being tracked for longer than this amount of time, the retained recordings
    #       will be the last x seconds of the event unless retain->days under record is > 0.
    max_seconds: 300
    # Optional: Number of seconds before the event to include (default: shown below)
    pre_capture: 5
    # Optional: Number of seconds after the event to include (default: shown below)
    post_capture: 5
    # Optional: Objects to save recordings for. (default: all tracked objects)
    objects:
1 Like

thanks. I couldn’t’ remember where to find it

is there an easy way to use an external USB drive for recordings/clips? I googled and it seems possible to mount an external drive as the Media folder, but the process seemed quite technical & I didn’t 100% understand it!

is there anybody willing to point me in the proper direction in order to avoid these errors? Normally this happens when Frigate detects the motion of the leaves because of the wind and then wrongly detects a person. Evidently I cannot mask that area out as it is the entrance path, nor can I tamper with the sizes as that’s exactly the size of a possible person, so what else? Moreover I would like to have a simple explanation of the use of the two parameters min_score and threshold as I don’t really understand them on the Frigate webpage. Any way, since I understand that they must be involved with the reliability of the detection, for this specific case (min_score: 0.45 and threshold: 0.7) the “reliability score” is quite high (71%) hence this doesn’t seem the way to go either. I will appreciate any possible help, thanksphoto_2022-04-13_16-15-31

I was in the same situation i put threshold 0.77, now its fine. Try it and go out if it detects you day/night

well thanks for your fast reply, I’ll try but just to help me frame it a little bit better, what did you have as min_score while having my same problem and what do you have now?

Any ideas for h265 encode to frigate i bought Reolink 4k camera and cannot connect to frigate i tried so much things i connect only sub stream because sub stream is in h264 any ideas

All 12cameras on each hass instances, i have 2 HAOS
min_score: 0.5
threshold: 0.77

i have it done on docker, just add a volume (aka your usb mount) and go into the container and change the storage location to your drive.

This is only if u are using frigate from a docker container and not from the addon in hass

1 Like

Thank you :slight_smile:

1 Like

From what i know h265 is not supported, idk when it will be

Is there a way to use the Doorbird camera with frigate?

Yes

just use send video to frigate

page 11 may help if you dont know the ip for live video

I know the IP for the live video, but which frigate camera config is needed? (ffmeg, inputs…)