When a LPR plate recognition event happens I would like to get the snapshot from that plate with the SDK.
I use the Eventheader.timestamp value for getting a snapshot with jpegSource.GetAtOrBefore.
But the returned snapshots are never the same as you can see in Smartclient when requesting the plate.
What can I do to get a decent snapshot from the plate, using the SDK?
An LPR solution might save a snapshot, see
VideoOS.Platform.Data.AnalyticsEvent Class Reference
SnapshotList VideoOS.Platform.Data.AnalyticsEvent.SnapshotList [get, set]
Note however that the recommendation is that an LPR solution does not do this. So I guess you could see if there is a snapshot, and if there is it would be the best..
If there is no snapshot: You should get the correct image using the method you outline. So let me ask you how far “off” is the picture you get? If you take the “next” image is it the right one?
(Are you using Milestone XProtect LPR, or another LPR solution?)
Hello Bo,
My apologies for the late response.
The snapshots are a few frames off, milliseconds in time.
The eventheader.timestamp provides the time of the event in hh:mm:ss, but no milliseconds. Is this correct?
I think that this is my problem, the GetAtOrBefore or GetNearest need milliseconds to get a accurate frame.
I believe the time stamps should be accurate, I have some questions.. What version is the MIP SDK? Which version is the XProtect VMS? .. the Milestone LPR? Is this a standalone application or Smart Client plugin?
How do you get the event and eventheader? (NewEventIndication or AlarmClient or xx?) (Perhaps you can show me a snippet of the code you use.)
MIP SDK is 2016, VMS is Professional 2016 R2, LPR is 2016 R2.
It’s a standalone application.
I subscribe to NewEventIndication and when the type is LPR event I extract the needed info (license, timestamp, country, accuracy) for further processing.
A snippet is not possible at the moment, my developement computer is at my home and i’m at the office at the moment.
My test setup is all 2017 R1. I get milliseconds..
My guess is that this is not changed in the versions between yours and mine so please double-check your code. Let us see it if you do not detect something that explains it.
Hi Patrick. I believe the source of your issue might not be an inaccurate timestamp, but rather due to the image not yet having been recorded.
I assume that you’re retrieving the snapshot immediately when you get the NewEventIndication message. When you use GetAtOrBefore on your JPEGVideoSource to get the snapshot, you’re accessing recorded data - however there will always be a slight delay before video data is written to the database.
As an experiment, you could try waiting a few seconds before retrieving the snapshot and see if that helps.
If you really need the snapshot in real-time, you would probably need to use a live stream.
Hi Ture, thank you for your answer.
If it is seconds then it will not be a problem, after a NewEventIndication the program first checks the licenseplate with a national database. When the license returns a flag I then request a snapshot. Mostly this results in a 2 to 3 seconds delay.
I’ve checked the code and saw that I missed the milliseconds
A test is running as we speak.
Hi Patrick,
I’m interested in your MIP.
Is it OK to shared it with me?
Thank you.
Hi Ture,
Still no correct images… If I directly send the Timestamp value to the GetAtOrBefore, do the milliseconds include? Or do I need to construct a new DateTime object that contains date and hour:minute:second.millisecond?
Hi Eli,
Wich part are interested in?
Hi Patrick,
Thank you for your help.
Programming right now is above me 
I am looking for a solution that will allow me to send the latest license plate data through WebService\Text over IP or anyway.
Very appreciate your help.
Hi Eli,
A bit of programming would come in handy 
The LPR is part of a bigger solution for a industrial site (LPR, alarm messaging, system monitoring)
The software I wrote sends a SOAP request when a LPR event occurs.
A good start would be the SDK helpfile, there are a lot of examples wich can be used for your solution
Hi Patrick - Sorry to hear that you’re still having trouble with this. It should work as you describe. Did you try to wait a little - just to be sure isn’t not an issue with the image not yet being recorded.
Also verify that the live and recording stream for the camera is the same - otherwise the exact same image might not be available.
Hi Ture,
The image is recorded, the problem is that the image provided by the function is 1 or 2 frames off.
If I compare the provided image with the image shown in Smart Client, it seems that I’m always a few milliseconds off (1 - 3 frames difference).
Sadly this is just enough to miss the license.
Hi Patrick,
Maybe your software can help me.
Can you share your project file with me?