Video and metadata are not sync in Playback

Hello,

We are developing a plugin which can show our analytics metadata. In live mode, we use BitmapLiveSource and MetadataLiveSource to receive video and metadata. While in playback mode, we use BitmapVideoSource and MetadataPlaybackSource to receive video and metadata in two working threads.

However, we find that in playback mode metadata could delay about 30 seconds to 1 minute compared to video. But in live mode there’s almost no delay between video and metadata.

I’ve checked the time sync between recording server and camera.

Do you have any suggestion about this? Thank you very much!

This would normally only occur if you playback at the current time (so more or less doing live playing in playback mode). If your playback is that close to current time we recommend using live sources instead.

This is unfortunately due to the design of the playback handling and cannot easily be fixed.

Hello Peter,

Thanks for your suggestion.

I cannot really catch the meaning of “If your playback is that close to current time we recommend using live sources instead.” Because in playback mode, only BitmapVideoSource and MetadataPlaybackSource (MetadataSupplier as well) can get video or metadata in corresponding time point. Do you mean that we need to use both playback and live source in the playback mode?

Thank you!

Sorry for not being clear on this. What I meant is that if you want to do playback very close to current time you will have to use the e.g. MetadataLiveSource in order not to run into this problem.

Thanks for your explanation, I could understand your idea about the playback near current time now.

But the out-of-sync isn’t only happened near current time. What we observed is that the metadata is always delayed in in whole timeline, therefore we don’t have chance to get right metadata of corresponding video frame in any timepoint…

Hmm okay, that makes little sense. Have you checked that the time stamps of the metadata are actually correct (including time zone)? You can try have a look using the Metadata Playback Viewer sample: https://doc.developer.milestonesys.com/html/index.html?base=samples/metadataplaybackviewer.html&tree=tree_2.html

In live mode the metadata will be shown as quick as it comes - ignoring time stamps - so if the time stamp is for some reason out of sync with the server this could occur.

Hi Peter,

Sorry for my late reply and thanks for your suggestion. I found that Milestone server will directly adopt the timestamp in metadata content.

For example, if the metadata XML is as following,

<?xml version="1.0" encoding="utf-8"?>

<tt:MetadataStream xmlns:tt=“http://www.onvif.org/ver10/schema”>

tt:VideoAnalytics

<tt:Frame UtcTime=“2020-03-18 03:10:21Z” />

,then the 2020-03-18 03:10:21Z (which is based on camera time system) will be directly used by Milestone.

On the other hand, timestamp of video is retrieved with respect to server’s time when video is received.

Therefore, keeping both camera and server’s time to sync frequently can resolve the out-of-sync.

Thank you