SRT protocol

SRT is an open protocol designed by Haivision. Based on the UDT protocol. It has wide distribution and good packet loss performance.

Use cases:

  • Peer between Perfect Streamer instances. On the transmitter — configured in the output, listen mode (default). In this mode several receivers can be connected. For authorization, logins for the receivers must be set in Peer. On the receiver — configured in the input. The host and port of the transmitter are specified, as well as login and password. To pass login and password, the SRT streamer uses streamid in the format login|password.

  • Peer between Perfect Streamer and any third-party SRT streamers. On the transmitter you can set up SRT client mode by switching off listen. The SRT streamid, if required, is entered in the login field. For listen mode, IP-address authorization is available — entered in the login field in Peer. On the receiver you can enable listen mode, set the SRT streamid in the login field, and also specify the host from which reception is allowed.

Work in the Listener mode: receiving and transmitting a TV channel stream with the indication of the receiving port.

Ports for listen mode must be unique.

Encryption of streams is available (Crypto protection), AES-128 is used. To enable encryption on both sides, enter Crypt Passphrase — a shared key.

If the transmitter uses the listen mode (default), then the connection is initiated by the receiver, and the transmitter requires authentication, the receivers are registered in the peers section. Login and password required.

SRT protocol options match the description — API-socket-options.md

Reorder (SRTO_LOSSMAXTTL) — The value to which the reorder tolerance can increase. Reorder tolerance is the number of packets that must follow a detected ‘gap’ in the sequence numbers of incoming packets before a loss report is sent (in the hope that the gap is caused by packet reordering rather than loss). The reorder tolerance value starts at 0 and increases when packet reordering is detected. This occurs when a ‘late’ packet is received with a sequence number higher than the last received one, but without the retransmission flag. Upon such detection, the reorder tolerance is set to the value of the interval between the last number and the sequence number of that packet, but not more than the value set by the SRTO_LOSSMAXTTL parameter. By default, this value is 0, which means that this mechanism is disabled. SRTO_LOSSMAXTTL

Overhead (SRTO_OHEADBW, %) — Overhead for bandwidth recovery beyond the input rate (see SRTO_INPUTBW), as a percentage of the input rate. Effective only if SRTO_MAXBW is set to 0. Sender: user-configurable, default: 25%.

Recommendations: Overhead is intended to provide additional bandwidth capacity in case a packet has taken up some bandwidth but is then lost and needs to be retransmitted. Therefore, the effective maximum bandwidth should be sufficiently higher than the bitrate of your stream to leave room for retransmissions, while being limited so that retransmitted packets do not lead to a sharp increase in bandwidth usage when large groups of packets are lost. Do not set too low a value and avoid 0 if the SRTO_INPUTBW parameter is set to 0 (automatic). Otherwise, your stream will quickly interrupt with any increase in packet loss. SRTO_OHEADBW

Max Band (SRTO_MAXBW, bps) — This option is effective only when SRTO_MAXBW is set to 0 (relative). It controls the maximum bandwidth together with the SRTO_OHEADBW parameter according to the formula: MAXBW = INPUTBW * (100 + OHEADBW) / 100. If this option is set to 0 (automatic), the actual INPUTBW value will be estimated based on the input stream (cases where the application calls the srt_send* function) during transmission. The minimum allowable estimate value is limited by the SRTO_MININPUTBW parameter, i.e. INPUTBW = MAX(INPUTBW_ESTIMATE; MININPUTBW).

Recommendations: Set this parameter to the expected bitrate of your broadcast and leave the default value of 25% for SRTO_OHEADBW. SRTO_INPUTBW

Timeout (SRTO_CONNTIMEO, ms) — Value of the connection timeout in milliseconds. This is the time during which the connecting object will try to connect and wait for a response from the remote endpoint, before terminating the connection with an error code. SRTO_CONNTIMEO