Frigate question- CPU usage

I have installed Frigate to record motion on one camera. My Intel NUC seems to handle two cameras just fine without the expensive Coral unit (is there a lower cost alternate?) But once in a while the CPU usage goes yellow.

Yellow

Is this bad? Is there a lower-cost alternative to the Coral unit?
(I am using HAOS on an Intel NUC.)

Coral is cheap $30. Alternative is GPU. Jetson nano also but I donā€™t know much about that or itā€™s price.

Your experience seem normal. Coral is recommended however

I just installed Frigate on my HA OS i7 NUC and the way I reduced the CPU usage somewhat was to reduce the detection frame resolution down to 1920x1080 (rather than the 4K that the cameras are). My CPU usage is only around 12% with detection enabled on 3 cameras. My CPU temperature however is reporting very high (80~100C), though I think it is a false report because Iā€™ve had that same issue with other very low resource hungry add-ons as well.
image

If you can find one.

2 Likes

Is Frigate supported on nano with GPU acceleration?

I guess answer is ā€˜noā€™ā€¦

Long Thread here

also look at this

Thanks for replying. I did read these and other resources and this is my understanding, please correct me if I am wrong:

  1. Fregate works out of the box with Google Coral with minimum configuration
  2. No other GPU accelerated options are officially supported at this moment
  3. While there are attempts to run Fregate with Nanoā€™s GPU acceleration, there is no definite guide confirmation.
  4. Frigate uses FFmpeg while the best way to do GPU acceleration on Nano is via Gstreamer.
  1. Basically yes

  2. Coral is not GPU. You may use GPU FFMPEG parameters set tings but I donā€™t do that and never and had no luck setting them.

  3. Thatā€™s about what I saw in this threads but I didnā€™t read to end as I donā€™t use nano. Looked like he was working on supporting but difficult since he didnā€™t have hardware. Again, I didnā€™t read that thoroughly so I could be wrong.

  4. Yes, Ffmpeg. No clue about nano.

Thanks again.

Seems there is one alternative to Frigate by using Nanoā€™s GPU-accelerated object recognition -
Automate Your Household Duties with NVIDIA Jetson and DeepStack

The approach is to use Nano for object recognition only by using Nvidiaā€™s native SDKs and integrating such workload with a HA that is running on another resource/computer.

I will try the above approach and see how it works.

Doods is an option also

Did not know about it. Thanks again.

Hi,
I also have problem with frigate and high cpu usage. I donā€™t have coral but it think I found at least some temporally solution how to reduce cpu usage.
In portainer I edited frigate container and set cpu limit and just updated limits to running contaner.

Before this my cpu usage was between 80% do 97%. After I done limitation in portainer my cpu usage is on average around 35%.
I donā€™t see any problem with camera stream or motion detection.
When I restart addon I have to update limits again. I donā€™t know how to make this setting permanent. so if someone know how to do it please write it down below.

Limit cpu is good idea. Limiting memory is also recommended.

I do this for all docker containers as in the past Iā€™ve had a containers take all t memory and bring things to a halt

Reducing False Positives and adding Masks will help as well. This reduces detections and object detection work done by CPU.

I have motion mask and zones configured. I check everything again and again and I always ended with high cpu usage no matter what. I think that there must be some problem in frigate addon or integration. Ok i use cpu detectors because I donā€™t have coral but limiting cpu on container just solved the problem. There is no frame dropping everything works as it should.
How did you make permanent limit on cpu and memory usage on docker containers?

I expect this is normal using CPU only.

Detections use heavy processing and very cpu intense. This is why TPU(coral) and at least GPU are recommended.

How many camera using?

What us resolution for ā€œdetectā€ stream?

What is process time per detection? 8ms is TPU and i think good cpu is over 500ms(i forget but its significantly slower).

How much motion?

I believe frigate use all available cpu for detect process when cpu only so it should be high. Question is whether it could be more efficient i think. This depends on config and setup.

I have hikvision intercom. I have one camera and indoor device. Those are poe devices. They are connected over poe switch and switch is pluged in with ethernet cable to a router that is working as mesh node in wifi network.
So Iā€™m using one camera.
The motion sensor on camera is very often triggered because i have some trees in front of my door. When it is windy day motion sensor is running wild. Motion is disabled on intercom camera setup.
Camera is using 1270x720 with 12 fps.
I disabled global with and height detect on frigate and created three cameras front door, parking, house. For those I use with and height 480 with 5 fps and 10 fps.
I tried different combinations of everything, using hwaccel_args but nothing seemed to work except limiting cpu usage on container.
I was really impressed how great this is working. I didnā€™t expected that it will work so good for now. Maybe it will be a good idea that developers enable in every addon cpu and memory limitation.

You have one camera but added as 3 cameras?

Doesnt matter camera, intercom, phone, webstream; for frigate it is camera. I think 3 or 4 camera could be a lot for cpu.

Lots of motion would increase cpu usage since frigate would constantly check for object.

Width and height is based on resolution of detect stream. Any other resolution will increase cpu i believe. Same with FPS. Set it to match camera.

Well I have one physical device and 3 virtual cameras. You can create from one camera as many as you can think of virtual cameras. This is obvious in frigate integration because I have one camera and 5 devices. Out of 5 one is frigate server.
I know that lot of motion will drastically increase cpu usage, but I canā€™t do much about it. If wind is blowing leaves on the trees will create a lot of motion.
What do you mean by ā€œWidth and height is based on resolution of detect streamā€ ?
is this width and height configured on a camera webui?