Register name used to load filter: rtspout
The RTSP server partially implements RTSP 1.0, with support for OPTIONS, DESCRIBE, SETUP, PLAY, PAUSE and TEARDOWN.
Multiple PLAY ranges are not supported, PLAY range end is not supported, PAUSE range is not supported.
Only aggregated control is supported for PLAY and PAUSE, PAUSE/PLAY on single stream is not supported.
The server only runs on TCP, and handles request in sequence (will not probe for commands until previous response was sent).
The server supports both RTP over UDP delivery and RTP interleaved over RTSP delivery.
The filter can work as a simple output filter by specifying the dst option:
gpac -i source -o rtsp://myip/sessionname
gpac -i source dst=rtsp://myip/sessionname
In this mode, only one session is possible. It is possible to loop the input source(s).
The filter can work as a regular RTSP server by specifying the mounts option to indicate paths of media file to be served:
In server mode, it is possible to load any source supported by gpac by setting the option dynurl.
The expected syntax of the dynamic RTSP URLs is
Each URL can be absolute or local, in which case it is resolved against the mount point(s).
gpac -i rtsp://localhost/?pipe://mynamepipe&myfile.mp4 [dst filters]
The server will resolve this URL in a new session containing streams from myfile.mp4 and streams from pipe mynamepipe.
When setting runfor in server mode, the server will exit at the end of the last session being closed.
In both modes, clients can setup multicast if the mcast option is
When mcast is set to
mirror mode, any DESCRIBE command on a resource already delivered through a multicast session will use that multicast.
Consequently, only DESCRIBE methods are processed for such sessions, other methods will return Unauthorized.
The scheduling algorithm and RTP options are the same as the RTP output filter, see gpac -h rtpout
dst (string): location of destination file - see filter help
port (unsigned int, default: 554): server port
firstport (unsigned int, default: 6000): port for first stream in session
mtu (unsigned int, default: 1460): size of RTP MTU in bytes
ttl (unsigned int, default: 0): time-to-live for muticast packets. A value of 0 uses client requested TTL, or 1
ifce (string): default network inteface to use
payt (unsigned int, default: 96, minmax: 96-127): payload type to use for dynamic configs.
mpeg4 (boolean, default: false): send all streams using MPEG-4 generic payload format if posible
delay (int, default: 0): send delay for packet (negative means send earlier)
tt (unsigned int, default: 1000): time tolerance in microseconds. Whenever schedule time minus realtime is below this value, the packet is sent right away
runfor (int, default: -1): run the session for the given time in ms. Negative value means run for ever (if loop) or source duration, 0 only outputs the sdp
tso (int, default: -1): set timestamp offset in microsecs. Negative value means random initial timestamp
xps (boolean, default: false): force parameter set injection at each SAP. If not set, only inject if different from SDP ones
latm (boolean, default: false): use latm for AAC payload format
mounts (string list): list of directories to expose in server mode
block_size (unsigned int, default: 10000): block size used to read TCP socket
maxc (unsigned int, default: 100): maximum number of connections
user_agent (string, default: $GUA): user agent string, by default solved from GPAC preferences
close (boolean, default: true): close RTSP connection after each request, except when RTP over RTSP is used
loop (boolean, default: true): loop all streams in session (not always possible depending on source type) - see filter help.
dynurl (boolean, default: false): allow dynamic service assembly - see filter help.
mcast (enum, default: off): control multicast setup of a session.
- off: clients are never allowed to create a multicast
- on: clients can create multicast sessions
- mirror: clients can create a multicast session. Any later request to the same URL will use that multicast session