RTSP ingest¶
Sapsan pulls video from IP cameras and other RTSP sources in client (pull) mode.
Configuration¶
streams:
cam1:
inputs:
- rtsp:
url: rtsp://admin:password@10.0.0.5:554/stream0
peer_timeout_ms: 5000
| Parameter | Description |
|---|---|
url |
camera address; login and password go in the URL |
peer_timeout_ms |
source inactivity timeout after which the input is considered down |
via_agent |
ingest through a Peeklio agent (agent://ID) when the camera is behind NAT — see Peeklio gateway |
Authentication¶
Basic and Digest are supported (with automatic fallback to Basic when the camera rejects Digest). Credentials come from the URL and are not sent to the camera in the clear when Digest is used.
Codecs and transport¶
Transport is RTP/AVP/TCP (interleaved), robust against NAT and firewalls. Decoded: H264, HEVC, VP8, MJPEG video; AAC, G.711 (PCMA/PCMU), Opus, MPEG-4 audio; ONVIF metadata (camera events) straight from the RTP stream. RTP timestamp wraparound and rollback are handled.
The SDP parser is battle-tested against real cameras: Axis, Hikvision, Dahua, Bosch, Panasonic, Uniview, Beward, and others — including cameras with malformed SDP (missing PPS, broken SEI).
Note
G.711 audio does not play over HLS — add a transcoder that re-encodes audio to AAC.
Applying changes¶
Changing url or via_agent restarts the source; changing only peer_timeout_ms applies in place.
Verification¶
Open http://server/streaming/v/cam1/index.m3u8 in a player or request a screenshot at http://server/streaming/live-preview-jpeg/cam1.