forked from blakeblackshear/frigate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding output process to handle downstream processing of frames
- Loading branch information
1 parent
fd51c7a
commit 7a6ffb1
Showing
3 changed files
with
58 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import queue | ||
from multiprocessing import shared_memory | ||
from frigate.util import SharedMemoryFrameManager | ||
|
||
|
||
def output_frames(config, video_output_queue, stop_event): | ||
frame_manager = SharedMemoryFrameManager() | ||
previous_frames = {} | ||
|
||
while True: | ||
try: | ||
( | ||
camera, | ||
frame_time, | ||
current_tracked_objects, | ||
motion_boxes, | ||
regions, | ||
) = video_output_queue.get(True, 10) | ||
except queue.Empty: | ||
continue | ||
|
||
frame_id = f"{camera}{frame_time}" | ||
|
||
frame = frame_manager.get(frame_id, config.cameras[camera].frame_shape_yuv) | ||
|
||
if camera in previous_frames: | ||
frame_manager.delete(previous_frames[camera]) | ||
|
||
previous_frames[camera] = frame_id |