diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 27737f66e..babde5e0e 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -710,9 +710,15 @@ int FfmpegCamera::CaptureAndRecord( Image &image, timeval recording, char* event return -1; } + if ( packet.pts < -100000 ) { + // Ignore packets that have crazy negative pts. They aren't supposed to happen. + Warning("Ignore packet because pts is massively negative"); + dumpPacket(&packet,"Ignored packet"); + continue; + } int keyframe = packet.flags & AV_PKT_FLAG_KEY; bytes += packet.size; - dumpPacket(&packet); + dumpPacket(&packet,"Captured Packet"); //Video recording if ( recording.tv_sec ) {