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)
RTMPAdaptor:
RTMPAdaptor.java
RTMP Configuration
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)
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
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
AppSettings.java:854
HLS Configuration
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
| Protocol | Latency | Scalability | Compatibility | Use Case |
|---|---|---|---|---|
| WebRTC | ~0.5s | Medium | Modern browsers | Real-time interaction |
| RTMP | 3-5s | High | Encoders | Broadcasting software |
| SRT | 1-3s | High | Professional tools | Contribution feeds |
| RTSP | 1-3s | Low | IP cameras | Surveillance |
| HLS | 6-30s | Very High | Universal | Large audiences |
| LL-HLS | 2-6s | High | Modern clients | Low-latency at scale |
| DASH | 6-30s | Very High | Standards-based | OTT platforms |
Choosing the Right Protocol
For Ingestion
- Real-time interaction needed: WebRTC
- Professional broadcasting: RTMP or SRT
- Unreliable networks: SRT
- IP cameras: RTSP pull
- Browser-based publishing: WebRTC
For Delivery
- Ultra-low latency required: WebRTC
- Maximum compatibility: HLS
- Large-scale delivery: HLS or DASH with CDN
- Low latency at scale: LL-HLS or LL-DASH
- 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
