Overview
RTMP (Real-Time Messaging Protocol) is a widely-supported protocol for live streaming. It’s the de facto standard for streaming from encoders like OBS, vMix, and Wirecast to media servers.Key Benefits
- Wide compatibility: Supported by virtually all streaming software
- Stable: Mature protocol with proven reliability
- Simple setup: Easy to configure in most encoders
- Low CPU usage: Efficient encoding and transmission
- Codec support: H.264 video, AAC/MP3 audio
Publishing Streams
OBS Studio
Mobile Apps
Playing Streams
Direct RTMP Playback
RTMP playback in browsers requires Flash, which is deprecated. For browser playback, convert RTMP to HLS, DASH, or WebRTC using Ant Media Server’s transcoding capabilities.
Configuration Options
Server Configuration
Encoder Settings Recommendations
For Low Latency (3-5 seconds):Stream Authentication
Troubleshooting
Connection Issues
Cannot connect to RTMP server:Quality Issues
Pixelation/artifacts:- Increase bitrate
- Use slower encoding preset
- Check network bandwidth
- Reduce resolution
- Decrease bitrate
- Use faster preset (ultrafast/veryfast)
- Check upload bandwidth
- Reduce keyframe interval
- Set keyframe interval to 1-2 seconds
- Enable
tune=zerolatencyin encoder - Use CBR bitrate mode
- Reduce server-side buffer:
rtmpIngestBufferTimeMs=0
Debug Commands
Best Practices
Production Recommendations
- Use consistent keyframe intervals: Set to 2 seconds for optimal HLS/DASH compatibility
- Enable CBR for live streaming: Provides predictable bandwidth usage
- Set appropriate buffer sizes:
bufsize = 2 * bitrate - Use authentication: Enable token-based security for production
- Monitor stream health: Use webhooks or REST API for monitoring
- Configure reconnection: Set up automatic reconnection in encoders
Quality Presets
Converting RTMP to Other Formats
Ant Media Server automatically converts RTMP to HLS, DASH, and WebRTC. Enable in configuration:- HLS:
https://your-server.com:5443/WebRTCAppEE/streams/stream123.m3u8 - DASH:
https://your-server.com:5443/WebRTCAppEE/streams/stream123.mpd - WebRTC: Use WebRTC player with
streamId: stream123
