forked from Github/frigate
Replace green screen with error message and force camera_fps to 0 (#4544)
* Move to images specific folder * Send error image when camera stream is not available * Immediately set camera_fps to 0 if camera crashes * Cache error image so it is not read from file system on each run * Move camera fps set
This commit is contained in:
@@ -242,6 +242,7 @@ class CameraWatchdog(threading.Thread):
|
||||
now = datetime.datetime.now().timestamp()
|
||||
|
||||
if not self.capture_thread.is_alive():
|
||||
self.camera_fps.value = 0
|
||||
self.logger.error(
|
||||
f"Ffmpeg process crashed unexpectedly for {self.camera_name}."
|
||||
)
|
||||
@@ -251,6 +252,7 @@ class CameraWatchdog(threading.Thread):
|
||||
self.logpipe.dump()
|
||||
self.start_ffmpeg_detect()
|
||||
elif now - self.capture_thread.current_frame.value > 20:
|
||||
self.camera_fps.value = 0
|
||||
self.logger.info(
|
||||
f"No frames received from {self.camera_name} in 20 seconds. Exiting ffmpeg..."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user