Issue with the export from SDK

Hi Support, I am exporting through SDK and we got in the lastErrorString variable the following message “No video in selected time period”, for the lastDetailedError and lastError variables the values is zero. The periods are 10-09-2025 10:56:47 and 10-09-2025 10:56:59, before we exported from Milestone client and it was sucessful.

Did you develop a plugin? Is it similar to the Smart Client Export plugin sample? If you test the Smart Client Export plugin sample unmodified, does it work for you?

https://doc.developer.milestonesys.com/mipsdk/index.html?base=samples%2FPluginSamples%2FSCExport%2FREADME.html&tree=tree_1.html

One idea; using datetime make sure you use either UTZ time or local time, if you use one but it is interpreted as the other you will get another time than expected.

We implemented in C# a console with some features. One of them is the Video Export. We are using some dll files. I have tested that you told me. In addition, I tried to export with a day before and the same result.

Your solution must be like the Export sample if it is a console and not a plugin running within the Smart Client. It is important for me to understand, but from what you tell I now assume it is a standalone implementation not a Smart Client plugin.

https://doc.developer.milestonesys.com/mipsdk/index.html?base=samples%2FComponentSamples%2FExportSample%2FREADME.html&tree=tree_2.html

https://github.com/milestonesys/mipsdk-samples-component

Please try the Export sample unmodified, does it work for you?

yes, it is standalone implementation. I am going to test it.

Hi @Bo Ellegård Andersen (Milestone Systems)​, we have done the following tests:

  • The export sample application is working for export.
  • Our standalone application has the following code. In the code, you can see that we tested 4 cameras with different start and end datetime. The result about these tests were unsatisfactory. You can see in the log the same message “No video in selected time period”

In other post I will send you the code snippet and logs.

The code snippet:

