Using the MIPSDK GPS Metadata Provider as an example, I’ve created a provider that produces a generic “sensor packet” as defined below. The sensor data gets recorded along with my video feeds.
I’ve also written a Smart Client plug-in that retrieves and displays the metadata during playback. I’m currently displaying the whole xml string but I would like to extract the two data items from the element.
Are there any MIPSDK examples that show how to parse/extract the metadata after retrieved from the recording server? I’m trying to use MIPSDK components whenever possible (instead of brute force hacking).
private readonly string _sensorPacketXml = @“<?xml version=""1.0"" encoding=""UTF-8""?>” + Environment.NewLine +
@“<tt:MetadataStream xmlns:tt=”“http://www.onvif.org/ver10/schema”“>” + Environment.NewLine +
@" tt:VideoAnalytics" + Environment.NewLine +
@" tt:Extension" + Environment.NewLine +
@" " + Environment.NewLine +
@" {0}" + Environment.NewLine +
@" {1}" + Environment.NewLine +
@" " + Environment.NewLine +
@" </tt:Extension>" + Environment.NewLine +
@" </tt:VideoAnalytics>" + Environment.NewLine +
@“</tt:MetadataStream>”;
One way of accessing the data is to use the MetadataSuppllier as demonstrated by the Location View sample: https://doc.developer.milestonesys.com/html/index.html?base=samples/locationview_sample.html&tree=tree_1.html
Using this method you will receive an event whenever where is metadata available - both in live and playback. On the event there is a Data property from which you can read the data in XML format. We unfortunately don’t have methods for interpreting the XML except for Navigational Data, but passing the XML should be fairly simple using standard .NET libraries.
Thank you Peter.
I was interested in the XML parsing. I didn’t want to do it myself if there was already helpers existing the SDK. You are correct; it is easy enough to do.
I’m already pulling the metadata from the recording server using the example provided in the Metadata Playback Viewer component example. I’ll be curious to see if this Metadata supplier would have made it easier.
Thanks again.
Peter,
Thank you for the information/suggestion. Sorry for my long delay in responding.
This method of access doesn’t give me every entry of recorded metadata. I stored a sequence number with each data record and in 1x playback it will often skip 3 or 4 records. Is there a way to get it to deliver every record?
I was quite excited to see this implementation. It is much easier than the example in MetadataPlaybackViewer. Hopefully there’s a way to get it to deliver everything.
Regards,
Ty
Hi Ty,
In playback mode the MetadataSupplier will follow the Smart Client playback frequency, which is approximately 50 updates a second. That means that there will be roughly 20 ms between each update and if you have more than one metadata package from the same source within that period some will be disregarded. Also if Smart Client has trouble performance-wise it might become even worse.
In addition to that the MetadataSupplier only has a queue of 3 updates internally, so if your processing takes more than 60 ms that could mean that some packages are skipped.
In general this is implemented in a way similar to the video in order to ensure that most relevant data is always shown. If you need to be sure to receive all packages you will unfortunately have to use the MetadataPlaybackSource instead, which gives you much more control, but which also requires quite a bit more work from your side in order to keep aligned with the Smart Client.