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() ) {