Need help with creating event rule using REST API
AnsweredI am evaluating NX integration for our needs using REST API. I am trying to create certain rules for the cameras from our application using NX REST API based on our configuration. I have NX Meta installed in my development machine and my code runs in the same machine. I have added webcam as source and also using testcamera with 3 files. I am able to create analytics event rule with HTTPs Request from my code without referencing any camera. But I am not able to figure out the following values.
1. How to find what event types are available for a camera?
I am not able to create analytics event from NX Client for my webcam as well as testcameras. It says Analytics event is not available for my web cam. If the analytic event is not available for a source then I dont want to create the event rule for that. Currently API accepts and creates the rule. How do I check whether an event type is supported for a camera/source?
2. How to find the value for InputPortId in eventconditions for a camera?
I am not able to figure out what should be the value. I have seen guids or values like '
-
Hello,
Event types are listed in the /ec2/getEventRules API documentation in the Schema tab
https://meta.nxvms.com/doc/developers/api-tool/ec2-geteventrules-get?type=1
InputPortId is only available for events of the
cameraInputEvent type
0 -
Thanks Andrey Terentyev.
Is there a way I can map whether an event type is eligible for a camera? I have my webcam in nx but It doesn't allow me to create an Analytic Event in Nx Client. So I think I have to exclude cameras which doesnt support analytic event. But I am not sure how to create a filter based on device response and event type.
Is InputPortId not required for Analytic Event?
Thanks Again for the help
0 -
Hi Sukumar Krishnan,
InputPortId is usually used by I/O module to recognize which channel/port was triggered.
For Analytic Event on a camera, you may not need this parameter.Thanks.
0 -
Thanks Ichiro. I need to register analytic events for the available cameras from my application. This is one of the main requirements for my client to consider integrating with Nx as VMS from main application. Till now I am not able to figure out whether the device/camera has analytics capability. Device API returns capabilities most of the time but it doesn't include NoAnalytics capability type for my webcam, I am not sure how the Nx Client validates whether the camera has analytics capability. Any help will be greatly appreciated.
0 -
Hi,
The analytics event availability is reported by an analytics plugin. Technically, a plugin report supported event types when is loaded to the Server. The Server comes with several device dependent plugins available out of the box for supported camera models and vendors.
If your physical camera has built-in analytics capabilities, you could develop your own device dependent analytics plugin to support them in the Server.
If the camera does not. You still could develop an analytics plugin to perform analytics computation on the Server side.
For more details, please refer to the article
https://meta.nxvms.com/docs/developers/knowledgebase/195-1-integration-capabilities--what-to-expect
In addition, we have a tutorial for developing an analytics plugin.
> This is one of the main requirements for my client to consider integrating with Nx as VMS from main application
Could you please shed more light on what your application is supposed to do? What specific type of integration does your client need?0 -
Thanks Andrey Terentyev. I will check that.
We like to manage these cameras from our existing application which manages other integrations. One of the requirements is to group the cameras by specific criteria and create events for the group like camera events or analytics events or both. I need to inform the user if certain cameras can't support analytics in the group. Then we can decide to write a plugin or change it. As of now I can't connect or install NX in the environment to test this out. So, I depend on the API responses to do the POC to prove that its achievable. Question from my client is if Nx Client is able to tell the camera doesn't have the capability then why can't you? I am still looking for a way to find this. The current application is web based and I don't think the users will have Nx Client. There are users who at the control center may have NX client installed but they will be mainly managing the walls and layouts. But we are asked to provide that also from our application if possible.
0 -
Thanks for your reply. You may check the answer and comment below to your questions.
1) the Nx Client will not validate the camera, it is the server function. As a result, the desktop client only accepts and displays the result provided by the mediaserver. Please kindly be noticed and understood the different functions will be done on different components. Your customer question has nothing to do with Nx Client, again, it is the server function.
2) the analytics functions are required to be integrated, either by Nx or the manufacturers. As a result, the in-Camera analytics does not open for every manufacturers. Currently, Nx Witness supports but not limited to the main stream of IP camera, ex: Hanwha, VIVOTEK, AXIS, DW, iPRO, Hikvision, Dahua, Uniview, Bosch..etc.
That being said not every IP camera or webcam will be able to support. You can find the supported list here:https://support.networkoptix.com/hc/en-us/articles/360056005254-Supported-In-Camera-Analytics3) If you would like see if a device is supported by Nx Witness or 3rd-party-plugins (Analytics), at the moment, it is likely you can use the API /rest/v2/devices.
In the response, there will be a "deviceAgentManifests". In this struct, you can see if the camera is capable of working with the mediaserver and/or receiving the in-Camera analytics notifications/events.
I assume this is likely the closest and best option for you. You may first check the response and confirm the supported VCA, then setup the event if requried.Thanks.
0 -
Thanks Ichiro. Its really helpful. I will try and update you. Appreciate your help
0
Please sign in to leave a comment.
Comments
8 comments