Overview
Ant Media Server can pull streams from IP cameras and re-stream them to viewers. This feature supports:- RTSP Camera Sources - Pull streams from any RTSP-enabled camera
- ONVIF Protocol - Auto-discover and configure ONVIF cameras
- PTZ Control - Pan, tilt, and zoom control for compatible cameras
- Multiple Cameras - Manage hundreds of camera streams
- Recording & Transcoding - Record camera feeds and create adaptive streams

Supported Protocols
RTSP (Real-Time Streaming Protocol)
Most common protocol for IP cameras:- RTSP/TCP - Reliable, works through firewalls
- RTSP/UDP - Lower latency, may have packet loss
- RTSP/HTTP - Tunnels through port 80/443
ONVIF (Open Network Video Interface Forum)
Standardized protocol for IP cameras:- Auto-discovery of cameras on network
- Retrieve camera capabilities
- Get RTSP stream URLs automatically
- Control PTZ (Pan-Tilt-Zoom)
- Configure camera settings
ONVIF Integration
Ant Media Server includes a full ONVIF client implementation:Connection Methods
The ONVIF client supports both HTTP and HTTPS:Adding IP Cameras
Via Web Panel
Enter Camera Details
- Name: Friendly name for the camera
- RTSP URL: Full RTSP URL with credentials
- ONVIF Address: (Optional) ONVIF device address
- Username: Camera admin username
- Password: Camera admin password
Configure Options
- Enable recording if needed
- Set up transcoding profiles
- Configure preview generation
Via REST API
Add a camera programmatically:PTZ Control
Control pan, tilt, and zoom on ONVIF cameras:PTZ Movement Types
- Continuous
- Relative
- Absolute
Move continuously until stop command:Parameters:
x: Pan speed (-1.0 to 1.0)y: Tilt speed (-1.0 to 1.0)zoom: Zoom speed (-1.0 to 1.0)
REST API for PTZ
Stop Movement
Camera Settings
Image Settings
Adjust brightness, contrast, etc.:- Brightness - 0.0 to 100.0
- Contrast - 0.0 to 100.0
- Saturation - 0.0 to 100.0
- Sharpness - 0.0 to 100.0
- Focus Mode - Auto / Manual
Get Camera Time
Streaming Configuration
Stream Pull Settings
Configure how AMS pulls from cameras:| Setting | Description | Default |
|---|---|---|
ipCameraPullPeriod | How often to check camera availability (ms) | 10000 |
ipCameraRestartPeriod | Wait time before reconnecting after failure (ms) | 30000 |
ipCameraAutoStart | Auto-start camera streams on server startup | true |
Transport Protocol
Choose between TCP and UDP for RTSP:tcp- More reliable, works through NAT/firewallsudp- Lower latency, may drop packetshttp- Tunnel through HTTP (port 80/443)
Recording Camera Streams
Enable recording for camera streams:Multi-Camera Management
Bulk Operations
Manage multiple cameras efficiently:Camera Groups
Organize cameras by location or purpose:Playback Options
HLS Streaming
Camera feeds available as HLS:WebRTC Playback
Ultra-low latency viewing:Troubleshooting
Cannot connect to camera
Cannot connect to camera
Common causes:
- Wrong IP address or port
- Incorrect username/password
- Camera not on same network
- Firewall blocking RTSP (port 554)
Stream keeps disconnecting
Stream keeps disconnecting
Possible issues:
- Network instability
- Camera firmware issues
- Resource limits on AMS server
- TCP/UDP protocol mismatch
- Increase
ipCameraRestartPeriod - Switch between TCP/UDP transport
- Check camera logs for errors
- Monitor server resources (CPU/memory)
ONVIF discovery not working
ONVIF discovery not working
Reasons:
- Camera doesn’t support ONVIF
- ONVIF disabled in camera settings
- Different subnet
- Authentication required
- Verify ONVIF support in camera specs
- Enable ONVIF in camera web interface
- Use direct RTSP URL instead
- Provide username/password in connection
PTZ controls don't work
PTZ controls don't work
Check:
- Camera supports PTZ
- ONVIF connection established
- Correct profile selected
- PTZ not locked by another client
Best Practices
Use Substreams
Configure cameras to provide multiple streams. Use main stream for recording, substream for live viewing to reduce bandwidth.
Secure Credentials
Never hardcode camera passwords. Use environment variables or secure credential storage.
Monitor Health
Set up alerts for camera disconnections. Use webhooks to get notified when streams fail.
Optimize Storage
Use scheduled recording and configure retention policies to manage storage for camera recordings.
