MKV video export length is different than length reported on the UI

My Scenario

Milestone Corporate

1 camera 1920x1080 H264 recording continously

If i go to playback, then try to export a chunk of the video (to MKV) say from 10:00:00 to 10:05:00. SmartClient UI reports the right time period and duration of 5 minutes but the exported file is longer for example 5 minutes and 20 seconds or more. It usually starts some seconds before and ends some seconds after.

Does this behaviour has something to do with keyframes ? or the export file format ?

Already tried different time period but always find the same behaviour

Is there the possibility to export a MKV file with the correct length as specified in the UI ?

Thanks

As this is not related to software development with the MIP SDK, which is the focus of this forum, please ask again in the support community, you should get better help from the partners using the support community.

https://supportcommunity.milestonesys.com

Hi Rie, I add more details. We started using MIP SDK and MKVExporter. We fell back to the Smart Client to understand a bit more. So originally this is a SDK question. It was my fault not to add something more.

This is our simple code

DateTime start = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 16, 06, 30);
DateTime end = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 16, 07, 00);
VideoOS.Platform.Data.IExporter _exporter = new VideoOS.Platform.Data.MKVExporter() { Filename = "test.mkv" };
_exporter.Init();
_exporter.Path = @"c:\temp\export";
_exporter.CameraList = new List<VideoOS.Platform.Item>() { list.First() };
_exporter.StartExport(start, end);
_exporter.EndExport();

we tried to export:

  • 1 minute video from 16:05:00 to 16:06:00 and we got a MKV video of 1 min 39 sec ength
  • 2 minute video from 16:07:00 to 16:09:00 and we got a MKV video of 2 min 45 sec length
  • 3 minute video from 16:04:00 to 16:07:00 and we got a MKV video of 3 minute 45 sec length
  • 1 minute video from 16:01:00 to 16:02:00 and we got a MKV video of 1 minute 28 sec length

So why don’t we get the exact length of the range requested ? Is this related to keyframes ? For security reasons we need the video to be cut exactly where we want to.

MKV format file is a file which is not transcoded, rather you will get the file as same as camera provides.

If you export recordings as MKV format, you will get the recording file as it is, not transcoded. This means, you can not get less than the GOP.

For example, you want to get 11:00:00 am – 11:01:00 am video, but you would get 10:59:30 – 11:01:30. We assume that the time differences that you mentioned is the GOP.

If you try the same thing on Smart Client, you will get the same result as SDK.