mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Restart ffmpeg if process exceeds detect fps by 10 (#5280)
* Restart ffmpeg if process exceeds detect fps by 10 * Update frigate/video.py Co-authored-by: Felipe Santos <felipecassiors@gmail.com> * spelling --------- Co-authored-by: Felipe Santos <felipecassiors@gmail.com>
This commit is contained in:
parent
116edce3dc
commit
88b903ba39
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user