I’m trying to upgrade my version of dynamic view, so that it creates a snapshot of frame when alarm happens, and then display that snapshot in popup view. How would I do that, and where would I start? I tried looking true other plugins but I’m not sure which one would help me
I think a lot of the design of XProtect is about the idea of not doing snapshots but instead opening the image by navigating to the time. You could consider instead to open a view making sure you have the correct camera at the correct time.
The Smart Client Insert Camera sample shows how you can open a view with a image. You can use an image by base-64 encode the image and then setting a property, the sample shows and it is also described here.
https://github.com/milestonesys
To create the snapshot image you can use JpegVideoSource.
One sample where you can see it in use is the Camera Stream Resolution sample.
There is no sample that shows you how to do it exactly but combining the two mentioned I hope you get it working.
And how would I define exact date and time and pause it for the view if I were to go with that method?
The Alarm holds the camera id and the exact time. If in doubt how-to, please ask for info on that.
You can use messages to navigate to the time. The Smart Client View and Windows Tools plugin sample, Playback tab, can show you.
Perhaps, you need to have a view that navigate to the time independently, so you can have live and playback, then you could explore the Independent Playback plugin sample.
or
Let’s start with the first solution I implemented the snapshot one, but, jpegsource.getend gives me sometimes minutes old picture. How can I ensure that the snapshot is from the current time?. I tried get(datetime.now) but it returns null
Getting the image from now doesn’t work because the image has to be stored in the database before you can retrieve it with JpegVideoSource. Generally you cannot do the image from now using JpegVideoSource, the image has to be a bit in the past.
You could use JpegLiveSource to get the live image which would be now or most current.
Maybe you can use the time of the alarm, if this is a bit in the past at the time you use it it will work.
I guess a playback scenario and a live scenario is not the same in how you should handle this.
If you look at the Smart Client Alarm Manager, when you pick an alarm line the preview (upper right) opens a camera view and navigates to the alarm time and starts playing forward.
It depends on the camera footage being recorded, and this also have a small delay, that stems from the fact that images must be recorded, must be put on disk.
If jpegsource.getend gives something that is minutes old then I suspect that the camera is not being recorded at the time or is not streaming at the time. As a first I recommend to check the camera record rules.
It was recording rules, thank you very much I forgot to set it up