Overlapping Clip recordings (when multiple simultaneous events occur)
See original GitHub issueDuring object detection, multiple objects can be tracked simultaneously. Each of these objects generates a unique event ID. Each of these unique event ID’s also generates its own clip independent of each other.
So, if you have 3 people walking past a camera you get three nearly identical clips (slight offsets due to when it began tracking each person). Or if the tracking loses a person and re-acquires them as a new event ID… you get multiple overlapping clips. These can compound until you have a plethora of overlapping clips being recorded and saved of the same time frame.
Just for example - I had 3 people in a room for 11 minutes. Frigate registered at one point 16 people (this is probably more to do with the configuration on my part - it lost and re-acquired them multiple times) and generated 111 clips.
Making it so that if a clip is already being generated another is not started, but instead, the clip continues until all objects are “gone” would be a great enhancement. This will be difficult though due to event ID to clip matching (many to one).
One idea (just to brainstorm as I expect this issue is more complex than I am explaining):
- Add a new property -
clip_ID
and assign it to each clip just asevent_ID
is for each object tracking event. - When an event starts check if a clip is already being recorded.
- If it is, copy the
clip_ID
to theevent_data
- if not, start a newclip_ID
and copy it to theevent_data
.
This would allow each event to be associated with the clip that contains it, and each clip could contain multiple events. I’m not sure if the database design would need to be updated or not (haven’t looked at it that closely). With the clips and events having different ID’s I expect a lot of updating would have to be done… but if the clip_ID
is in the event_data
maybe it won’t be horrible?
Okay, I’ll stop theorizing now… I’m happy to help with this if I can!
Cheers! DeadEnd
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top GitHub Comments
I implemented some duplicate removal logic in the event cleanup process that runs every 5 minutes. It groups events that started within 10 seconds of each other and removes everything but the longest one. Not perfect, but I think it covers a majority of the duplicates.
I’m assuming here that they don’t quite stop moving enough, but the next version will already work this way if they stop moving.
This could be interesting.