SampleExport app exports video clips shorter than the expected length

we are testing exporting video clips using the sample code SampleExport provided in SDK samples package. The issue is when trying to export relatively long clips (2+ hours) the exported mkv file turns out to be a bit shorter than the expected length. For instance, if we try to export a 2-hour clip using SampleExport, the length of the exported mkv file would be about 8 minutes shorter than the expected 2 hours.

any ideas why the exported mkv files are ended up being shorter than expected?

we managed to get wireshark capture of one situation where we saw that the app sends a FIN to the Milestone storage server, but the server keeps trying to send data, so the app finally sends RST to inform the server that the socket was closed and the resulting .mkv file ended up with 2:51:11 out of 3:00:00 of video.

any ideas why the app is closing the socket before the storage server is done sending data?

Is there any footage missing -not recorded? Perhaps you can investigate this using the Smart Client and please let me know if the export in the Smart Client yields the same result when using the export from within the Smart Client.

What product and version is your XProtect test server? Version of the MIP SDK?

Do you get any error exporting?

Is there an error if you examine the Recording servers ImageServer.log file for the time when export is performed? ([C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) Recording Server\Logs\ImageServer.log) (Assuming a c-code server.)

All data should be pulled from the server (not streaming or similar), and I do not have an explanation for you observations.