Skip to main content

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):
For High Quality:
For Low Bandwidth:

Stream Authentication

Generate publish tokens via REST API:

Troubleshooting

Connection Issues

Cannot connect to RTMP server:
Stream not appearing:

Quality Issues

Pixelation/artifacts:
  • Increase bitrate
  • Use slower encoding preset
  • Check network bandwidth
  • Reduce resolution
Buffering/stuttering:
  • Decrease bitrate
  • Use faster preset (ultrafast/veryfast)
  • Check upload bandwidth
  • Reduce keyframe interval
High latency:
  • Set keyframe interval to 1-2 seconds
  • Enable tune=zerolatency in encoder
  • Use CBR bitrate mode
  • Reduce server-side buffer: rtmpIngestBufferTimeMs=0

Debug Commands

Best Practices

Production Recommendations

  1. Use consistent keyframe intervals: Set to 2 seconds for optimal HLS/DASH compatibility
  2. Enable CBR for live streaming: Provides predictable bandwidth usage
  3. Set appropriate buffer sizes: bufsize = 2 * bitrate
  4. Use authentication: Enable token-based security for production
  5. Monitor stream health: Use webhooks or REST API for monitoring
  6. 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:
Access converted streams:
  • 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