mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
send clip_ready mqtt to event topic
This commit is contained in:
parent
40bf7a0f41
commit
3b695040d1
@ -32,7 +32,7 @@ Message published for each changed event. The first message is published when th
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "update", // new, update, or end
|
||||
"type": "update", // new, update, end or clip_ready
|
||||
"before": {
|
||||
"id": "1607123955.475377-mxklsc",
|
||||
"camera": "front_door",
|
||||
|
@ -268,7 +268,7 @@ class EventProcessor(threading.Thread):
|
||||
has_snapshot=event_data["has_snapshot"],
|
||||
)
|
||||
del self.events_in_process[event_data["id"]]
|
||||
self.event_processed_queue.put((event_data["id"], camera))
|
||||
self.event_processed_queue.put((event_data["id"], camera, clip_created))
|
||||
|
||||
logger.info(f"Exiting event processor...")
|
||||
|
||||
|
@ -767,7 +767,17 @@ class TrackedObjectProcessor(threading.Thread):
|
||||
|
||||
# cleanup event finished queue
|
||||
while not self.event_processed_queue.empty():
|
||||
event_id, camera = self.event_processed_queue.get()
|
||||
event_id, camera, clip_created = self.event_processed_queue.get()
|
||||
if clip_created:
|
||||
obj = self.camera_states[camera].tracked_objects[event_id]
|
||||
message = {
|
||||
"before": obj.previous,
|
||||
"after": obj.to_dict(),
|
||||
"type": "clip_ready",
|
||||
}
|
||||
self.client.publish(
|
||||
f"{self.topic_prefix}/events", json.dumps(message), retain=False
|
||||
)
|
||||
self.camera_states[camera].finished(event_id)
|
||||
|
||||
logger.info(f"Exiting object processor...")
|
||||
|
Loading…
Reference in New Issue
Block a user