frigate icon indicating copy to clipboard operation
frigate copied to clipboard

Add object tag data to mp4 chapters and or mp4 files as they are created

Open bagobones opened this issue 1 year ago • 2 comments

Describe what you are trying to accomplish and why in non technical terms Recordings are a more complete accounting of a period of time, recordings could act as a better long term archive if they where self describing with useful tags of what they contain.

Describe the solution you'd like Add MP4 chapter tags when an event starts so it is visible in players like VLC playing back a recording. Add MP4 tags to the mp4 files created so that they can be quickly searched for ones that contain object events outside of frigate and act as a stand along archive.

Tags would include Frigate time stamp in local or UTC formatted, object and zones so if the file is moved or copied the context of the time of the event is not lost.

Describe alternatives you've considered Just using Frigate as is.

Additional context As I currently understand it frigate only stores events / object time stamps in its own database? If the DB is corrupt lost or you move a recording or change storage paths the link is essentially lost.

When providing a clip or set of clips to law enforcement having internalized time stamps and object annotations would be helpful in the standard video files. For long term arching being able to use tools to search ONLY for files with tags in them and move those to cold storage would be very nice.

A number of NVR solutions offer options to lock retain files or move old files to long term storage.

Adding these tags might allow additional external tools to also be developed to act on archived files etc.

bagobones avatar Sep 15 '22 20:09 bagobones

Just a few things to add:

As I currently understand it frigate only stores events / object time stamps in its own database? If the DB is corrupt lost or you move a recording or change storage paths the link is essentially lost.

Not sure on the meaning of "only" but the recordings are split into 10 second segmenta and frigate already has info on each segment as far as if it contains motion // objects. We're planning on revamping the recordings view to use this information on playback so the user can see what happened.

We don't want to tie a segment to just one event as multiple events can happen on the same camera at the same time, but there's definitely metadata that can be included like you explained.

Potentially related: https://github.com/blakeblackshear/frigate/issues/2525

NickM-27 avatar Sep 15 '22 21:09 NickM-27

Not sure on the meaning of "only" but the recordings are split into 10 second segmenta and frigate already has info on each segment as far as if it contains motion // objects.

I mean that without frigate the mp4 files contain no object or event information. I am aware they are folder sorted by date and in 10 second segments. The idea behind adding object meta data to the files themselves via chapters / file metadata is to ensure that that info is not lost if the files / folders are orphaned from the frigate application / DB or so they could be archived / processed separately from frigate.

Another example would be in the future having an export function that would write one large file for a period of time by joining all the segments but including chapter markers would retain some of the useful detection data for a 3rd party.

bagobones avatar Sep 15 '22 22:09 bagobones

To follow up on this based on recent development it seems like having this in an archive or export function would be the best place as it has been repeatedly stated that the main segment files should not be read directly.

So changing this slightly to be add chapter markers when exporting clips so it is easier to review them outside of frigate and retain some of the useful object detection / events.

bagobones avatar Jul 02 '24 16:07 bagobones

that makes sense to me, also could be optional via the api / ui potentially

NickM-27 avatar Jul 02 '24 16:07 NickM-27

At the very lease I kind of see this as being you export a time range and the the EVENT/Alerts it crosses get turned into chapter marker STARTS..

bagobones avatar Jul 02 '24 16:07 bagobones