MilestoneGatewayServer.LogDebug(“Begin configuration about the Export: " + sinfo.CameraGuid + " - Nombre Archivo” + sinfo.FileName + " - Fecha Inicio: " + sinfo.StartDate + " - Fecha Fin: " + sinfo.EndDate);

   \_camerasearch = sinfo.FileName.Split('\_')\[0\];

   if (FindCamera())

   {

    MilestoneGatewayServer.LogDebug("Camera found for Snippet: " + \_cameraItem);

   }

   List<Item> camera = new List<Item>();

   camera.Add(\_cameraItem);

   AVIExporter aviExporter = new AVIExporter

   {

    Filename = sinfo.FileName,

    Codec = "Microsoft Video 1",

    AudioSampleRate = 8000

   };

   \_exporter = aviExporter;

   var audioSources = new Item\[0\];

   string fullPath = Path.Combine(this.folderName, MakeStringPathValid(sinfo.FileName));

   \_exporter.Init();

   \_exporter.Path = fullPath;

   \_exporter.CameraList.Add(\_cameraItem);

   \_exporter.AudioList.AddRange(audioSources);

   MilestoneGatewayServer.LogDebug("End configuration about the Export: " + \_cameraItem + " Nombre: " + this.folderName + " - FullPath: " + fullPath);

   tempList.Add(sinfo);

   this.cameraGuid = sinfo.CameraGuid;

   this.fileName = sinfo.FileName;

   try{

    \_exporter1 = aviExporter;

    \_exporter2 = aviExporter;

    \_exporter3 = aviExporter;

    int lastDetailedError = 100;

    int lastError = 101;

    String lastErrorString = "";

    MilestoneGatewayServer.LogDebug("Export for the camera: " + \_cameraItem);

    bool export = false;

    if (this.fileName.Contains("CD-CCTV-B401")) {

     MilestoneGatewayServer.LogDebug("Begin Exporting Normal..." + this.startDate.ToString() + " " + this.endDate.ToString() + " - Hora local o hora UTC: " + this.startDate.Kind);

     export = \_exporter.StartExport(this.startDate, this.endDate);

     lastDetailedError = \_exporter.LastDetailedError;

     lastError = \_exporter.LastError;

     lastErrorString = \_exporter.LastErrorString;

     MilestoneGatewayServer.LogDebug("Result Export ...lastDetailedError: " + lastDetailedError);

     MilestoneGatewayServer.LogDebug("Result Export ...lastError: " + lastError);

     MilestoneGatewayServer.LogDebug("Result Export ...lastErrorString: " + lastErrorString);

     MilestoneGatewayServer.LogDebug("End Exporting ..." + export);

    }

    bool export1 = false;

    if (this.fileName.Contains("CD-CCTV-B402"))        {

     MilestoneGatewayServer.LogDebug("Begin Exporting Normal..." + sinfo.StartDate.ToString() + " " + sinfo.EndDate.ToString() + " - Hora local o hora UTC: " + sinfo.StartDate.Kind);

     export1 = \_exporter1.StartExport(sinfo.StartDate, sinfo.EndDate);

     lastDetailedError = \_exporter.LastDetailedError;

     lastError = \_exporter.LastError;

     lastErrorString = \_exporter.LastErrorString;

     MilestoneGatewayServer.LogDebug("Result export1 ...lastDetailedError: " + lastDetailedError);

     MilestoneGatewayServer.LogDebug("Result export1 ...lastError: " + lastError);

     MilestoneGatewayServer.LogDebug("Result export1 ...lastErrorString: " + lastErrorString);

     MilestoneGatewayServer.LogDebug("End Exporting1 ..." + export1);

    }

    bool export2 = false;

    if (this.fileName.Contains("CD-CCTV-B501"))

    {

     MilestoneGatewayServer.LogDebug("Begin Exporting CD-CCTV-B501..." + this.startDate.ToUniversalTime() + " " + this.endDate.ToUniversalTime() + " - Hora local o hora UTC: " + this.startDate.ToUniversalTime().Kind);

     export2 = \_exporter2.StartExport(this.startDate.ToUniversalTime(), this.endDate.ToUniversalTime());

     lastDetailedError = \_exporter.LastDetailedError;

     lastError = \_exporter.LastError;

     lastErrorString = \_exporter.LastErrorString;

     MilestoneGatewayServer.LogDebug("Result export2 ...lastDetailedError: " + lastDetailedError);

     MilestoneGatewayServer.LogDebug("Result export2 ...lastError: " + lastError);

     MilestoneGatewayServer.LogDebug("Result export2 ...lastErrorString: " + lastErrorString);

     MilestoneGatewayServer.LogDebug("End Exporting2 ..." + export2);

    }

    bool export3 = false;

    if (this.fileName.Contains("CD-CCTV-B502"))        {

     MilestoneGatewayServer.LogDebug("Begin Exporting CD-CCTV-B501..." + this.startDate.ToLocalTime() + " " + this.endDate.ToLocalTime() + " - Hora local o hora UTC: " + this.startDate.ToLocalTime().Kind);

     export3 = \_exporter3.StartExport(this.startDate.ToLocalTime(), this.endDate.ToLocalTime());

     lastDetailedError = \_exporter.LastDetailedError;

     lastError = \_exporter.LastError;

     lastErrorString = \_exporter.LastErrorString;

     MilestoneGatewayServer.LogDebug("Result export3 ...lastDetailedError: " + lastDetailedError);

     MilestoneGatewayServer.LogDebug("Result export3 ...lastError: " + lastError);

     MilestoneGatewayServer.LogDebug("Result export3 ...lastErrorString: " + lastErrorString);

     MilestoneGatewayServer.LogDebug("End Exporting3 ..." + export3);

    }

   }

   catch (Exception ex)       {

    MilestoneGatewayServer.LogDebug("EXCEPTION EXPORT02: " + ex.Message);

   }

   MilestoneGatewayServer.LogDebug("Requested VideoSnippet for Camera=" + sinfo.CameraGuid + " FileName=" + sinfo.FileName);

  }

The Log retrieve:

For the first camera>

2025-09-25 11:24:56,209 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Begin configuration about the Export: 34b207f3-5738-4b22-8fac-66c28c107e87 - Nombre ArchivoCD-CCTV-B401_20250925T1124 - Fecha Inicio: 25-09-2025 4:13:24 - Fecha Fin: 25-09-2025 4:13:34

2025-09-25 11:24:56,954 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Camera with matching: CD-CCTV-B401

2025-09-25 11:24:56,955 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Camera found for Snippet: CD-CCTV-B401

