mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
reduce contention on frame_queue
don't check if the queue is full, just attempt to add the frame in a non-blocking manner, and then if it fails, skip it
This commit is contained in:
parent
9e531b0b5b
commit
ca99d94725
@ -195,17 +195,15 @@ def capture_frames(
|
|||||||
|
|
||||||
frame_rate.update()
|
frame_rate.update()
|
||||||
|
|
||||||
# if the queue is full, skip this frame
|
try:
|
||||||
if frame_queue.full():
|
# add to the queue
|
||||||
|
frame_queue.put(current_frame.value, False)
|
||||||
|
# close the frame
|
||||||
|
frame_manager.close(frame_name)
|
||||||
|
except queue.Full:
|
||||||
|
# if the queue is full, skip this frame
|
||||||
skipped_eps.update()
|
skipped_eps.update()
|
||||||
frame_manager.delete(frame_name)
|
frame_manager.delete(frame_name)
|
||||||
continue
|
|
||||||
|
|
||||||
# close the frame
|
|
||||||
frame_manager.close(frame_name)
|
|
||||||
|
|
||||||
# add to the queue
|
|
||||||
frame_queue.put(current_frame.value)
|
|
||||||
|
|
||||||
|
|
||||||
class CameraWatchdog(threading.Thread):
|
class CameraWatchdog(threading.Thread):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user