Closed bitnimble closed 2 years ago
I added width
, height
and fps
config options to the detect
section:
detect:
width: 1920
height: 1080
fps: 15
enabled: False
and yep, it changes to -r 15 -s 1920x1080
-- so those options are definitely coming from the detect config, even though detect is disabled.
Although unfortunately it looks like ffmpeg doesn't care that the res + fps is the same as the incoming stream, the CPU usage is the same, 20-30% :'(
edit: actually, it looks like the CPU usage went up, lmao, I guess because a 1080p output is more intensive even though it shouldn't be encoding...
I'll try to confirm which arguments are causing the high cpu usage, it's entirely possible that it's not the fps + scale at all, and just the remux alone is heavy.
It looks like the detect stream is created because of these lines: https://github.com/blakeblackshear/frigate/blob/7c60753ab0a376efdbd834d3cd3900cc029e5158/frigate/config.py#L583-L585
Is it mandatory that record/rtmp/detect streams all run? I did notice that the ffmpeg process is guarded by a "detect" role check: https://github.com/blakeblackshear/frigate/blob/7c60753ab0a376efdbd834d3cd3900cc029e5158/frigate/config.py#L615
... but at the same time, it seems like the detect role is required: https://github.com/blakeblackshear/frigate/blob/7c60753ab0a376efdbd834d3cd3900cc029e5158/frigate/config.py#L435-L436
Surely I can't be the only one that wants to use Frigate for recording + rtmp, etc without needing detection? If that's the case, do you know if there would be any issues with me just commenting those lines out on my instance? Are there other areas of the code that require / expect the detect stream to be running?
ah, I just stumbled upon https://github.com/blakeblackshear/frigate/issues/1911#issuecomment-1153218796 :) Glad to see that it's something already known, probably can close this ticket if it seems like a duplicate of that request.
This is a duplicate. Currently frigate does not function without at least one stream being decoded since the live view and the rest of the UI depend on it. Some have set the detect stream to a solid black small frame to minimize CPU load. That's what you will see in the UI, but recordings will work.
Perfect, thanks for the confirmation. Would be lovely to have this option supported first-class in the future but this workaround is good enough for me :)
For future readers, you can get the 2x2 black square video here: https://github.com/blakeblackshear/frigate/issues/1911#issuecomment-1182952523
Hey @bitnimble
Can you share the config after the black.mp4 change? I need to record without detect but can't seem to get it working
Describe the problem you are having
I'm currently planning on using Frigate just for recording at night, no detection for now. As far as I can tell from the docs, the RTMP and record streams simply remux the existing h264 stream without any processing.
However, ffmpeg is still running with ~20% CPU usage (on an i3), and I suspect because it has the
-r 5 -s 1280x720
command line args attached. My camera has a 15fps 1080p stream.Is this intended? Since I have detect disabled, there's no reason for this low fps, scaled stream to be running at all? If intended, is there any way to reduce my CPU usage further then? I don't care about motion or object detection at all right now.
Version
0.11.1-2EADA21
Frigate config file
Relevant log output
Frigate logs
Frigate stats
Operating system
Other Linux
Install method
Docker Compose
Coral version
CPU (no coral)
Any other information that may be helpful
No response