2025-09-25 11:24:56,968 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - End configuration about the Export: CD-CCTV-B401 Nombre: [c:\Milestone\SnippetFiles](file:c:/Milestone/SnippetFiles) - FullPath: [c:\Milestone\SnippetFiles\CD-CCTV-B401_20250925T1124](file:c:/Milestone/SnippetFiles/CD-CCTV-B401_20250925T1124)

2025-09-25 11:24:56,968 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Export for the camera: CD-CCTV-B401

2025-09-25 11:24:56,969 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Begin Exporting Normal…25-09-2025 4:13:24 25-09-2025 4:13:34 - Hora local o hora UTC: Local

2025-09-25 11:24:57,153 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result Export …lastDetailedError: 0

2025-09-25 11:24:57,154 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result Export …lastError: 0

2025-09-25 11:24:57,156 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result Export …lastErrorString: No video in selected time period

2025-09-25 11:24:57,156 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - End Exporting …False

2025-09-25 11:24:57,156 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Requested VideoSnippet for Camera=34b207f3-5738-4b22-8fac-66c28c107e87 FileName=CD-CCTV-B401_20250925T1124

2025-09-25 11:24:57,157 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - End Process Export

for the second camera>

2025-09-25 11:25:33,313 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - Begin configuration about the Export: 149e6fab-4621-4a85-9aef-52a813b498fd - Nombre ArchivoCD-CCTV-B402_20250925T1125 - Fecha Inicio: 25-09-2025 4:14:07 - Fecha Fin: 25-09-2025 4:14:17

2025-09-25 11:25:33,376 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - Camera with matching: CD-CCTV-B402

2025-09-25 11:25:33,376 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - Camera found for Snippet: CD-CCTV-B402

2025-09-25 11:25:33,377 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - End configuration about the Export: CD-CCTV-B402 Nombre: [c:\Milestone\SnippetFiles](file:c:/Milestone/SnippetFiles) - FullPath: [c:\Milestone\SnippetFiles\CD-CCTV-B402_20250925T1125](file:c:/Milestone/SnippetFiles/CD-CCTV-B402_20250925T1125)

2025-09-25 11:25:33,377 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - Export for the camera: CD-CCTV-B402

2025-09-25 11:25:33,378 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - Begin Exporting Normal…25-09-2025 4:14:07 25-09-2025 4:14:17 - Hora local o hora UTC: Local

2025-09-25 11:25:33,457 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result export1 …lastDetailedError: 0

2025-09-25 11:25:33,457 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result export1 …lastError: 0

2025-09-25 11:25:33,459 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result export1 …lastErrorString: No video in selected time period

2025-09-25 11:25:33,459 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - End Exporting1 …False

2025-09-25 11:25:33,460 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - Requested VideoSnippet for Camera=149e6fab-4621-4a85-9aef-52a813b498fd FileName=CD-CCTV-B402_20250925T1125

2025-09-25 11:25:33,460 DEBUG [15] GatewayMilestone.MilestoneGatewayServer.LogDebug - End Process Export

for the third camera>

2025-09-25 11:26:07,524 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - Begin configuration about the Export: c433f6cc-140a-4b5a-8500-8650bac285a7 - Nombre ArchivoCD-CCTV-B501_20250925T1126 - Fecha Inicio: 25-09-2025 4:14:42 - Fecha Fin: 25-09-2025 4:14:52

2025-09-25 11:26:07,612 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - Camera with matching: CD-CCTV-B501

2025-09-25 11:26:07,613 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - Camera found for Snippet: CD-CCTV-B501

2025-09-25 11:26:07,613 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - End configuration about the Export: CD-CCTV-B501 Nombre: [c:\Milestone\SnippetFiles](file:c:/Milestone/SnippetFiles) - FullPath: [c:\Milestone\SnippetFiles\CD-CCTV-B501_20250925T1126](file:c:/Milestone/SnippetFiles/CD-CCTV-B501_20250925T1126)

2025-09-25 11:26:07,613 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - Export for the camera: CD-CCTV-B501

2025-09-25 11:26:07,614 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - Begin Exporting CD-CCTV-B501…25-09-2025 7:14:42 25-09-2025 7:14:52 - Hora local o hora UTC: Utc

