Get Started#
Overview#
The VMS Adapter Plugin (VAP) bridges Video Management Systems (VMS), such as Nx Witness, Genetec, and Milestone VMS platforms, with AI Analytics Applications, such as Live Video Captioning (LVC), DL Streamer vision analytics applications like Loitering Detection, and provides a unified provider dashboard, built with the React library, for managing cameras and analytics runs. This guide shows how to deploy the full stack with the Docker Compose tool and run your first analytics session.
This guide shows how to:
Set up prerequisites: Start LVC or DL Streamer vision analytics (Loitering Detection) before VAP, since VAP fetches their schemas at startup.
Configure the environment: Point VAP at your VMS and Analytics App services.
Run the provider dashboard: Discover cameras, enable streams, and start analytics runs.
Quick Start#
Check the folder layout to familiarize yourself with the code structure.
Prerequisites#
Verify that your system meets the minimum requirements.
Install the Docker platform: Installation Guide.
Install the Docker Compose tool: Installation Guide.
Nx Witness VMS with an accessible REST API (
NX_HOST,NX_USERNAME,NX_PASSWORD). This document does not cover Nx Witness or Nx Cloud setup.At least one Analytics Application running before VAP starts:
Live Video Captioning (LVC) — for Vision-Language Model (VLM) based AI captioning.
Loitering Detection (DL Streamer Vision based) — for real-time detection of loitering behavior in transportation hubs with Nx write-back.
Step 1 — Start Live Video Captioning (LVC)#
Note: Skip this step if you are only using Loitering Detection.
Clone and start the LVC application from its own directory. LVC must be running before VAP starts, because VAP fetches the LVC OpenAPI schema at startup to build the analytics configuration form:
git clone --filter=blob:none --sparse --branch main https://github.com/open-edge-platform/edge-ai-suites.git
cd edge-ai-suites
git sparse-checkout set metro-ai-suite
cd metro-ai-suite/live-video-analysis/live-video-captioning
Follow the LVC Get Started guide to prepare models and configure the environment, then start the stack:
docker compose up -d
Verify LVC is reachable:
curl http://localhost:4173/health
Step 2 — Start Loitering Detection#
Note: Skip this step if you are only using Live Video Captioning.
Loitering Detection is a user-provided application based on the DL Streamer Pipeline Server. Follow the Loitering Detection Get Started guide to bring up the application. Ensure all containers are running, but do not start the pipelines yet. The following services must be reachable from the VAP backend container:
Service |
Default Port |
Purpose |
|---|---|---|
DL Streamer Pipeline Server |
|
Receive pipeline start/stop commands |
MQTT Broker |
|
Publish inference metadata to VAP |
Verify the DL Streamer Pipeline Server is reachable:
curl http://<LOITERING_DETECTION_HOST>:8080/pipelines
Step 3 — Clone VAP and Create the .env File#
cd metro-ai-suite/vms-adapter-plugin
cp .env.example .env
Open .env and update the variables for your environment. Variables are grouped by scope. Within each analytics app group, Mandatory applies only if you are using that app.
Common (VAP with Nx Witness):
Variable |
Description |
Required? |
|---|---|---|
|
Nx Witness host and credentials |
Mandatory |
|
Nx TLS verification toggle and optional CA bundle path (default: |
Optional |
|
PostgreSQL password (change from default) |
Optional |
|
Host port for the dashboard HTTPS (default: |
Optional |
Live Video Captioning (LVC):
Variable |
Description |
Required? |
|---|---|---|
|
URL of the running LVC backend, e.g., |
Mandatory |
|
URL of the MediaMTX WebRTC server, e.g., |
Mandatory |
|
MQTT TLS, CA bundle, and optional mutual TLS client certificate for the LVC broker subscriber |
Optional |
DL Streamer Vision (dls_vision — Loitering Detection):
Variable |
Description |
Required? |
|---|---|---|
|
DL Streamer Pipeline Server host and port for Loitering Detection app (default port: |
Mandatory |
|
MQTT broker host and port for |
Mandatory |
|
DL Streamer TLS verification toggle and optional CA bundle path (default: |
Optional |
|
MQTT TLS, CA bundle, and optional mutual TLS client certificate for the dls_vision subscriber |
Optional |
Note: If Live Video Captioning or Loitering Detection is running on the same host as VAP, use
host.docker.internal(Linux/Mac). Otherwise, use the actual IP address.
For certificate path examples and TLS behavior details, see TLS and Certificate Configuration.
Step 4 — Build and Start VAP#
docker compose up -d --build
Wait for all services to become healthy:
docker compose ps
Expected output — all services should show healthy or running:
NAME STATUS
vms-adapter-backend Up (healthy)
vms-adapter-ui Up
vms-adapter-postgres Up (healthy)
Verify the backend is up:
curl -k https://localhost:3443/v1/health
Step 5 — Open the Provider Dashboard#
Service |
URL |
|---|---|
Provider Dashboard (HTTPS) |
|
API Docs (Swagger UI) |
|
OpenAPI JSON |
|
Note: The dashboard uses HTTPS by default with a self-signed certificate. Your browser will show a security warning on first access — this is expected. To use your own certificate, copy
docker-compose.tls.ymltodocker-compose.override.ymland placecert.pemandkey.pemin./certs/ui/.
Swagger Docs: VAP serves API docs through the UI nginx proxy. Open
https://localhost:3443/docsto browse endpoints andhttps://localhost:3443/openapi.jsonfor the raw OpenAPI schema.
Step 6 — Discover Cameras#
In the dashboard, click Discover Cameras to sync cameras from all connected VMS systems. You can also trigger discovery via the API:
curl -k -X POST https://localhost:3443/v1/cameras/discover
The backend queries all configured VMS shims (Nx Witness in our case) and persists discovered cameras to PostgreSQL.
Step 7 — Enable Cameras and Start Analytics#
In the Camera Discovery panel, enable the cameras you want to use for analytics.
In the Analytics Engine panel, select an Analytics Application (for example, Live Video Captioning or Loitering Detection).
Configure the analytics parameters (model, prompt, pipeline, and so on) and click Start Run.
View live captions or detection results in the Live Stream and Analysis Results panels.
Live Video Captioning#
Configure the following fields in the dashboard:
Field |
Description |
Default |
|---|---|---|
Camera |
Dropdown of enabled cameras |
— |
Enter Prompt |
VLM prompt for captioning |
“Describe what you see in one sentence.” |
Select Model |
VLM model from LVC |
OpenGVLab/InternVL2-2B |
Max New Tokens |
Maximum caption length |
70 |
Select Pipeline |
DL Streamer pipeline configuration |
— |
Run Name |
Display name for this run |
— |
Frame Rate |
Frames per second sent for inference |
1 |
Chunk Size |
Number of frames per inference chunk |
1 |
Frame Resolution |
Resolution preset sent to LVC |
default |
Live captions are streamed via Server-Sent Events (SSE) and displayed in the dashboard caption overlay on the WebRTC video player.
Loitering Detection (DL Streamer Vision based app)#
Configure the following fields in the dashboard:
Field |
Description |
|---|---|
Camera |
Dropdown of enabled cameras (Nx Witness cameras) |
Pipeline Name |
DL Streamer pipeline template to use |
Pipeline Version |
Version of the pipeline template |
Detection results are pushed directly back to Nx Witness as analytics objects (bounding boxes with labels). Use the Nx Witness client to view detections overlaid on the camera feed.
Stop the Stack#
docker compose down # stop without removing data
docker compose down -v # stop and remove PostgreSQL volume
Folder Layout#
vms-adapter/
├── plugin/ # Backend Python package
│ ├── base/
│ │ └── interfaces.py # IVmsShim + IAnalyticsAppShim abstract interfaces
│ ├── common/
│ │ └── schema_builder.py # Dynamic Pydantic model builder from JSON Schema
│ └── Analytics/
│ ├── api/
│ │ ├── routes/
│ │ │ ├── cameras.py # Camera discovery + enable/disable
│ │ │ ├── analytics_apps.py # Generic Analytics App API (discover, runs, stream, options)
│ │ │ ├── events.py # Event timeline
│ │ │ ├── analysis.py # Analysis result callback
│ │ │ ├── sessions.py # Session tracking
│ │ │ ├── vms.py # VMS register
│ │ │ ├── health.py # Health + readiness
│ │ │ └── config.py # Config status
│ │ └── deps.py # FastAPI dependency injection
│ ├── db/
│ │ └── repository.py # Async SQLAlchemy CRUD
│ ├── models/
│ │ ├── db.py # ORM models (Camera, Event, Session, …)
│ │ └── domain.py # Domain dataclasses
│ ├── pipeline/
│ │ └── orchestrator.py # Background camera sync + event processing
│ ├── config.py # Pydantic settings (YAML + env)
│ ├── factory.py # Shim factory
│ └── main.py # FastAPI application entry point
│
├── vms_shim/ # Concrete VMS shims
│ ├── frigate/
│ │ ├── shim.py # FrigateVmsShim — discovers cameras via local config
│ │ └── config/ # Frigate config.yml (cameras, go2rtc, etc.)
│ └── nxwitness/
│ └── shim.py # NxWitnessVmsShim — Nx Witness REST API v4
│
├── analytics_app_shim/ # Concrete Analytics App shims
│ └── lvc/
│ ├── api_client.py # LvcApiClient — all HTTP calls to LVC backend
│ ├── schema.py # LvcSchemaManager — OpenAPI fetch, $ref resolution,
│ │ # UI annotations, Pydantic model building
│ └── shim.py # LiveCaptioningAnalyticsAppShim — composes api_client + schema
│
├── ui/ # React 19 / Vite frontend served by nginx
│ ├── src/
│ │ ├── App.jsx # Root component + state
│ │ ├── components/MainPage/
│ │ │ ├── CameraDiscoveryPanel.jsx
│ │ │ ├── AnalyticsEnginePanel.jsx # Dynamic schema form + run lifecycle
│ │ │ ├── SchemaForm.jsx # Generic JSON Schema → form renderer
│ │ │ ├── LiveStreamTab.jsx # WebRTC player + caption overlay
│ │ │ └── AnalysisResultsPanel.jsx
│ │ ├── hooks/
│ │ │ └── useLvcStream.js # SSE caption stream hook
│ │ └── services/
│ │ └── api.js # Generic API client functions
│ └── nginx.conf # Reverse proxy: /v1 → backend, /whep → MediaMTX
│
├── config/
│ └── config.yaml # Runtime config (cameras, VMS endpoints, LVC URL)
├── tests/ # pytest unit + integration tests
├── Dockerfile # Backend image
├── docker-compose.yml # backend + ui + postgres
├── pyproject.toml # Python deps + package config
└── .env.example # Environment variable reference
Next Steps#
Explore the Architecture: Learn how VAP components interact in the How It Works guide.
Follow Integration Tutorials: Use the How-To Guides for end-to-end walkthroughs of LVC and Loitering Detection integrations.
Browse the API: Explore all available endpoints in the API Reference.
Troubleshooting: If you encounter issues, check the Troubleshooting Guide.