diff --git a/cctv-scheduler.py b/cctv-scheduler.py index ddc497d..f5629fb 100644 --- a/cctv-scheduler.py +++ b/cctv-scheduler.py @@ -565,11 +565,18 @@ class FFmpeg: if que: while True: while not que.empty(): - local_logger.debug(msg=que.get()) + que_str = que.get() + local_logger.debug(msg=que_str) + + trigger = "Delay between the first packet and last packet in the muxing queue" + if re.match(".*" + trigger + ".*", que_str): + Proc.kill(pid) + local_logger.debug(msg='exit by watchdog, reason: ' + trigger) sleep(sec) if que.empty(): Proc.kill(pid) - local_logger.debug(msg='exit by watchdog') + trigger = "que is empty for " + str(sec) + " seconds" + local_logger.debug(msg='exit by watchdog, reason: ' + trigger) break exit()