2025-09-25 11:26:07,711 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result export2 …lastDetailedError: 0

2025-09-25 11:26:07,711 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result export2 …lastError: 0

2025-09-25 11:26:07,713 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result export2 …lastErrorString: No video in selected time period

2025-09-25 11:26:07,713 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - End Exporting2 …False

2025-09-25 11:26:07,714 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - Requested VideoSnippet for Camera=c433f6cc-140a-4b5a-8500-8650bac285a7 FileName=CD-CCTV-B501_20250925T1126

2025-09-25 11:26:07,714 DEBUG [13] GatewayMilestone.MilestoneGatewayServer.LogDebug - End Process Export

For the fourth

2025-09-25 11:26:43,965 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Begin configuration about the Export: 1b8ad643-21ea-4085-9d4b-eb92eacfa387 - Nombre ArchivoCD-CCTV-B502_20250925T1126 - Fecha Inicio: 25-09-2025 4:15:16 - Fecha Fin: 25-09-2025 4:15:26

2025-09-25 11:26:44,026 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Camera with matching: CD-CCTV-B502

2025-09-25 11:26:44,027 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Camera found for Snippet: CD-CCTV-B502

2025-09-25 11:26:44,030 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - End configuration about the Export: CD-CCTV-B502 Nombre: [c:\Milestone\SnippetFiles](file:c:/Milestone/SnippetFiles) - FullPath: [c:\Milestone\SnippetFiles\CD-CCTV-B502_20250925T1126](file:c:/Milestone/SnippetFiles/CD-CCTV-B502_20250925T1126)

2025-09-25 11:26:44,030 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Export for the camera: CD-CCTV-B502

2025-09-25 11:26:44,030 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Begin Exporting CD-CCTV-B501…25-09-2025 4:15:16 25-09-2025 4:15:26 - Hora local o hora UTC: Local

2025-09-25 11:26:44,124 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result export3 …lastDetailedError: 0

2025-09-25 11:26:44,124 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result export3 …lastError: 0

2025-09-25 11:26:44,126 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Result export3 …lastErrorString: No video in selected time period

2025-09-25 11:26:44,126 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - End Exporting3 …False

2025-09-25 11:26:44,127 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - Requested VideoSnippet for Camera=1b8ad643-21ea-4085-9d4b-eb92eacfa387 FileName=CD-CCTV-B502_20250925T1126

2025-09-25 11:26:44,127 DEBUG [12] GatewayMilestone.MilestoneGatewayServer.LogDebug - End Process Export

Let me know if you need more information.

note: The export sample application and the standalone application were executed on the same machine.

In addition, Our standalone application has the same code than the export sample application. In the following code:

if (this.fileName.Contains(“CD-CCTV-B501”))

the export sample application used the ToUniversalTime and for this condition our application used the same.

Hi @Bo Ellegård Andersen (Milestone Systems)​ please, help us with the issue. Thanks.

You can only do one export at a time. In the Smart Client the exports are done in a sequential way, you need to make sure you so the same in your application.

Hi @Bo Ellegård Andersen (Milestone Systems)​, yes, it is one export at a time. I only implement some cases for the different datetime. Please, the focus of the issues is “No video in selected time period”.

In addition, to this code only arrives one camera. Therefore, always the process will be one at the time. Please, help us about that.

Hi @Bo Ellegård Andersen (Milestone Systems)​ . In our standalone application, we have tested 4 cameras in sequential way (no the same time because always the flow has one camera, i need to execute again with another camera) and each case has differente datetime (localtime and UTC). However each test always got the same result “No video in selected time period”. Also I saw that the standalone application has a old version about VideoOs.Platform.SDK.Export.dll file than the export sample application. Do you think that I should test with the dll file of the export sample application??. Let me know it please.

the old version is 20.2.2185.1 and the export sample application version is 25.2.17261.1.

My advise is that you should always build using the newest NuGets just like the sample does. Please try to take the sample as starting point and then lets it export 4 times after each other.

Finally we have arrived to the port. We have updted to the newest references and it is working right now. Thanks so much @Bo Ellegård Andersen (Milestone Systems)​