Iterating through metadata recording

Hi,

we are working on an integration that is accessing the metadata recordings of a camera (in almost realtime). When we access the recording through the

VideoOS.Platform.Data.MetadataPlaybackSource interface

we start with the ‘GetAtOrBefore’ call to jump to a specific timestamp (this timestamp is very close to DateTime.Now (-10 seconds).

Once we’ve received the first data packet, we iterate trough the recording with ‘GetNext’.

So far so good, I would say - but we have issues with this approach simply not getting all recorded packets.

As a workaround we use the Get method instead of GetNext

Get (DateTime timestamp, TimeSpan maxTimeAfter, int maxCountAfter)

and get a list of all available packets.

Is there any explanation, why we would not get the full set of packets through GetNext? I would assume that it is related to maybe the packets are not fully recorded (written / indexed), when we try to access them. But the MIP SDK documentation is also not too extensive here.

Any hint / explanation would be highly appreciated.

Also maybe if there is a clear indication, when a sequence is properly stored - at the moment we use some ‘while’ implementations to find out if we are ready with the data that we’ve fetched. But maybe there is a more clever way of getting notified.

Thanks!

I wonder if the issue is that you are reading too close to now. There will be difficult timing if you read next before the data is fully committed. Perhaps the live interface is what you should use.

This sample uses Live.MetadataLiveSource instead. https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/metadataliveviewer/readme.html&tree=tree_2.html

Hello Bo,

thanks for the answer!

This is my suspicion as well - but using the live source not really an option. I just want to access the recordings on specific event triggers for large scale installations.

But I also need some seconds of metadata (and videodata) prior to the event. A hybrid model (live and reordings) might be possible though but more complex to implement.