[Support]: Seems to not delete files from shm #10019
Replies: 3 comments 8 replies
-
This is covered in the docs https://docs.frigate.video/troubleshooting/faqs#fatal-python-error-bus-error There's no reason the detect output args would change the shm handling as it is handled by frigate either way. |
Beta Was this translation helpful? Give feedback.
-
Ok, I've found the problem @NickM-27 It appears that after a certain threshold of resolution * num_cameras, ffmpeg starts throwing errors. When ffmpeg throws an error during processing, Frigate doesn't clean up the temp files in /dev/shm, and that fills up the shm folder, which eventually crashes Frigate. One step at a time:
The camera is 4000x3000 pixels (fisheye). The detect_args takes the 3000x4000 image and selects a small portion of it, flattens it out, and resizes it to 1280x960. If I have one instance of that camera, everything is fine.
I've also found that two streams of 4000x3000 are fine alongside 5 streams at 1920x1080. If I add a 6th 1920x1080 stream, I get the same crashes/errors. It seems to be a function of the total pixels processed in detect_args. Normally, I would never connect Frigate to a 4000x3000 stream, but the goal here is to zoom way in on a 1280*960 section of the fisheye and extract a frame for the detection process. I can't start with a smaller 720x720 substream, zoom way in to a 96x96 box, and resize to 1280x960 with good results. This is where I'm stuck. I don't know enough about ffmpeg to understand why it can't process the additional streams even though memory and CPU are sufficient. I suspect it's something to do with the number of threads simultaneously accessing the VAAPI interface, but I'm way out of my depth now. The strangest part is that everything works great even though ffmpeg is throwing all those errors. The cameras look great, the events are detected, etc. The only artifact of the errors is that Frigate doesn't clean them up and they overrun the shm folder. |
Beta Was this translation helpful? Give feedback.
-
I'm going to close this out because my own problem is resolved. Here's the takeaway from this whole thread:
Nick - thanks for the support |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the problem you are having
My first indicator that something was wrong was the well known error in the log file:
Looking at my /dev/shm folder, I see MANY files from the cameras where I'm using a custom ffmpeg command. For example, here's the count of files using a normal camera without custom ffmpeg:
Here's the count of files for one of the cameras with a custom ffmpeg command:
Looks like the temp files for cameras with custom ffmpeg commands aren't getting cleaned up, causing the /dev/shm folder to run out of space:
Version
0.13.0-C35C7DA
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
Other
Install method
Docker Compose
Coral version
USB
Network connection
Wired
Camera make and model
dahua and hikvision
Any other information that may be helpful
No response
Beta Was this translation helpful? Give feedback.
All reactions