Repository navigation
[Bug]: 0.18 TrackedObjectProcessor copies every detect frame on one thread (CameraState.update np.copy), silently capping aggregate detect resolution #24616
Describe the problem you are having
Profile: a 60 s
Microbenchmark (same container, separate process, one I420 frame per iteration):
Preallocation does not help, and there are no page faults: the copy is memory-bandwidth bound. The resulting cost model is ≈2.35 ms per frame plus ≈6 ms per 4K frame, so one thread bounds the aggregate detect pixel rate regardless of available cores. Suggestions (any one helps; together they remove the ceiling):
Happy to test a build or branch against this workload and report processed versus captured fps. Steps to reproduce
Version0.18.0-77a66e7 (official In which browser(s) are you experiencing the issue with?N/A (backend) Frigate config file# Minimal excerpt; the full config has 40 cameras. A sanitized full copy can be shared privately.
detectors:
onnx_0: {type: onnx}
onnx_1: {type: onnx}
onnx_2: {type: onnx}
onnx_3: {type: onnx}
cameras:
camera_a: # ~18 cameras like this at 4K
ffmpeg:
hwaccel_args: preset-nvidia
inputs:
- path: rtsp://127.0.0.1:8554/camera_a
roles: [detect, record]
detect: {width: 3840, height: 2160, fps: 5}
camera_b: # the rest at 1080p or D1
detect: {width: 704, height: 480, fps: 5}docker-compose file or Docker CLI commandRelevant Frigate log outputRelevant go2rtc log outputOperating systemOther Linux (Ubuntu 24.04 VM, kernel 6.8) Install methodKubernetes (k3s), official image (not in the list) Network connectionWired Camera make and modelAmcrest IP8M-2496E-V2 / IP8M-2796E-AI / IP8M-DLB2998EW-AI, Reolink Duo 3 / OMVI 3i (not camera-specific) Screenshots of the Frigate UI's System metrics pagesText instead of screenshots: CPU at most 60% of 48 vCPU (AMD Threadripper 2990WX VM, 4 NUMA nodes). GPU (RTX) detector inference 17–22 ms. The Any other information that may be helpfulThe same thread's synchronous full-resolution snapshot encode also makes object-end bursts on high-resolution cameras drop frames on every camera. |
Replies: 2 comments 10 replies
|
Please see https://github.com/blakeblackshear/frigate/blob/dev/AI_POLICY.md, these AI generated reports are not nearly as helpful as reports of actual issues with the direct information. The "suggestions" also lack knowledge of how Frigate works, used to work, and the reasons why it is designed the way it is. Running high resolution detect is discouraged as it is in the vast majority of cases not beneficial and more likely to cause problems, in many ways:
I ran the numbers on a few of my test setups and I see significantly less impact where the operation @ 3840x2160 takes between 0.3 and 0.6 ms instead of between 4.2 and 7.9 ms, looks like host or VM tuning would be the first recource. In general, this is accepted by the design, losing a frame is not fatal or a major problem, if the system is overloaded this is acceptable behavior. The main problem here is that there is no way for the user to be aware of this. I will work on adding a system notice in 0.19 so the user will be made aware of this issue. |
|
Related finding: the detected-frames queue holds only about 0.2 s, so any
Suggestions (complementary to the ones above):
Either would absorb these stalls; the loop itself averages about 55% busy here. |


this is improved in #24619