We are developing a Windows service that listens for Milestone alarms, and exports videos that start a few seconds before and ends a few seconds after the alarm timestamp.
It listens for alarms like this:
_msgObj1 = _messageCommunication.RegisterCommunicationFilter(NewAlarmMsgReciever, new CommunicationIdFilter(MessageId.Server.NewAlarmIndication), null, EndPointType.Server);
When an alarm is triggered, the thread sleeps for a few seconds so that the full video has time to be recorded, and then the export starts, using MKVExporter.
As soon as an alarm comes in, a log entry is created with the timestamp from the alarm’s EventHeader.Timestamp, and also with the time of the log entry itself. In most cases the two timestamps differ by less than a second as expected, but sometimes they differ by several seconds, minutes or over an hour. Often when this happens, the alarm is from after the log entry, ie. from the future, so obviously something is wrong.
When the time differs like this, one of two things can happen:
1. mkvExporter.StartExport fails with the following error: “NoVideoInTimeSpanMIPException: No video or audio in selected time period”
or
2. mkvExporter.StartExport succeeds but the export progress is stuck at 0% with mkvExporter.LastErrorString = “Unable to connect to toolkit!”
It gets stuck sometimes where all exports fail and the timestamp discrepancy gets larger and larger for every new alarm.
Any idea why this happens? I have not experienced this problem on my system, but it happens when our partner test it on their system. I’ll attach some Milestone logs that they sent, is there anything there that can explain this?