Stream Routing
Overview
This feature handles dynamic routing of video streams from edge devices to the cloud platform. The architecture leverages MediaMTX for media routing to efficiently direct video streams based on user demand and system load.
Architecture & Data Flow
Component Diagram
Stream Flow
-
Configuration Phase:
- Camera RTSP URLs are configured and associated with device IDs
-
Routing Phase:
- Edge MediaMTX pushes streams to platform MediaMTX
- Platform MediaMTX routes streams to appropriate endpoints
- Client requests are directed to appropriate media endpoints
Sequence Flow
Implementation Details
1. Media Infrastructure
Edge Layer
# MediaMTX configuration (edge)
paths:
cam1:
source: rtsp://${CAMERA_IP}
sourceOnDemand: yes
# Push configuration dynamically set
Platform Layer
# MediaMTX configuration (platform)
paths:
${deviceId}:
source: rtsp://edge-mediaMTX:8554/...
# Serves WebRTC & HLS to clients
2. Routing Mechanism
The routing system manages the paths for video streams between edge devices and the platform, ensuring efficient delivery to end users.
3. Endpoints
The system provides multiple streaming endpoints to accommodate different client needs.
4. Stream Lifecycle Management
The SEER Platform automatically manages the lifecycle of streams by periodically checking for active clients. When no clients are viewing a particular stream, the platform will automatically remove that stream to optimize resource usage.
Configuration Guide
Platform Setup
- Deploy Platform MediaMTX instance
- Configure routing paths for device streams
Edge Setup
Offline Deployment (No Git/Registry Access)
Download the pre-built edge deployment package for your target device architecture:
| Architecture | Download |
|---|---|
| amd64 (Intel/AMD x86_64) | seer-edge-deploy-amd64.zip |
| arm64 (Apple Silicon, Raspberry Pi 4+) | seer-edge-deploy-arm64.zip |
Deploy on the target device:
Windows (cmd/PowerShell):
# Right-click the zip -> Extract All
# Edit .env.edge with your device config (MQTT broker, edge ID, etc.)
notepad .env.edge
# Double-click import-edge.bat, or run:
import-edge.bat
Linux/WSL:
unzip seer-edge-deploy-*-<arch>.zip
cd seer-edge-deploy-*
nano .env.edge
./import-edge.sh
Standard Deployment
- Deploy Edge MediaMTX with on-demand sourcing
- Configure push destinations to platform
- Register edge devices in platform
Client Setup
- Configure player endpoints for WebRTC/HLS
Media Endpoints
- WebRTC:
webrtc://{base_url}/edge/v1/whep/${deviceId}/whep - HLS:
http://{base_url}/edge/v1/hls/{deviceId}/index.m3u8
Troubleshooting
Common Issues
-
Stream routing not working
- Check edge-to-platform network connectivity
- Verify routing path configurations
-
High latency
- Check edge and platform MediaMTX performance
- Verify network bandwidth