Run Both Applications with Nx Witness#
Loitering Detection and Live Video Captioning can run at the same time, on the same cameras, through the same VAP Analytics Integration. This page assumes you have run each one on its own, as in Run Loitering Detection and Run Live Video Captioning.
Part 1: Avoid container name and port conflicts#
The two application stacks use some of the same container names and host ports. In the
Loitering Detection docker-compose.yml (metro-vision-ai-app-recipe), make these changes:
Service |
Change |
|---|---|
|
Host port from |
|
Container name to |
|
Container name to |
|
Container name to |
Part 2: Start the applications#
Start the LVC stack. Its broker uses host port
1883:cd metro-ai-suite/live-video-analysis/live-video-captioning docker compose up -d
Start the Loitering Detection stack. Its broker now uses host port
1884:cd metro-ai-suite/metro-vision-ai-app-recipe docker compose up -d
Part 3: Configure and start VAP#
In the VAP
.env, point each app at its own broker:# Loitering Detection broker MQTT_HOST=host.docker.internal MQTT_PORT=1884 # LVC broker MQTT_BROKER_HOST=host.docker.internal MQTT_BROKER_PORT=1883
Generate the configuration with both apps:
cd metro-ai-suite/vms-adapter-plugin ./setup.sh --vms nx --apps ld,lvc
If VAP already registered the integration with only one app, register it again, so the camera settings include both apps. VAP builds the settings panel only when it registers; see Register the integration again.
Start VAP:
docker compose up -d
Part 4: Start both pipelines#
In the Desktop Client, close any open view of the camera.
Right-click the camera, choose Camera Settings, open the Integrations tab, and select VAP Analytics Integration.
The panel has a Loitering Detection group and a Live Video Captioning group. Check the enable checkbox in both, and click Apply, then OK.
VAP starts both pipelines within 5 seconds.
Part 5: See the results#
Both pipelines run in parallel, but the Desktop Client shows one kind of result at a time in a camera view:
Object Search panel (Alt+O): Loitering Detection boxes, such as
vap.pedestrian.Bookmarks panel (Ctrl+B): LVC captions and loitering events.
This is a limitation of the Desktop Client, not of VAP.