# Integrate Intel® SceneScape with Smart NVR This guide covers the integration of Intel® SceneScape with Smart NVR for enhanced traffic monitoring using live data from smart intersection application. ## Overview Smart NVR system integrates with Intel® SceneScape to enable: - Real-time object counting and tracking (vehicles, pedestrians) - Traffic flow analysis - Automated event routing based on count thresholds - Enhanced surveillance for smart intersection management ## Prerequisites **Smart Intersection Reference Implementation**: We will use the Smart Intersection application to showcase the integration with Intel® SceneScape. 1. Set up the Smart Intersection application. ```bash # Clone smart intersection repository inside smart nvr directory if not already done git clone https://github.com/open-edge-platform/edge-ai-suites.git -b v1.2.0 # From the Smart NVR directory, copy the DL Streamer configuration (enables RTSP streaming) cp ./resources/si-rtsp-config.json edge-ai-suites/metro-ai-suite/metro-vision-ai-app-recipe/smart-intersection/src/dlstreamer-pipeline-server/config.json # Copy the SceneScape compose configuration cp ./resources/compose-scenescape-rtsp.yml edge-ai-suites/metro-ai-suite/metro-vision-ai-app-recipe/compose-scenescape.yml ``` 2. After copying the files, start the Smart Intersection application: ```bash # Navigate to metro-vision-ai-app-recipe directory cd edge-ai-suites/metro-ai-suite/metro-vision-ai-app-recipe/ # Start Smart Intersection ./install.sh smart-intersection docker compose up -d # Navigate back to Smart NVR cd ../../../../smart-nvr ``` The files provide: - RTSP streaming support in the DL Streamer pipeline, - Intel® SceneScape-specific Docker Compose settings. ## Installation and Setup ### Step 1: Get MQTT Credentials ```bash # Get MQTT credentials from Smart Intersection cat edge-ai-suites/metro-ai-suite/metro-vision-ai-app-recipe/smart-intersection/src/secrets/browser.auth # Expected: {"user": "", "password": ""} ``` ### Step 2: Configure Environment Variables ```bash # Enable SceneScape Integration export NVR_SCENESCAPE=true # MQTT Configuration (from browser.auth JSON) export SCENESCAPE_MQTT_USER="" export SCENESCAPE_MQTT_PASSWORD="" export SCENESCAPE_THROTTLE_INTERVAL=2.0 # Optional: throttle interval in seconds ``` ### Step 3: Start Smart NVR ```bash # Start the application ./setup.sh start # Or restart with new configuration ./setup.sh restart ``` > **Note:** The setup script automatically copies Intel® SceneScape certificates > from Smart Intersection if available. If certificates are missing, setup will fail with an error message. ### Step 4: Verify Integration Check logs to confirm Intel® SceneScape connection: ```bash docker logs nvr-event-router -f # Look for: "SceneScape MQTT client started" ``` ## User Interface Changes ### With Intel® SceneScape Enabled and SceneScape Source Selected ![SceneScape Enabled Interface](./_assets/Scenescape_enabled.png) When Intel® SceneScape is enabled (`NVR_SCENESCAPE=true`) and **"scenescape"** source is selected: - Source dropdown shows both **"frigate"** and **"scenescape"** options - **Count** field becomes visible and editable - Users can set minimum count threshold for rule triggering (e.g., 5, 10, 15) - Rules table includes "Count" column for tracking thresholds - Count validation ensures non-negative integers only ### With Intel® SceneScape Enabled but Frigate Source Selected ![Frigate Selected Interface](./_assets/Scenescape_enabled_frigate.png) When Intel® SceneScape is enabled but Frigate source is selected: - Currently Frigate object detection is disabled in this mode - Source dropdown still shows both **"frigate"** and **"scenescape"** options - **Count** field is automatically hidden (not applicable for Frigate) - Standard Frigate rule configuration with detection labels - Rules table shows "Count" column but displays "-" for Frigate rules - Full Frigate functionality remains available ## Auto-Route Events Configuration ### Creating Rules **Steps (both sources):** 1. Navigate to **Auto-Route Events** tab 2. **Select Source:** "scenescape" or "frigate" 3. **Set Count:** (SceneScape only) Define minimum threshold (e.g., 5) 4. **Select Camera:** Choose target camera 5. **Choose Detection Label:** Select object type 6. **Select Action:** "Summarize" or "Add to Search" 7. **Click Add Rule** **Key Differences:** - **SceneScape:** Count field visible when selected - **Frigate:** Count field hidden ### Rule Behavior Examples **SceneScape Rule Example:** ```text Source: scenescape Camera: camera1 Count: 5 Label: vehicle Action: Summarize ``` *Triggers video summarization when 5+ vehicles detected in camera1* **Frigate Rule Example:** ```text Source: frigate Camera: livingroom Label: person Action: Add to Search ``` *Adds person detection events to search index for livingroom camera* ## Troubleshooting ### Common Issues **SceneScape features not visible:** ```bash # Check and set environment variable echo $NVR_SCENESCAPE # Should show 'true' export NVR_SCENESCAPE=true ./setup.sh restart # Refresh browser (Ctrl+F5) ``` **No SceneScape events received:** ```bash # Check MQTT connection docker logs nvr-event-router | grep -i scenescape ``` ### Debug Commands ```bash # Check environment variables env | grep NVR_SCENESCAPE env | grep SCENESCAPE # Monitor MQTT messages docker logs nvr-event-router -f | grep "scenescape" # Check UI logs docker logs nvr-event-router-ui -f # Verify SceneScape MQTT connection docker logs nvr-event-router | grep "Scenescape MQTT client" ``` ## Monitoring Commands ```bash # Check system CPU usage and load cat /proc/loadavg && docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" ``` ## Support For Intel® SceneScape integration issues: 1. **Certificate Error**: Ensure Smart Intersection application is running and has generated certificates 2. **Environment Variables**: Verify `NVR_SCENESCAPE=true` and MQTT credentials are set 3. **MQTT Connection**: Check logs for "Scenescape MQTT client started" message 4. **Smart Intersection**: Confirm Smart Intersection application is accessible at expected path 5. **Performance Issues**: Run `cat /proc/loadavg && docker stats --no-stream` to check CPU usage and system load 6. **High Resource Usage**: If load average >10 or containers show >500% CPU, restart high-usage containers 7. Review logs using debug commands above and contact support with relevant excerpts For general Smart NVR issues, see the [Troubleshooting Guide](./troubleshooting.md).