Using SRT protocol
SRT (Secure Reliable Transport) is an open source video transport protocol based UDP transport protocol. It provides low latency and smooth delivery of the content. SRT minimizes packet loss while reducing the video quality to provide continuous playback, which is crucial for sports streaming, live events, etc. However, unlike TCP, SRT packet loss is possible if necessary to ensure low latency.
Thus, SRT combines the advantages of UDP and TCP: the ability to resend lost packets and to guarantee a low delay. There are two basic ways to achieve this:
- Track the receiver lagging relative to the transmitter in a certain time window and resend lost packets during this window. This method is well suited for delivering video over the Internet.
- Send redundant packets, i.e. send some data from neighboring packets with each packet. This method is best used for satellite signal delivery, because individual bits may well be lost in satellite networks while either the entire packet is lost or the whole packet arrives intact on the Internet.
SRT in Flussonic
Setting up the reception and transmission of streams via SRT in Flussonic is performed in standard ways. The main task is to correctly form the URL of the stream. Below is the general information needed to do this, and on the next pages in the section you will find configuration examples and URL examples.
SRT protocol offers three modes: Caller, Listener, and Rendezvous. Flussonic supports the following modes:
- SRT publication. Flussonic acts as Listener while awaiting to get the stream from the Caller.
- SRT ingest. Flussonic acts as Caller by initializing the connection and requesting the stream from the source.
- SRT push. Flussonic acts as Caller because it is the source of the stream forcefully sent to another server.
- SRT playback. Flussonic acts as Listener waiting for the request from the Caller to send the stream.
The mode is stated in the stream's URL using the
Transmitting an SRT stream requires specifying the
streamid parameter that is a string of maximum 512 characters set on the socket before the connection. This string is a part of a callback that is sent by the Caller and registered by the Listener. Based on this information the Listener can accept or reject the connection, select the desired data stream, or set an appropriate passphrase for the connection.
Its format is
#!:: optionally followed by the parameters:
r=— stream name
m=— mode expected for the connection:
publish(if the Caller wants to send the stream data) or
request(if the Caller wants to receive the stream)
password=— a password for the authorization in a publish session (not recommended, better use the
passphraseURL parameter instead because it is expected by most of clients)
During SRT sessions between two Flussonics, the following parameters are automatically added to
s=— the identifier of a session
a=— Flussonic version
See also developer's guide.
When ingesting or pushing over SRT, the port and
streamid settings are set on the side of the client application which generates the stream URL. When setting up publishing and playing, the stream URL is defined by Flussonic, so it is important to choose the right way to specify the port for streams. Flussonic offers flexible configuration of SRT ports for transmitting and receiving video. The way you choose to specify the port will affect the form of
streamid that you will need to use to receive or transmit streams. There are the following setting options:
Set a separate SRT port for each stream or group of streams (i.e. template). This is the best option supported by most third-party clients. You can use the
srtoption in the stream configuration if the same port will be used for playback and publishing, or
srt_publishif the ports for playback and publishing are different. Specifying the stream name in the
r=parameter is optional, because it is already set in the configuration. If you use
srt, be sure to specify the connection mode in the
Set a global port for all modes of receiving and transmitting all SRT streams on your server. This method is more suitable for testing purposes, as it is not supported by third-party clients. You can set the port at Config - Settings in the UI.
Corresponding global option in the configuration file is
You can also set separate global ports for playback
srt_publish. This can only be done in the config file. This mode is also not supported by most clients.
If you use
srt, be sure to specify the connection mode in the
streamid, while this option is not required when you use
srt_publishbecause the connection mode is already known for the specified port. Specifying the stream name in
r=is mandatory because it is not clear which stream you want to access when using a global port.
Set the range of ports for publishing and playing streams in the
listenersdirective. This method is used in conjunction with
config_externalwhen it is necessary to determine the name of a stream from its SRT port. Learn more in the API schema.
If you set both global and local port settings simultaneously, the local port settings take precedence and are applied first.
A summary table of
streamid values for different connection modes, depending on how the port is specified:
streamid specifies the mode that characterize the source, so
m=publish is specified for publishing even though Flussonic is in Listener mode, and
m=request for capturing even though Flussonic acts as Caller.
In any mode of receiving or transmitting streams via SRT Flussonic supports the following parameters:
||x.y.z||The minimum SRT version that is required from the peer.||
||x.y.z||Required SRT version.||
||boolean||If set to
||string||Password for the encrypted transmission. Its length should be not less than 10 and not more than 79 characters. Default value is an empty string (
||seconds||If set to
||seconds||The time socket waits for the unsent data when closing. Set to
||seconds||Connection timeout. Equals to
||milliseconds||Packet delivery delay. Used to absorb bursts of missed packet retransmissions. Default value is set to