Restrictions on Calling StartExport() After Executing MarkedDataCreate()

Hi,

Please advise regarding MIPSDK as described below.

We have two questions, and we have also included the results of our investigation so far for your review.

[Issue]

When configuring video for release, we apply an evidence lock (protection of the original video) before exporting the video data.

If VideoOS.Platform.Data.MKVExporter.StartExport() is called immediately after EvidenceLock.WcfProxy.ServerCommandServiceClient.MarkedDataCreate(), StartExport() results in an error.

[Temporary Workaround]

The issue no longer occurs when a wait period is inserted between MarkedDataCreate() and StartExport().

[Question 1: Specifications / Restrictions]

Is there any restriction that prevents StartExport() from being called immediately after MarkedDataCreate()?

For example, is it necessary to wait until the evidence lock protection process has completed asynchronously?

[Investigation and Remaining Questions]

To determine whether such a restriction exists, we investigated the return value of MarkedDataCreate().

We found that the return value (success/failure) of MarkedDataCreate() indicates whether the execution request itself succeeded or failed, rather than whether the protection process itself has completed.

We also confirmed that the API has a Status output parameter.

We implemented logic to monitor Status after executing MarkedDataCreate() and call StartExport() when Status indicates “success.” We tested this implementation and confirmed that it works correctly.

However, since Status changes to “success” almost immediately after the API is executed, we have not been able to confirm the following points:

Is this Status value updated when the protection process has actually completed?

Or does it return “success” immediately when the request is accepted, meaning that it cannot be used to determine whether the protection process has completed?

[Question 2: Correct Method for Determining When to Call StartExport()]

If there is a restriction that prevents StartExport() from being called immediately after MarkedDataCreate(), what should we monitor to correctly determine when the protection process has completed?

Are there any properties or events other than Status that should be checked?

We would also like to confirm whether Status changes when the protection process has completed.

[Environment]

XProtect version: XProtect Corporate 2025R2

MIP SDK version: MIP-SDK2025R2

OS: Windows 11 LTSC

Language / Framework: C# / .NET Framework 4.8

[Reproducibility]

Occurs every time.

Thanks,
Best Regards,
NVS TechnicalSupport

Is this an exception, or does StartExport() return false?

Please provide the exact error/exception and as many details as possible. If StartExport() returns false, please also include the values of LastError and LastErrorString.

I think this information is key to understanding what is happening and suggesting a solution or workaround.

To investigate your question, we changed the log level to Debug. After doing so, the issue no longer occurred even after approximately 30 repeated tests.

We also tested with the log level set to Info by checking Status, which is an output parameter of the API, before calling StartExport(). However, the test failed 7 out of 30 times, so we concluded that this method cannot be used to determine whether it is safe to call StartExport().

Furthermore, when we added a fixed 1-second wait before calling StartExport(), the issue did not occur during 30 repeated tests.

Based on these results, the issue appears to be timing-related. Would it be reasonable to consider adding a fixed wait before StartExport() to be an effective workaround?

If possible, we would appreciate your response by this weekend—specifically, by Friday, November 30, Japan Standard Time.

Your testing suggests that adding a delay avoids the issue, which gives us a useful workaround. To understand why the immediate StartExport() call fails, though, we need the error details.

Could you share the exception or error message, along with the stack trace if available, from the failed StartExport() call?

That information should help us investigate the underlying cause rather than relying on the delay alone.

Hi,

Thank you for your response.

I would like to ask a follow-up question.

If possible, we would appreciate your response by the end of November 4.

-–

We are conducting reproduction tests, but no error occurs when calling StartExport().

Our original inquiry was as follows, but it is possible that StartExport() itself was actually successful rather than returning an error.

>When EvidenceLock.WcfProxy.ServerCommandServiceClient.MarkedDataCreate() is called, followed immediately by

> VideoOS.Platform.Data.MKVExporter.StartExport(), StartExport() returns an error.

The issue we are experiencing is that the exported MP4 file fails to play properly.

In our latest test, the video stopped partway through in 7 out of 50 attempts. (The audio appears to continue playing.)

The formats are video: H.264 and audio: AAC (LC).

We have attached an MP4 file in which the video stops two seconds after playback starts.

The issue can also be reproduced in MediaPlayer. Could you please advise on how we can isolate the cause of this issue?

Thanks for the update. So StartExport() succeeds, and the problem is that the exported file sometimes freezes on video while the audio keeps playing.

To narrow it down:

  1. Does the same thing happen with another camera, or with a camera of another model or make? Or is it only this one test camera?
  2. Does changing a setting on the camera make the problem go away (for example GOP/keyframe interval, frame rate, resolution, bitrate, or turning audio off)?
  3. MKVExporter writes Matroska (.mkv). How do you get the MP4 file? If the .mkv file is only renamed to .mp4, the content is still MKV and some players may not handle it correctly. Please try playing the original .mkv file in a player that supports MKV.
  4. Does the problem still happen if you leave out MarkedDataCreate()? And does it happen if you export the same time range in Smart Client?

Please also share:

  • The camera make, model and firmware, and its video settings (codec, GOP/keyframe interval, frame rate, resolution).
  • The export start and end time compared with the time you call StartExport().
  • Whether the 1-second wait was in place during the 50 tests.

A small note: please don’t include reply deadlines in forum posts. Milestone Support monitors the forum and replies on a best-effort basis, and other forum users may also reply.