Let Plugin Know Of Any Analytics Events Being Triggered On A Frame
AnsweredHi Anton Babinov, Hi Andrey Terentyev
I've implemented
pushUncompressedVideoFrame(const IUncompressedVideoFrame* videoFrame)
and I want to only get frames when a particular Analytics Event occurs on the camera.
So in the method something like:
if (hasAnalyticsEvent(videoFrame, 'Name, description etc of the event that can help filter type of event')) {
// Process frame
}
So basically I'm talking about adding event awareness to the DeviceAgent.
How can I implement hasAnalyticsEvent?
For context, we don't want to consider all frames for processing or even, in many cases, not just motion events. My idea is to have an event-based filter. The user will be able to enter a string, for example, in a text field on the DeviceAgent or Engine settings. The value of that text field could be the name, description, caption etc of an event...and using this we'll filter out frames.
I think it'll be something similar to this answer:
https://support.networkoptix.com/hc/en-us/community/posts/360052014833/comments/1500000054661
But I'd sincerely appreciate some more specific help.
As always, thank you very much!
-
Hi Usama,
and I want to only get frames when a particular Analytics Event occurs on the camera.
could you please show few use-case scenarios on how it will be used? What would trigger these analytics events? Analytic event can be triggered only by analytic plugin and if your plugin wouldn't process any frames, how it would trigger an analytic event? Do you want to use analytic events from third-party plugins as trigger for your plugin?
For context, we don't want to consider all frames for processing or even, in many cases, not just motion events. My idea is to have an event-based filter. The user will be able to enter a string, for example, in a text field on the DeviceAgent or Engine settings. The value of that text field could be the name, description, caption etc of an event...and using this we'll filter out frames.
It isn't possible to receive event's data from external sources in DeviceAgent. I'm not clear on why would you need this in DeviceAgent, but the only way I can think of to achieve this, you can use "Do HTTP request" action to enable/disable your plugin via API. However, I wouldn't consider this as a valid option for user experience.
0 -
Hi Anton Babinov
Thanks very much for the response.
"Do you want to use analytic events from third-party plugins as trigger for your plugin?"
That is correct. We just want to make our plugin configurable and have it only listen to frames when the user wants. Normally, for our use cases, the users will want our plugin to listen only when other events occur. An example of an "other event" is Nx built-in motion detection. But as you can imagine that could lead to too much unnecessary load on the plugin, and so the user might want to be more specific about what they want our plugin to listen to.
Now, after our plugin processes frames it'll at the end generate it's own Analytics event, but that's a separate story. Right now, I'm just working on the "listening" part and want to make it customizable/configurable as much as possible. Please do suggest a better way to go about this if you think this is not doable or a bad design choice.
Thanks!0 -
At this point, there is no "good way" to do this. You have access to motion metadata, but that's all. We have some long term plans on improving this but it won't be implemented in near future.
There is a possibility to connect to server's websocket transaction bus to listen on external events, but you'll need to filter out events from all kinds of transactions. In my option, this would overcomplicate your plugin, as you'll need to implement websocket client, way to filter out required events and whole event logic inside your plugin.
0 -
Hi Anton Babinov
Thanks very much for your response earlier. I've been thinking about this and other complicated ways of having the plugin listen to different kinds of events using the Do HTTP Action rules method etc.
I'm at a dead end unfortunately, so can you please guide me on how to connect to the transaction bus and filter out events. Any caveats associated with this websocket connection, what this feature is normally used for etc?
Thanks!0 -
Hi,
This is 3 years old post, I am replying in this same thread as I have the same requirement in Nx Plugin where I need to process analytic events (camera in-built analytics like Intrusion, line crossing, tampering).
I have implemented the pushUncompressedVideoFrame(const IUncompressedVideoFrame* videoFrame) to receive Motion Events in Plugin. Similarly, can I get analytic events from third-party from 'Video frame' using the metadata in Plugin with details/description of the event that can help filter type of event.
I am currently using Nx Metadata_SDK-5.1.3. Hope with latest SDK the analytic events (camera in-built analytics like Intrusion, line crossing, tampering) can be processed in Plugin.
Thanks
Mohamed Rafi
0
Please sign in to leave a comment.
Comments
5 comments