What is a Plugin?
Every Plugin is a dynamic library (*.dll/*.so) which can be used to add new capabilities to 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 Witness Server starts, it loads all the Plugin libraries from Plugins directory
- Inside each Plugin library, Nx Witness Server looks for "Engine factory"
- Nx Witness 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 Witness Server creates instances of DeviceAgents to do the work
For Video Analytics Plugins:
- Nx Witness 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 Witness 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 Witness Server calls them when the user clicks a corresponding button in the context menu of an object in the Objects panel inside Nx Witness 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 Witness Server and the remote video analytics software.