Skip to main content

Overview

Ant Media Server supports multiple streaming protocols for both ingesting (publishing) and delivering (playing) live streams. Understanding when to use each protocol is crucial for optimizing your streaming infrastructure.

Ingest Protocols

Ingest protocols are used to publish streams to Ant Media Server.

WebRTC (Web Real-Time Communication)

Best for: Ultra-low latency streaming from browsers and mobile apps
  • Latency: ~0.5 seconds
  • Use cases: Live auctions, video conferencing, interactive streaming
  • Codecs: H.264, H.265 (HEVC), VP8, VP9
  • Transport: UDP with SRTP encryption
WebRTC is enabled by default. Set webRTCEnabled=true in your application settings.
AppSettings.java:1001

WebRTC Configuration

Key settings for WebRTC ingest:

RTMP (Real-Time Messaging Protocol)

Best for: Broadcasting software and hardware encoders
  • Latency: 3-5 seconds
  • Use cases: OBS Studio, hardware encoders, legacy systems
  • Codecs: H.264 video, AAC audio
  • Port: 1935 (default)
RTMP remains the most widely compatible protocol for professional broadcasting software. Ant Media Server processes RTMP streams through the RTMPAdaptor:
RTMPAdaptor.java

RTMP Configuration

RTMP is being deprecated by major platforms. Consider migrating to SRT or WebRTC for new implementations.

SRT (Secure Reliable Transport)

Best for: Low-latency contribution over unpredictable networks
  • Latency: 1-3 seconds (configurable)
  • Use cases: Remote production, contribution feeds, replacing RTMP
  • Features: Built-in encryption, error correction, firewall traversal
  • Port: Configurable (default varies)
SRT provides superior resilience over unreliable networks through its ARQ (Automatic Repeat Request) mechanism.
SRTAdaptor.java

RTSP (Real-Time Streaming Protocol)

Best for: IP cameras and surveillance systems
  • Latency: 1-3 seconds
  • Use cases: IP cameras, security systems, CCTV
  • Codecs: H.264, H.265, AAC
  • Transport: RTP/RTCP over TCP or UDP
Ant Media Server can pull RTSP streams from IP cameras and re-stream them:

Delivery Protocols

Delivery protocols are used by viewers to watch streams.

WebRTC Playback

Best for: Ultra-low latency playback in browsers
  • Latency: ~0.5 seconds
  • Use cases: Interactive applications requiring real-time feedback
  • Platform support: Modern browsers, mobile apps

HLS (HTTP Live Streaming)

Best for: Maximum compatibility and scalability
  • Latency: 6-30 seconds (standard), 2-6 seconds (LL-HLS)
  • Use cases: Large audiences, VOD, mobile devices
  • Codecs: H.264, H.265, AAC, AC3
  • Format: MPEG-TS or fMP4 segments
HLS is the most widely supported adaptive streaming format:
AppSettings.java:854

HLS Configuration

Use hlsSegmentType=fmp4 for HEVC/H.265 streams, as MPEG-TS segments may not play correctly with HEVC.

Low-Latency HLS (LL-HLS)

For reduced latency with HLS:

DASH (Dynamic Adaptive Streaming over HTTP)

Best for: Standards-based adaptive streaming
  • Latency: 6-30 seconds (standard), 3-6 seconds (LL-DASH)
  • Use cases: OTT platforms, cross-platform delivery
  • Format: ISO BMFF (fMP4)

CMAF (Common Media Application Format)

Ant Media Server supports CMAF through its DASH implementation, allowing single-file packaging for both HLS and DASH:

Protocol Comparison

Choosing the Right Protocol

For Ingestion

  1. Real-time interaction needed: WebRTC
  2. Professional broadcasting: RTMP or SRT
  3. Unreliable networks: SRT
  4. IP cameras: RTSP pull
  5. Browser-based publishing: WebRTC

For Delivery

  1. Ultra-low latency required: WebRTC
  2. Maximum compatibility: HLS
  3. Large-scale delivery: HLS or DASH with CDN
  4. Low latency at scale: LL-HLS or LL-DASH
  5. Standards compliance: DASH

Multi-Protocol Workflow

Ant Media Server excels at protocol translation. A typical workflow: The server automatically transcodes and packages streams for all enabled delivery formats:
Muxer.java:918

Next Steps

Adaptive Bitrate

Learn how ABR streaming optimizes delivery

Ultra-Low Latency

Understand sub-second streaming with WebRTC