What would be the best way to check if camera has analytics enabled?
PlannedWe are currently using the /ec2/analyticsLookupObjectTracks to check if a camera has analytic. If the result is empty, we assume that the camera has no analytics defined.
The issues we have found are:
1. data is returned only camera is recording.
2. if analytics were enabled and we disable the analytics, the request still return data
Is this the correct way to get the analytic indication?
Any workarounds for the issues specified?
we are using server version 5.1.5 but with deprecated REST api.
-
Official comment
Hello Sigalc,
There is actually a rather simplistic way to retrieve the information about the plugins that are currently enabled for the particular device with the most recent version of the API compatible with VMS versions 6.0 and higher.
The algorithm you should follow to extract the enabled plugins(ones the user "clicked" to enable and the ones have the switch button in the "green" state) is the following:
- Execute the GET /rest/v3/devices/{deviceId} request and parse out the response(https://meta.nxvms.com/doc/developers/api-tool/rest-v3-devices-id-get)
- From the response refer to the "userEnabledAnalyticsEngineIds" attribute with the value represented as the array of strings with the uuid values each.
- These uuid values are actually the ids of the analytics engines currently triggered. To get info about each you could query the GET /rest/v3/analytics/engines/{engineId}(https://meta.nxvms.com/doc/developers/api-tool/rest-v3-analytics-engines-id-get)
The above true for any custom plugin that user is allowed to turn on and off. It gets a bit trickier in case of so called "device dependent" plugins such as the embedded in-camera plugins delivered with the default installation of Nx Witness for certain vendors.
Those are always considered "active" and can not be turned off.
When it comes to 5.1.5 version, the approach is completely same but you should be using the previous compatible versions of the API calls.
- Instead of GET /rest/v3/devices/{deviceId} -> use GET /rest/v2/devices/{deviceId}
- Instead of GET /rest/v3/analytics/engines/{engineId} -> use GET /ec2/getAnalyticsEngines
-
Thank you so much for your detailed response!
This is exactly what we found and came to the same conclusions you mentioned.
Will there be any other solution in version 6.0 and higher for the embedded analytics?
0
Please sign in to leave a comment.
Comments
2 comments