diff --git a/frigate/video.py b/frigate/video.py index 5e31dc457..d3467c9e9 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -269,7 +269,20 @@ class CameraWatchdog(threading.Thread): self.logger.info("Waiting for ffmpeg to exit gracefully...") self.ffmpeg_detect_process.communicate(timeout=30) except sp.TimeoutExpired: - self.logger.info("FFmpeg didnt exit. Force killing...") + self.logger.info("FFmpeg did not exit. Force killing...") + self.ffmpeg_detect_process.kill() + self.ffmpeg_detect_process.communicate() + elif self.camera_fps.value >= (self.config.detect.fps + 10): + self.camera_fps.value = 0 + self.logger.info( + f"{self.camera_name} exceeded fps limit. Exiting ffmpeg..." + ) + self.ffmpeg_detect_process.terminate() + try: + self.logger.info("Waiting for ffmpeg to exit gracefully...") + self.ffmpeg_detect_process.communicate(timeout=30) + except sp.TimeoutExpired: + self.logger.info("FFmpeg did not exit. Force killing...") self.ffmpeg_detect_process.kill() self.ffmpeg_detect_process.communicate()