MKVExporter in Xprotect client overwrites filename / path

Hi,

I been using the MKVExporter for a lot of things, to get this nice fast exports. Works great, but when using it in a Xprotect client plugin, it overwrites the _exporter.Path properties. I cant find documentation on this behavior. Also i cant seem to GET the properties of the export paht. Any advice?

i use it like this:

   MKVExporter \_exporter = null;

string cameraName = “name”;

   string \_path = @"[C:\\Video](file:C:/Video)";

       \_exporter = new MKVExporter { Filename = cameraName };

       \_exporter.Init();

       \_exporter.Path = \_path;

       \_exporter.CameraList.Add(videoSource); 

       \_exporter.StartExport((DateTime.Now.AddSeconds(-60)),DateTime.Now);

The path set on the MKVExporter instance should not be overwritten during export, so the behavior you’re seeing is not expected. I suggest checking the following:

  • Try to set _exporter.Path before calling _exporter.Init()
  • Verify that the directory you’re exporting to already exists and that the user running the export has write access to it
  • You can enable Smart Client logs to check for any export-related messages, which might help identify what’s going wrong. Instructions for enabling Smart Client logging can be found here: Enable XProtect Smart Client logging automatically and manually

Regarding your question about getting the properties of the export path: could you please clarify what exactly you mean by that? Are you trying to retrieve metadata about the export location, validate the path, or something else?

Ok i was thinking this would be a client plugin thing.

So maybe i should name versions:

The client is 2023 R3( build 61 )

Im using the latest sdk version.

And the rest of the vms is 22r3.

I am not 100% sure if all hotfixes are up to date but can check.

i moved the .init part but does not help ,

LOG:

2025-04-14 13:18:40.081+02:00 [ 23] INFO - Export job created.

2025-04-14 13:18:40.085+02:00 [ 46] INFO - ExportJob named ‘14-4-2025 13-18-40’ is started.

2025-04-14 13:18:40.675+02:00 [ 46] DEBUG - Telemetry Track Event: eventName:Export finished, properties:{[Reason, Completed]}, metrics:{}

2025-04-14 13:18:40.681+02:00 [ 46] INFO - Export job ‘14-4-2025 13-18-40’ ended.

2025-04-14 13:18:40.681+02:00 [ 46] INFO - ExportJob named ‘14-4-2025 13-18-40’ has ended.

i have set it to be : c;\Video\CameraName.mkv

But i get:

“[C:\Video\14-4-2025](file:C:/Video/14-4-2025) 13-18-40\Media player format\CameraName\14-4-2025 13_17_40 (UTC+02_00).mkv”

( to be clear, CameraName IS the real name of the camera )

If i cant get it to work, i would love to get the real path it stores the video back from the exporter. but i seen no way to do so.

Extra : i do see a progress bar in the client running, pretty cool , but also i dont want that :smiley: so i was thinking when using the mkvexporter in the client as a plug in some stuff will be overwriten by the client behavior.

I see. So, the path where the export is stored is correct, but it’s adding some additional parts in between.

The first part added 4-4-2025 13-18-40 comes from the ExportName property available on MKVExporter. You should be able to modify that to set it to whatever you prefer. The second part Media player format should remain constant for AVI exports.

As for retrieving the full export path, I don’t currently see a way to do that. If you’re still interested, I can look into it next week and get back to you.

Yea i do need a fix for this. But to be clear, when i use the same code, but in a stand-alone service it will export too the path i specify with the name i specify. I cant see any difference. Not avi btw its all .mkv .

So i either have to figure out the exact method to store it at the right spot, or get a callback / event / property with the filename including path when its done. I have a weird workaround for it now, so no real hurry, but future maintainers of this code will get angry at this workaround :smiley:

The Smart Client’s naming scheme for MKV export is fixed, you cannot change how it names the path.

i was thinking so much, is there a way to get the path/file name back any way whit the class? i dont really care about where it is stored, but would be nice to get the path in the software.

Unfortunately, the way it is implemented it cannot give you the full path. I will make a note so that this can be considered for future improvements to the SDK…

No worries Bo, i have this part covert, but now i have a followup:

The export progress bar in Xprotect client gets stuck on the client in production (of course it worked fin in test setup)

And i cant find a way to disable / hide it or even give it a notch. Any suggestions? Of course this is happening 3 days before turnover :')

Please create a new question on this forum. It is important for usability and searchability that we do new questions instead of discussing in the same thread (where the subject question in the beginning is something else).

Please include a screen capture. Please clarify, if the progress bar gets stuck because the export does not complete, or the export completes but the progress bar doesn’t. Include Smart Client version.