Get the snapshot from a LPR Event

I’m trying to get the snapshot from a LPR event yet the SnapshotList property is null (triggers a NullReferenceException at this line). What am I doing wrong? (I’m using XProtect Essential+).

var lprEvent = alarmClient.GetEvent(line.Id) as VideoOS.Platform.Data.AnalyticsEvent;

var image = lprEvent.SnapshotList[0].Image;

Could you please forward us “simplified sample” code of what are you trying to achieve and steps to reproduce the error? This might help us to dig into the problem you are referring to.

var alarmClientManager = new AlarmClientManager();
var alarmClient = alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);
var eventFilter = new EventFilter() {
    Conditions = new Condition[] {
        new Condition() {
            Operator = Operator.Equals,
            Target = Target.Type,
            Value = "LPR Event"
        },
         new Condition() {
            Operator = Operator.GreaterThan,
            Target = Target.Timestamp,
            Value = lastEvent
        }
    }
};
var events = alarmClient.GetEventLines(0, 10, eventFilter);
foreach (var line in events) {
    var lprEvent = alarmClient.GetEvent(line.Id) as VideoOS.Platform.Data.AnalyticsEvent;
    var image = lprEvent.SnapshotList[0].Image;
    ...
}

Sure! Here it is. Basically, I’m listing events using the SDK interface and retrieving the snapshot list from each event.

Does anyone have a clue why this isn’t working?

As far as I dug into the forums, the LPR Server is responsible for filling the SnapshotList property. I’m using Milestone XProtect LPR and couldn’t find any settings I could enable this. Can anyone confirm if this is supposed to be like this or not?

Milestone XProtect LPR does not save snapshots. Instead it relies on the other information in the analytics event and uses the information about time and camera to retrieve recorded footage from the time.

Understood. Thank you!