mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-13 13:47:36 +02:00
bug fixes in saved samples code
This commit is contained in:
parent
e26baeb782
commit
3c069bacdc
@ -88,11 +88,14 @@ def main():
|
||||
while True:
|
||||
# max out at 5 FPS
|
||||
time.sleep(0.2)
|
||||
frame = cameras[camera_name].get_current_frame_with_objects()
|
||||
# encode the image into a jpg
|
||||
ret, jpg = cv2.imencode('.jpg', frame)
|
||||
yield (b'--frame\r\n'
|
||||
b'Content-Type: image/jpeg\r\n\r\n' + jpg.tobytes() + b'\r\n\r\n')
|
||||
try:
|
||||
frame = cameras[camera_name].get_current_frame_with_objects()
|
||||
# encode the image into a jpg
|
||||
ret, jpg = cv2.imencode('.jpg', frame)
|
||||
yield (b'--frame\r\n'
|
||||
b'Content-Type: image/jpeg\r\n\r\n' + jpg.tobytes() + b'\r\n\r\n')
|
||||
except Exception as e:
|
||||
print("Error while preparing the next image for http output: " + str(e))
|
||||
|
||||
app.run(host='0.0.0.0', port=WEB_PORT, debug=False)
|
||||
|
||||
|
@ -119,8 +119,8 @@ class PreppedQueueProcessor(threading.Thread):
|
||||
file_prefix = now.strftime("%Y%m%d-%H%M%S")
|
||||
if detected_objects:
|
||||
# default 2 seconds between saved detection samples
|
||||
save_det_interval = frame['save_samples'].get('detection_interval', 2)
|
||||
# print("Detection interval for saved samples : {}".format(save_det_interval))
|
||||
save_det_interval = frame['save_samples'].get('detections_interval', 2)
|
||||
# print("Interval for saved detection samples : {}".format(save_det_interval))
|
||||
# check if enough time has passed since the last saved detection sample
|
||||
if (now - self.last_saved_det_frame_time).total_seconds() >= save_det_interval:
|
||||
dir += "/detections/"
|
||||
@ -153,8 +153,8 @@ class PreppedQueueProcessor(threading.Thread):
|
||||
img.save(img_file_path, "JPEG")
|
||||
else:
|
||||
# default 300 seconds (5 min) between saved non detection samples
|
||||
save_non_det_interval = frame['save_samples'].get('detection_interval', 300)
|
||||
# print("Detection interval for non saved samples : {}".format(save_non_det_interval))
|
||||
save_non_det_interval = frame['save_samples'].get('non_detections_interval', 300)
|
||||
# print("Interval for saved non-detection samples : {}".format(save_non_det_interval))
|
||||
# check if enough time has passed since the last saved non-detection sample
|
||||
if (now - self.last_saved_non_det_frame_time).total_seconds() >= save_non_det_interval:
|
||||
dir += "/non_detections/"
|
||||
|
Loading…
Reference in New Issue
Block a user