From 990c4b1b45618f211ae55e47eb53a5aef9adefce Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 15 Oct 2018 11:33:58 -0400 Subject: [PATCH] Add a warning when there are more videoframes in the packetqueue than image_buffers --- src/zm_ffmpeg_camera.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 146bd3856..66391862e 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -867,6 +867,10 @@ int FfmpegCamera::CaptureAndRecord( Image &image, timeval recording, char* event if ( packet.stream_index == mVideoStreamId ) { if ( keyframe ) { Debug(3, "Clearing queue"); + if ( packetqueue->packet_count(mVideoStreamId) >= monitor->GetImageBufferCount() ) { + Warning("ImageBufferCount is too small. Either increase it or decrease time between keyframes"); + } + packetqueue->clearQueue(monitor->GetPreEventCount(), mVideoStreamId); packetqueue->queuePacket(&packet); } else if ( packetqueue->size() ) {