Local realtime person detection for RTSP cameras

I’m such a dunce. I’ll update the docker-compose and try again. Sorry for another stupid question, but what does the mask file do and how would I go about creating a personalized one vs the included file?

I haven’t added much info about the mask to the readme yet, but some info is available here in this comment: https://github.com/blakeblackshear/frigate/issues/30#issuecomment-490718844

This is a fantastic project. As commented on earlier in this thread, you really need a link to let us buy you a drink.

Is there anyway to limit the frame rate that python is analyzing? My WYZE cameras do not have a way to change the frame rate in the RSTP stream. This means frigate processes every single frame (multiplied by my 6 regions across 2 cameras) and destroys my CPU/maxes out the Coral buffer queue.

I noticed in the README you mention a tip about limiting the frame rate to lower the CPU usage, but I am unable to do that in my setup without pre-processing the video first.

Can you open a github issue? I have implemented that already in a local version, and that will remind me to include it in the next release.

1 Like

Are you on the dafang hack or their recently released version of RSTP? I only ask because I am having the same problem with my dafanged wyze (unifi works perfectly), and have tried adjusting the FPS, Resolution and Bitrate. But in the end I either get queue full. moving on or unable to grab frame. And then it terminates the capture process and restarts. Are these the same errors you are seeing as well?

I am not. I am using the Wyze beta2 build that gives it official RTSP support. But it seems to be streaming at 1080p with either 15 or 30 fps. (I think 15 is what I’ve heard?).

I did however get those messages because there were too many frames for the number of regions I was trying to process at the same time on the TPU. Limiting the framerate or number of regions will solve it in my case.

Interesting. Yeah, I dropped the frame rate down to 5fps and resolution at 1600X900 with a single region for my Wyze and I am still getting those errors

Issues submitted. Let me know if I can help with it.

That’s odd. Any other errors show in the logs?

I could never get debug to turn on, so not sure what the logs are showing. I have tried it at lower resolutions as well, but same errors occur. I tried 1280X720 and 960X540., both at 5 FPS. Not sure I can dip lower than 5 FPS

Is it plugged into a USB 3.X port?

Yep, and it works perfectly with my other Unifi cameras, across multiple zones.

Huh. I’m not really sure then. Maybe the dafanged implementation is buggy?

Yeah, I’ll have to check that GitHub and see if there are any discussions on the frame rate. Either way, hopefully your PR solves the problem :smiley:

I added a Ko-fi link for anyone who wants to contribute to the project because several of you asked for it. Thanks for your support.

@cjackson234 @scstraus @Kyle

5 Likes

I seem to be getting notifications for very small regions when my min_person_area is something absurd like 2500.

Is this conditional backwards? I’m not sure if I’m understanding it correctly but wouldn’t it want to be flipped to only exit the loop and continue if it’s not smaller?

Also, is there a chance that the area size can also be added to the label here to help with debugging person sizes?

The conditional looks right. It should continue at that point to avoid report a person that is too small. Are you sure you have the minimum set on the correct region?

Adding the person area to the label should be simple enough. It will help me keep track of that request if you create a github issue for it.

Thanks! I’ve submitted 2 issues. One for the enhancement, and one for the issue I’m encountering. Sorry for adding so many lately.

It has my config listed, which I believe is correct? https://github.com/blakeblackshear/frigate/issues/43

What is Unable to grab frame indicative of? I was able to solve my queue full problem. But now, after about 15-60 seconds, I get a blast of about 25 lines of Unable to grab frame? Is it a FPS problem or bitrate?

That means opencv returned an error code for a single frame. It could be anything, but as long as it clears up on its own, I would just ignore it. Probably just a few corrupt frames.