What is a Plugin?
Every Plugin is a dynamic library (*.dll/*.so) which can be used to add new capabilities to Powered-by-Nx products (like Nx Witness).
A Plugin implements several abstract classes:
- Engine — a class representing a Video Analytics solution. Technically it is a factory of DeviceAgents; each Engine receives its own settings set by the user
- DeviceAgent — a special "worker" for a specific camera, for example, for processing its video stream
Each class declares a manifest — a JSON object declaring its capabilities and settings.
The Plugin Lifecycle
- When Nx Server starts, it loads all the Plugin libraries from Plugins directory
- Inside each Plugin library, Nx Server looks for "Engine factory"
- Nx Server creates an Engine object using the factory
- Once an Engine is in the system, it becomes available to the user; they can enable it on specific cameras and configure it using the Desktop Client interface
- Once an analytic Plugin is enabled on the camera, Nx Server creates instances of DeviceAgents to do the work
For Video Analytics Plugins:
- Nx Server sends a video frame-by-frame to a special method of a DeviceAgent.
- DeviceAgent does the internal work and sends metadata (detected objects and events) back to Nx Server.
- Metadata goes to the object database and is used for search and visualization
- Events go to Event Rules Engine. The user can then configure specific actions for those events.
- If a DeviceAgent provides context actions for metadata objects, Nx Server calls them when the user clicks a corresponding button in the context menu of an object in the Objects panel inside Nx Desktop.
Integrating with a Remote Analytic Product
In cases where a video analytics product works as an independent application or service (not running on the same machine as the Plugin, e.g. cloud-based or “boxed” video analytics solutions), Plugins should be implemented in a way that will connect to the remote solution and transfer data between Nx Server and the remote video analytics software.
If you have any questions related to this topic or you want to share your experience with other community members or our team, please visit and engage in our support community or reach out to your local reseller.
Next article in Integrating Video Analytics: Exploring Plugin Code Examples