Closed peveleigh closed 1 year ago
I notice you are not setting the detect resolutions of any of the cameras which means they are all being resized to 1280x720, probably a good idea set these to avoid doing that work.
When it comes to memory issues like this, more info is going to be needed. Specifically, we need to know what process(es) or files are using the memory. High memory usage can be caused by a number of different issues.
The logs indicate that garage_side is sending bad data, what type of camera is this?
garage_side is a Digoo DG-W01f garage_inside and living_room are xiafang's flashed with dafang hacks driveway and front_walkway are empiretech/dahua IPC-T2431T-AS's
It may be worth noting that I'm running an identical config (except with record enabled) on another machine running bare metal debian.
That one did this without suffering a memory spike:
[36mfrigate |[0m 2023-07-23 07:13:16.348445645 [2023-07-23 07:13:16] watchdog.garage_inside INFO : garage_inside exceeded fps limit. Exiting ffmpeg...
[36mfrigate |[0m 2023-07-23 07:13:16.349120691 [2023-07-23 07:13:16] watchdog.garage_inside INFO : Waiting for ffmpeg to exit gracefully...
[36mfrigate |[0m 2023-07-23 07:13:22.202258464 192.168.2.10 - - [23/Jul/2023:07:13:22 -0230] "GET /api/stats HTTP/1.1" 200 3378 "-" "HomeAssistant/2023.6.2 aiohttp/3.8.4 Python/3.11" "-"
[36mfrigate |[0m 2023-07-23 07:13:31.230144753 192.168.2.10 - - [23/Jul/2023:07:13:31 -0230] "GET /api/stats HTTP/1.1" 200 3342 "-" "HomeAssistant/2023.6.2 aiohttp/3.8.4 Python/3.11" "-"
[36mfrigate |[0m 2023-07-23 07:13:40.210442889 192.168.2.10 - - [23/Jul/2023:07:13:40 -0230] "GET /api/stats HTTP/1.1" 200 3343 "-" "HomeAssistant/2023.6.2 aiohttp/3.8.4 Python/3.11" "-"
[36mfrigate |[0m 2023-07-23 07:13:46.383362714 [2023-07-23 07:13:46] watchdog.garage_inside INFO : FFmpeg did not exit. Force killing...
[36mfrigate |[0m 2023-07-23 07:13:46.887474731 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: Unable to read frames from ffmpeg process.
[36mfrigate |[0m 2023-07-23 07:13:46.888218849 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: Unable to read frames from ffmpeg process.
[36mfrigate |[0m 2023-07-23 07:13:46.888347821 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: Unable to read frames from ffmpeg process.
[36mfrigate |[0m 2023-07-23 07:13:46.888630578 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: Unable to read frames from ffmpeg process.
[36mfrigate |[0m 2023-07-23 07:13:46.888879954 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: Unable to read frames from ffmpeg process.
[36mfrigate |[0m 2023-07-23 07:13:46.890881259 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: Unable to read frames from ffmpeg process.
[36mfrigate |[0m 2023-07-23 07:13:46.891179450 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: Unable to read frames from ffmpeg process.
[36mfrigate |[0m 2023-07-23 07:13:46.891182169 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: Unable to read frames from ffmpeg process.
[36mfrigate |[0m 2023-07-23 07:13:46.891183755 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: Unable to read frames from ffmpeg process.
[36mfrigate |[0m 2023-07-23 07:13:46.891185350 [2023-07-23 07:13:46] frigate.video ERROR : garage_inside: ffmpeg process is not running. exiting capture thread...
[36mfrigate |[0m 2023-07-23 07:13:49.233436055 192.168.2.10 - - [23/Jul/2023:07:13:49 -0230] "GET /api/stats HTTP/1.1" 200 3342 "-" "HomeAssistant/2023.6.2 aiohttp/3.8.4 Python/3.11" "-"
[36mfrigate |[0m 2023-07-23 07:13:50.332904068 [2023-07-23 07:13:50] frigate.record WARNING : Failed to probe corrupt segment /tmp/cache/garage_inside-20230723071251.mp4: 0 - b'[mov,mp4,m4a,3gp,3g2,mj2 @ 0x562f202506c0] moov atom not found\n/tmp/cache/garage_inside-20230723071251.mp4: Invalid data found when processing input\n'
[36mfrigate |[0m 2023-07-23 07:13:50.333088954 [2023-07-23 07:13:50] frigate.record WARNING : Discarding a corrupt recording segment: /tmp/cache/garage_inside-20230723071251.mp4
[36mfrigate |[0m 2023-07-23 07:13:56.893369085 [2023-07-23 07:13:56] watchdog.garage_inside ERROR : Ffmpeg process crashed unexpectedly for garage_inside.
[36mfrigate |[0m 2023-07-23 07:13:56.894087959 [2023-07-23 07:13:56] watchdog.garage_inside ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
[36mfrigate |[0m 2023-07-23 07:13:56.894096245 [2023-07-23 07:13:56] ffmpeg.garage_inside.detect ERROR : [rtsp @ 0x5597bd31e100] RTP: PT=60: bad cseq d644 expected=0d95
[36mfrigate |[0m 2023-07-23 07:13:56.894101248 [2023-07-23 07:13:56] ffmpeg.garage_inside.detect ERROR : [h264 @ 0x5597bd38b100] Increasing reorder buffer to 1
[36mfrigate |[0m 2023-07-23 07:13:56.900519003 [2023-07-23 07:13:56] ffmpeg.garage_inside.detect ERROR : [out_1_0 @ 0x5597bd7d7600] 100 buffers queued in out_1_0, something may be wrong.
[36mfrigate |[0m 2023-07-23 07:13:56.900865772 [2023-07-23 07:13:56] ffmpeg.garage_inside.detect ERROR : [out_1_0 @ 0x5597bd7d7600] 1000 buffers queued in out_1_0, something may be wrong.
Right, definitely seems that the cameras are sending bad data. Although it looks like you are using a proxy for the cameras, what type of proxy is it?
go2rtc in a separate docker container on the bare metal debian machine.
What version of go2rtc is running?
1.5.0
Maybe try 1.6.2 and see if it is any better. Either way though, the memory usage is likely due to a difference in the kernel or drivers on the host, updating those may help (and has helped many other users that were experiencing similar)
Ok, thanks. I'll update the detect resolution, update the proxmox host, update go2rtc and go from there.
I seem to have resolved (or at least masked) this issue by setting a memory limit for the frigate docker container.
docker-compose.yml
services:
frigate:
deploy:
resources:
limits:
memory: 6G
Seems to be a memory management issue whenever a stream sends malformed data. Maybe the proxmox host and lxc can't decide who's supposed to be the oom-killer? Regardless, passing the responsibility on to Docker seems to do the trick.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the problem you are having
I'm trying to run Frigate in an LXC but I keep running into memory spike issues regardless of how much memory I assign the container.
Version
0.12.1-367d724
Frigate config file
Relevant log output
Frigate stats
Operating system
Proxmox
Install method
Docker Compose
Coral version
CPU (no coral)
Any other information that may be helpful
No response