Page 1 of 1

Buffer problem

Posted: Tue Feb 11, 2020 12:48 pm
by sTYZ
I have a system with:
- Dual quad core xeons
- 32 gigs of ram
- 4 SAS drives in raid 0
- 4 Gigabit ethernet ports
- Ubuntu 19.10

While running i get constant buffer warnings. My ram usage as per "free -m" is 8-11%. Any time i increase the buffer it just asks for a higher number. I have saving JPGs off. I just use x264 passthrough for ALL cameras. I have deleted all detection zones. I am also having an issue where i am getting smaller recorded chunks than the set amount (600s) but only on some cameras.

Anyone have any idea what causes this?

Re: Buffer problem

Posted: Tue Feb 11, 2020 2:42 pm
by iconnor
When you write out an mp4, the first frame has to be a full image, otherwise known as an i-frame or keyframe. So when doing passthrough, when not recording, we need to keep all the frames since the last keyframe so that when we start writing the mp4, we can start with that keyframe.

If your camera is set to not send keyframes very often, we end up having to store a LOT of frames.

That's what that message is about. Either configure your camera to send keyframes more often or use more buffers.

Re: Buffer problem

Posted: Tue Feb 11, 2020 8:52 pm
by ruffledrooster
I was getting this too for about 7 out of my 10 cameras and I had adjust the buffer sizes higher and then the messages subsided. Just a general question, did something fundamentally change in 1.34 to make ffmpeg more 'sensitive' to this? I don't recall ever getting these messages in 1.32. Just curious. Thanks.

Re: Buffer problem

Posted: Tue Feb 11, 2020 10:13 pm
by iconnor
I just added an error message telling about it. 1.32 was silently not including all frames.

Re: Buffer problem

Posted: Wed Feb 12, 2020 3:56 pm
by sTYZ
OK i have the problem mostly sorted.

I couldn't change the keyframe interval on my cameras and when i increased the buffer i ran out of tempfs space on /dev/shm .

I added to fstab: none /dev/shm tmpfs defaults,size=24G 0 0

This gave me an extra 8GB of memory to use on the tempfs which made my total buffer use 96%. All of the warning errors have gone away. Is there a reason that this doesn't auto increase or have a setting in the control panel?