Intermittent result with SDK export video sample

Hi Dev team,

My program requests a camera export in .avi format. The result is “No video in selected time period”.

I have also tested the same export request using Milestone’s SDK Export Sample with the same results. The only difference was I logged into the specific Milestone System were the camera was defined (The export sample does not log into a federated system).

The system is Milestone 2020 R3.

It is a Federated structure using hundreds of recording servers with over a thousand cameras.

The error response is from _exporter.LastError not from the try/catch exception “NoVideoInTimeSpanMIPException”.

Another camera video request from the same recording server is successful so it does not appear to be a port/firewall/etc issue.

There is video at the time requested.

The Milestone Client can export the video for the same camera at the same time request.

Please advise

Thanks

Paul

XProtect has an option, enabled by default, to hide registration holes, you can disable it with the Smart Client Options.

If you start an export that the start period is in a hole you get the error that presents itself to you.

To avoid the problem you have to ask the Recording Server for the recording sequences of the period you are interested in, moving the start of the exports to the beginning of the first available sequence.

To read the sequences use:

SequenceDataSource dataSource = new SequenceDataSource(camera);

List sequenceList = dataSource.GetData(…);

dataSource.Close();

Freddy

Hi Freddy, thanks for you reply but I don’t think that this is a registration hole issue as the same “exact” export works when using the Smart Client.

The failure mode only occurs when we use the SDK sample to export video from the same camera at the same start and stop times as used in the Smart Client Export.

I don’t have anymore information about the failure other than the “NoVideoInTimeSpanMIPException” message that is returned. There are no logs that we are aware of that provide additional information on why the SDK sample fails.

Is there anyway to get more log information from the SDK export sample? The above error message seems rather generic and not very useful.

Thanks

Paul

Hi Peter,

try to run StatusViewer example while exporting, it show various status information about RS and cameras

Freddy

Hi Freddy,

We ran the “StatusViewer” while exporting but it doesn’t return anything useful for this issue. I’ve attached a screenshot of the StatusViewer output during this testing. Are there any switches that can be turned on to enable return more verbose logging? Screenshot

Paul,

if you have recording holes and try to export starting from an hole in XProtect format Milestone skip such hole and export the footage, but if you use AVI or MKV format you got the error.

Have you tried to see recording sequences I write you on first answer?

If not I can send you a tool to see recording sequences but it use Italian language.

Freddy

Hi Freddy,

I’m not sure that we need a tool to see if there are any holes in the recorded video because we know that the Milestone Client export works fine for the exact same export that fails when we use the Milestone SDK export example. Both exports (Milestone Client and SDK sample) use the same camera at the same time exporting to the same format = AVI. The milestone client works and the SDK sample intermittently fails with no reason given.

The logs that I would like to see are any logs associated with the SDK sample export process. Without those logs I can only assume that the problem resides in the Milestone SDK sample.

Any suggestions on how to proceed are welcome as this issue is holding up out mutual customer from deploying.

Please advise

Thanks

Paul

Paul,

first release of my Export Application (https://www.milestonesys.com/marketplace/secursys-s.a.s/videomipexport/) is from 2018, I have sold several copies and I have had to face the same problem that my customers are experiencing several times. In these years I verified that this problem can depend on 2 things:

  • in most cases it depends on the recording holes, so a couple of years ago I added the control of the recording sequences to bypass the holes; it is not easy to verify this because XProtect skips them even when you export to AVI / MKV and not having such formats the timestamp it is difficult to understand if the beginning of footage is what you requested; try to stop recording during the night, restart it with light then export footage from the night, if you “see the light” I’m right
  • I also understood that the same error can occur when the Recording Server has problems and works badly, in this case sometimes my program receives the same error and other times the timeout error in the RS response; often it depends on the partially corrupted MediaDB, but not always

However, I must agree that the SDK behaves differently from the SC, the thing that all the customers told me was “why does it work with the SC?”; I had to work hard to convince them that the cause was the RS, even if the fact remains that manually the SC does the export.

So, take a look at the RS logs to see if there are any errors.

Freddy

As you state the Smart Client exports have proven more robust and effective compared to the MIP SDK exporter. Milestone was able to reproduce these observation in our test lab also.

Thank you for bringing this to our attention.

Milestone Development has now aligned the Smart Client and MIP SDK. The MIP SDK will use the same export code that the Smart Client uses.

The fixed MIP SDK is available here - https://developer.milestonesys.com/s/article/XProtect-2021-R1-cumulative-patch-installers

Important note.

The hotfixed MIP SDK mentioned above had a bug. If using this please downlaod a newer fix / patch from the same location.

Hi Bo,

First I want to thank you for looking into this. Your effort on this is MUCH appreciated!

I passed along your response to our developer on this project and she came back with a couple questions that she asked me to pass along.

See below:

I have a couple of questions in regard to the Milestone Sample Export Patch 2021 R1:

#1: Can you please explain how to import MilestoneSystems.VideoOS.Platform.SDK

I have added the independent reference libraries into C2P’s Export Program (VideoOS.Platform, VideoOS.Platform.SDK.Export, VideoOS.Platform.SDK.UI) but would like to understand how to access the reference above.

#2: I had to add the parameter “secureOnly” to VideoOS.Platform.SDK.Environment.AddServer(secureOnly,uriSite, _credentialCache);. I would like an explanation for secureOnly.

VideoOS.Platform.SDK.Environment.AddServer(secureOnly,uri, _credentialCache);

Thanks

Paul

#1

You need to reference the dlls directly and then copy files from the MIP SDK’s Bin folder. What to copy depends on what you are using. This should be the best explanation:

https://doc.developer.milestonesys.com/html/index.html?base=reference/architecture/net_library_initialization.html&tree=tree_2.html

If you have used the NuGet you will have to remove it and go back to referencing the dll’s (the way use before introduction of NuGet), unfortunately Milestone does not presently have fixes for the NuGet packages.

#2

SeureOnly is introduced in 2021R1 and best explained here (Changes to authentication)

https://doc.developer.milestonesys.com/html/index.html?base=reference/architecture/net_library_initialization.html&tree=tree_2.html

Hi Bo,

We have tested the upgraded SDK export and it appears to have fixed the issues that we were seeing but we have done a limited amount of testing it thus far because the solution is very slow when testing at the customer’s site.

The reason for the testing being slow is because the customer has a large multi-site federated deployment with over 60 remote servers that the export solution needs to log into in order to find the servers that are hosting the camera being exported.

Question: Is there a way to search for a camera object using only the Parent server in a federated system using a camera guid. Currently we are logging into all child servers collecting camera objects then searching through to find a camera (using the camera guid) match. This method is taking a very long time (over an hour) at the customer site for just one export request of 3 cameras.

Ideally there should be a list that we can query that contains all of the recording servers and the camera GUIDs that each server is hosting. If we can access that lists the cameras hosted at each site on this large 60+ sites federated system the export process for the customer would be exponentially faster.

Please advise if there is such a list that we can access as part of our custom export process.

Thanks

Paul

The way Milestone Federated Architecure (MFA) works is that the parent site holds the information how to contact the child sites. The parent side does not hold any configuration on items in the child servers.

While this scheme allows for maximum flexibility it does mean that getting an overview of all items in all connected sites is a larger operation as you need to login on each site.