I am sending analytic events while recording the live stream.
For example, sending an analytic event with few Polygons to draw squares around few cars in the stream at 1:00 pm.
2 hours later, I want to go back in the playback to 1:00 pm and see the recordings with 3 options:
-
with the overlay i sent back then.
-
clean video as received from the camera.
-
only 1 object from the object_list sent in the analytic event.
how should i do that?
i tried following this answer: https://developer.milestonesys.com/s/question/0D50O00005Hpdnm/make-analytic-events-overlay-appear-in-playback?t=1546258592182
I removed all the samples and added them 1 by 1 but none did what i wanted.
Data from analytics events will not be shown in the playback stream. You would either have to make your own plugin that reads the analytics events and then draws the overlay on the recorded video when appropriate.
The Analytics Overlay sample can provide some inspiration although it does not do entirely what you want: http://doc.developer.milestonesys.com/html/index.html?base=samples/analyticsoverlay_sample.html&tree=tree_1.html
The Analytics Overlay sample only work for real time.
It doesnot show how to handle past events.
I need to read the past analytic events from the Event Server?
How can i read the past analytic events?
The only method i found to receive the past analytic events is:
IAlarmClient .GetEventLines(1,10,filter)
(Taken from component alarmEventViewew sample)
But it is missing some of the event information, for example it only contains the analytic object value but not the same object Polygon data.
Can i reach the Event Server DB?
Is there an easy way to simply use something like: "select * from analytic_events where time=… "
Thank you
The Alarms and Events Viewer sample shows how to retrieve events: http://doc.developer.milestonesys.com/html/index.html?base=samples/alarmviewer_sample.html&tree=tree_2.html
The GetEventLines method retrieves the ‘header’ information for the events. To retrieve full information you need to call the GetEvent method instead.
There are no methods available for doing SQL requests.
Thanks, it really helped.
Is there a plugin sample for showing playbacks in the plugin tab?
Or something close that i can start from?
Let me make sure i understand what i need to do from here:
-
Build a plugin that show playbacks in the smart client (plugin defined workspace).
-
Call IAlarmClient.GetEvent to read past analytic events
-
Match the playback current time with the analytic events
-
Draw on the playback using the DrawOverlay
I got a feeling number 3 will be complicated.
You are right, except a couple of details:
- In step 2 you first need to call GetEventLines to get the list of events and then you call GetEvent to get the details about the relevant ones.
- If you don’t asign a PlaybackController to your ImageViewerControl it will use the default one in the Smart Client and matching current time will then happen automatically.
I didnot understand your 2 dot.
I opened SCindependentPlayback and i try to figure out what to do next.
Where should i insert the code that will draw the overlay?
I cant find in the code the current playback time.
In SCIndependentPlaybackViewItemWpfUserControl a playback controller is created by using ClientControl.Instance.GeneratePlaybackController() and this is assigned to PlaybackControllerFQID of the ImageViewer meaning that it will be following the time of that controller. If you don’t assign that it would instead follow the current time of the Smart Client (in Playback tab) automatically.