Skip to main content

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

  1. Configuration Phase:

    • Camera RTSP URLs are configured and associated with device IDs
  2. 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

  1. Deploy Platform MediaMTX instance
  2. Configure routing paths for device streams

Edge Setup

  1. Deploy Edge MediaMTX with on-demand sourcing
  2. Configure push destinations to platform
  3. Register edge devices in platform

Client Setup

  1. 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

  1. Stream routing not working

    • Check edge-to-platform network connectivity
    • Verify routing path configurations
  2. High latency

    • Check edge and platform MediaMTX performance
    • Verify network bandwidth