The best way to start getting acquainted with the Metadata (Analytics) SDK is to check an example included in the SDK package: `Stub Analytics Plugin`, located at `samples/stub_analytics_plugin/`. This example demonstrates the usage and implementation of all Metadata (Analytics) SDK features.
Implementing an Engine
The Engine needs to define the manifest describing its capabilities and also provide a function that creates a new DeviceAgent for a particular camera.
To get started, check out the base class nx::sdk::analytics::Engine and an implementation example nx::vms_server_plugins::analytics::stub::Engine.
Implementing a DeviceAgent
A DeviceAgent is a worker for a particular camera.
Key methods to implement:
- DeviceAgent will receive video frame-by-frame implementing one of the methods pushCompressedVideoFrame() or pushUncompressedVideoFrame().
- DeviceAgent sends detected objects and metadata either calling the method pushMetadataPacket() or implementing the method pullMetadataPackets().
To get started, check out the base class nx::sdk::analytics::VideoFrameProcessingDeviceAgent and its implementation example nx::vms_server_plugins::analytics::stub::DeviceAgent.
Providing Context Actions
A Plugin can also provide context actions for detected objects. Context actions will be exposed to the user in the context menu for a detected object on the Nx Desktop client.
A context action can instruct the Nx Server application to open a dialog requesting additional parameters or to open a web page.
- Add a car to a blacklist
- Run additional analysis on a detected object
- Open a person's profile in a third-party system (e.g. a browser-based interface)
- Mark detection as wrong for improved learning /analysis in the future
Next step: decide if your solution needs context actions. If so, declare them in Plugin's manifest and implement function nx::sdk::analytics::Engine::executeAction().
To get started, check out the example nx::vms_server_plugins::analytics::stub::Engine::executeAction()
Sending Plugin Events
Plugin events (aka Plugin Diagnostic Events) are designed to let the user know what is happening inside the Plugin. These events are not video-related, they are for reporting diagnostic and health state of the integrated analytics product / Plugin.
- 3rd party Analytics product is offline / unavailable
To get started, check out the example nx::vms_server_plugins::analytics::stub::DeviceAgent::processPluginEvents()