Skip to main content

Overview

RTSP (Real Time Streaming Protocol) is a network control protocol designed for streaming media servers. It’s commonly used in IP cameras, surveillance systems, and professional broadcasting equipment.

Key Benefits

  • Widely supported: Standard protocol for IP cameras and surveillance
  • Low overhead: Efficient streaming with minimal latency
  • Bidirectional: Supports commands and control (play, pause, seek)
  • Transport flexibility: Works over UDP, TCP, or HTTP
  • Professional grade: Used in broadcast and production environments
  • Codec agnostic: Supports H.264, H.265, MJPEG, and more

Pulling RTSP Streams

Ant Media Server can pull RTSP streams from cameras and convert them to WebRTC, HLS, DASH, or RTMP. Source: StreamFetcher.java

Via REST API

Via Web Panel

  1. Navigate to Ant Media Server web panel
  2. Go to Application → New Live Stream → Stream Source
  3. Enter stream details:
    • Name: Camera name
    • Stream URL: rtsp://192.168.1.100:554/stream
    • Stream Type: Stream Source
  4. Click Create
  5. Click Start Broadcasting

RTSP URL Formats

Common Camera URL Patterns

Playing RTSP Streams

Once pulled into Ant Media Server, RTSP streams are available as:

Configuration Options

RTSP URL Parameters

Ant Media Server supports RTSP URL parameters for advanced configuration:
Source: StreamFetcher.java:176-199

Transport Protocol

Timeout Settings

Advanced FFmpeg Options

Troubleshooting

Connection Issues

Cannot Connect to Camera:
Authentication Errors:
Timeout Issues:

Stream Quality Issues

Pixelation/Artifacts:
Packet Loss (UDP):
Audio/Video Sync Issues:

Performance Optimization

Reduce Latency:
Handle Multiple Streams:

Best Practices

Production Recommendations

  1. Use TCP transport: More reliable than UDP for most networks
  2. Monitor stream health: Set up webhooks for stream failures
  3. Implement reconnection: Configure automatic restart on failure
  4. Use substreams: Pull lower resolution for bandwidth savings
  5. Secure credentials: Use environment variables or vault for passwords
  6. Network isolation: Keep cameras on separate VLAN

Camera Configuration

Optimal Settings:
Disable on Camera:
  • Motion detection overlays
  • Timestamp overlays
  • Privacy masks (if not needed)
  • Audio (if not required)

Security

Integration Examples

Motion Detection Integration

Recording Schedule

Multi-Camera Dashboard

RTSP Server (Publishing)

RTSP server functionality for accepting RTSP streams (publishing) requires custom development or third-party integration. Ant Media Server natively supports RTSP as a client (pulling) but not as an RTSP server (receiving).
For RTSP publishing, consider:
  1. Use RTMP for publishing to Ant Media Server
  2. Use WebRTC for browser-based publishing
  3. Use SRT for reliable contribution feeds
  4. Deploy an RTSP server (like rtsp-simple-server) and pull from it

Resources