From 5fe201da25a1e3b40b1e94a63129ebb3432e56f9 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sun, 13 Sep 2020 10:15:08 -0500 Subject: [PATCH] avoid processing broken frames --- frigate/video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/video.py b/frigate/video.py index df88b71f9..69c2bc6b3 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -132,8 +132,8 @@ def capture_frames(ffmpeg_process, camera_name, frame_shape, frame_manager: Fram frame_bytes = ffmpeg_process.stdout.read(frame_size) current_frame.value = datetime.datetime.now().timestamp() - if len(frame_bytes) == 0: - print(f"{camera_name}: ffmpeg didnt return a frame. something is wrong.") + if len(frame_bytes) < frame_size: + print(f"{camera_name}: ffmpeg sent a broken frame. something is wrong.") if ffmpeg_process.poll() != None: print(f"{camera_name}: ffmpeg process is not running. exiting capture thread...")