This guide helps you set up your development environment to create integrations for the Network Optix (Nx) products.
While the VMS Server supports multiple versions of Ubuntu and Windows, this tutorial focuses on Ubuntu 24.04, the g++ compiler, and the latest version of the Nx Meta VMS.To build your plugin, you need several development tools. For VMS 6.0+, the required compiler version is g++-12. For more details on alternative environments, see the Supported Operating Systems article and the Ubuntu Linux OS Installation Guide.
Install prerequisite packages
To build your integration, you need several development tools. The required compiler version depends on your VMS Server version. For VMS 6.0+, the required compiler version is g++-12.
| NOTE: The OpenCV framework is required but is automatically downloaded and configured by CMake and Conan during the build process. Do not install the default Ubuntu version of OpenCV. For more details, see the Installing and linking OpenCV framework section. |
To install the required tools, complete the following steps:
-
Update your package manager and install the core dependencies:
sudo apt update
sudo apt upgrade
sudo apt install g++-12 unzip git python3.12 python3-pip
-
Configure g++-12 and gcc-12 as your default system compilers:
sudo rm /usr/bin/g++
sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/g++-12 /usr/bin/g++
sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc
-
Download and install CMake:
wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.sh
chmod +x cmake-3.28.3-linux-x86_64.sh
sudo ./cmake-3.28.3-linux-x86_64.sh --prefix=/opt/cmake/
sudo ln -s /opt/cmake/cmake-3.28.3-linux-x86_64/bin/cmake /usr/bin/cmake
-
Install Conan version 1.62:
sudo pip3 install conan==1.62. Reference link to Conan documentation.
Install the Nx MetaVMS
You must install the latest build of the Nx MetaVMS Media Server on your development machine.
- Download the Ubuntu version of the Nx MetaVMS.
-
Install the downloaded package:
sudo apt install ./<path to MetaVMS .deb file> - Navigate to http://localhost:7001 in your browser, then follow the instructions to create a new system and set your administrator password.
Download the Cross Platform Server Plugin SDK
-
Create a dedicated development directory and navigate into it:
mkdir -p ~/develop
cd ~/develop - Download the Cross-platform - server_plugin_sdk version that matches your installed Nx MetaVMS.
-
Extract the SDK archive:
unzip <path to Metadata SDK .zip file> - Verify that the files extracted correctly into the metadata_sdk folder.
Emulate a camera
Instead of using a physical camera, you can use Testcamera, an application that emulates an IP camera using a video file.
- Download and save the sample video file locally to use for object detection and tracking.
- Follow the setup steps in the Testcamera: IP Camera Emulator guide to start your emulator instance before continuing.
Create and build the plugin from a template
To accelerate development, use the pre-configured sample_analytics_plugin template, which mimics a basic "Hello, World!" program by moving a text label across the screen and triggering events.
-
Copy the sample plugin to your development directory:
cp -a server_plugin_sdk/samples/analytics/sample_analytics_plugin ~/develop/opencv_object_detection_analytics_plugin -
Navigate to your project directory, create a build directory, and run CMake to compile the plugin:
cd ~/develop
mkdir build
cmake -DmetadataSdkDir=./server_plugin_sdk -B ./build opencv_object_detection_analytics_plugin
cmake --build ./build --config Release -- -j
Load and enable the plugin
To run your plugin, you must move the compiled binary to the server's plugin directory and activate it within the desktop application.
-
Copy the compiled .so file into the server plugins folder:
sudo cp ~/develop/build/libsample_analytics_plugin.so /opt/networkoptix-metavms/mediaserver/bin/plugins -
Restart the Nx MetaVMS Media Server to load the new plugin:
sudo systemctl restart networkoptix-metavms-mediaserver - Open your Nx MetaVMS Desktop client and log in to your server.
- Right-click your emulated camera and select Camera Settings.
- Click the Integrations tab.
- Find the Sample analytics plugin and switch the Enable slider to the active position.
-
Click OK to apply the changes.
You have managed to load and enable the sample plugin!
Comments
0 comments
Article is closed for comments.