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:
Nicolas Mowen
2022-11-28 20:47:20 -07:00
committed by GitHub
parent aaedd24f37
commit 69560c8bde
6 changed files with 23 additions and 4 deletions

View File

@@ -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..."
)