mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
add camera name to ffmpeg log messages
This commit is contained in:
parent
50bcad8b77
commit
38efbd63ea
@ -66,7 +66,7 @@ class CameraWatchdog(threading.Thread):
|
|||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
if self.camera.frame_time.value != 0.0 and (datetime.datetime.now().timestamp() - self.camera.frame_time.value) > 300:
|
if self.camera.frame_time.value != 0.0 and (datetime.datetime.now().timestamp() - self.camera.frame_time.value) > 300:
|
||||||
print("last frame is more than 5 minutes old, restarting camera capture...")
|
print(self.camera.name + ": last frame is more than 5 minutes old, restarting camera capture...")
|
||||||
self.camera.start_or_restart_capture()
|
self.camera.start_or_restart_capture()
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
@ -81,13 +81,13 @@ class CameraCapture(threading.Thread):
|
|||||||
frame_num = 0
|
frame_num = 0
|
||||||
while True:
|
while True:
|
||||||
if self.camera.ffmpeg_process.poll() != None:
|
if self.camera.ffmpeg_process.poll() != None:
|
||||||
print("ffmpeg process is not running. exiting capture thread...")
|
print(self.camera.name + ": ffmpeg process is not running. exiting capture thread...")
|
||||||
break
|
break
|
||||||
|
|
||||||
raw_image = self.camera.ffmpeg_process.stdout.read(self.camera.frame_size)
|
raw_image = self.camera.ffmpeg_process.stdout.read(self.camera.frame_size)
|
||||||
|
|
||||||
if len(raw_image) == 0:
|
if len(raw_image) == 0:
|
||||||
print("ffmpeg didnt return a frame. something is wrong. exiting capture thread...")
|
print(self.camera.name + ": ffmpeg didnt return a frame. something is wrong. exiting capture thread...")
|
||||||
break
|
break
|
||||||
|
|
||||||
frame_num += 1
|
frame_num += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user