SRT parameter description

1. Timeout option

connect_timeout
connection timeout, in milliseconds, the default value is 3 seconds.
SRT fails to connect when RTT > 1500 ms (2 handshake exchanges). This option is available in caller and rendezvous modes.
listen_timeout
listening timeout, in milliseconds
timeout
sets the error timeout for read, write and connection operations, in milliseconds. Note that the SRT library has internal timeouts that can be controlled individually, and the value set here is only an upper bound on these timeouts.

2. Cache related options

FFS
window size in bytes, default value is 25600.
FFS is actually an internal parameter and should be set to no less than recv_buffer_size and mss. The default value is relatively large, so you don't need to change this option unless you set a very large receiver buffer.
mss
maximum segment size, in bytes, default value 1500, which is the maximum length of UDP packets. The entire Internet defaults to 1500 and will generally only be reduced unless you have some unusual private network setup.
recv_buffer_size
UDP receive buffer size, in bytes.
send_buffer_size
UDP send buffer size, in bytes.
sndbuf
sets the send buffer size in bytes.
rcvbuf
sets the receive buffer size in bytes. The receive buffer cannot be larger than ffs.

3. Bandwidth or code rate related options

The input rate of the inputbw
sender, in bytes/second, the default value is 0.
Used with oheadbw, when maxbw is set to relative (0), to calculate the maximum send rate when sending recovery packets with the main media stream: inputbw * (100 + oheadbw) / 100. If inputbw is not set and maxbw is set to relative (0), the actual input rate is calculated in the library.
The recovery bandwidth overhead of oheadbw
higher than the input rate (inputbw), expressed as a percentage, the default value is 25%
maxbw
maximum sending bandwidth, in bytes/second, the default value is 0. -1 means no limit (CSRTCC limit is 30mbps); 0 means it depends on the input rate;

4. Delay related options

latency
is the packet sending delay based on the timestamp, in milliseconds. Used to handle emergencies of data packet retransmission. This flag sets rcvlatency and peerlatency to the same value. Please note that prior to version 1.3.0 this was the only flag to set latency, however this is actually equivalent to setting peerlatency (when side is the sender) and rcvlatency (when side is the receiver), and is not supported bidirectionally stream sent.
The peerlatency
delay value (as described in rcvlatency) is set by the sender to the minimum value of the receiver, in milliseconds.
rcvlatency
The time that should elapse before the data packet is sent to the receiver, in milliseconds. This time should be a buffer time large enough to cover the time spent sending, unexpectedly extended RTT times, and the time required to retransmit lost UDP packets. The effective latency value will be the maximum of this option's value and the peerlatency value set by the peer.

snddropdelay
Additional delay before the sender drops the packet, which is added to the default delay interval value. Special value -1: Do not discard packets, unit is milliseconds.

5. Mode related options

mode
connection mode, the possible values ​​are caller, listener and rendezvous, the default value is caller.

messageapi
When set, the socket uses the Message API, otherwise the Buffer API is used.
Please note that in live mode, only the Message API can be used.
In file mode, you can choose to use one of two modes:
Stream API (default, when this option is false). You can send as much data as you want in a single send command, and you can even read directly from a file using dedicated functions. Internal facilities will be responsible for any speed and congestion control. When receiving, you can receive as much data as you need, and unread data will wait for the next call. In Stream mode, there are no boundaries between data parts.
Message API. In this mode, a single send command only transfers a bounded piece of data (message). Contrary to Live mode, this message can span multiple UDP packets, the only size limit is that it should fit in the send buffer as a whole. The receiver should use as large a buffer as possible to receive messages so that messages are not dropped. When a message is incomplete (not all packets received or packets are lost), it will not be abandoned.

transtype=live|file
The transmission type of the socket, which can take the values ​​live and file. It's worth noting that this option sets several other parameters to the default values ​​required for the specific transfer type.
live: The transmission type is set to real-time transmission. In this mode, a send command only sends one suitable UDP packet data. There is no speed control in real-time transmission mode, only bandwidth control. If bandwidth control is configured, it is also to not exceed the bandwidth (retransmission and control packets).
file: Set the option to non-real-time transmission. See message API

Smoother type of smoother
socket transmission, which is responsible for transmission and congestion control, and can take the values ​​​​live and file. The smoothing type on both sides of the connection must be exactly the same, otherwise the connection will be refused.

6. Encryption related options

pbkeylen
sender encryption key length, unit byte, can only be set to 0, 16, 24, 32, the default value is 0. If non-zero, sender encryption is enabled. Not required by the receiver (set to 0), the key size obtained from the sender in the HaiCrypt handshake.
passphrase
HaiCrypt encrypts/decrypts password strings with a length of 10 ~ 79 characters. The cipher characters are a shared secret between the sender and receiver. For generating encryption keys using PBKDF2. Only has effect if pbkeylen is non-zero. Only if the received data is encrypted it will be used on the receiver. Configured password characters cannot be recovered (write only).
If enforced_encryption
is 1, both parties to the connection must set the same password (including an empty password, that is, no encryption). If the passwords don't match or only one side is unencrypted, the connection is refused. Default is 1.

kmrefreshrate
The number of data packets to be transmitted after the encryption key is converted to a new key. The default value is -1. The value range is an integer from 0 to INT_MAX. -1 means automatic.

The time interval between kmpreannounce
sending a new encryption key and handover. The default value is -1, and the value range is 0 to INT_MAX. This value also applies to subsequent intervals between the switch occurring and the old encryption key being retired.

7. Packet options

payload_size
In Live mode, the maximum packet size for a single transmission. The default value is -1 (auto), which usually means MPEG-TS. If this value is not used, 0 is used (the default in file mode). If you plan to use SRT to send any different type of payload, for example, encapsulating a live stream in very small frames, then you can use a larger maximum frame size, but no larger than 1456 bytes.
pkt_size
Alias ​​for 'payload_size'.

tlpktdrop
drops packets too late. When enabled on the receiving end, lost packets that are not delivered in time will be skipped and subsequent packets will be delivered to the application when the time for playback arrives. It will also send a fake ACK to the sender. If enabled on both the sender and receiver, the sender discards old messages that have no chance of being sent in time. If the receiver supports it, it is automatically enabled in the sender.

8. Other options

iptos
IP service type, the default value is 0xB8. Applies to sender only.

ipttl=ttl
IP survival time, the default value is 64. Applies to sender only.

Whether nakreport
sends 'UMSG_LOSSREPORT' messages periodically, default value 1. If set to 1, the receiving end will send 'UMSG_LOSSREPORT' messages periodically until the lost packet is retransmitted or dropped intentionally.

lossmaxttl
When the lossmaxttl value is reached, Reorder Tolerance can grow. When Reorder Tolerance > 0, packet loss reporting will be delayed until this number of packets arrive. The Reorder Tolerance will increase every time a "late" packet arrives, but this is not due to retransmissions (rather UDP packets tend to be out of order), the latest sequence will not differ more than this packet sequence The value of the option. By default, it is 0, meaning that with the mechanism turned off, a loss report will be sent immediately when a "gap" in the sequence is encountered.

minversion
requires the minimum SRT version provided by the peer. Connections to peers that do not meet the minimum version requirements will be refused. The version format is hexadecimal (0xXXYYZZ).

The streamid
is a string of no more than 512 characters and needs to be set on the socket before connecting. It can be used in scenarios of monitoring and responding to multiple requests, similar to RTMP's APPPATH.

When the linger
socket is closed, the number of seconds to wait for unsent data, the default value is -1, and the value range is an integer from 0 to INT_MAX. -1 means automatic (off at 0 seconds in real-time mode, on at 180 seconds in file mode). of this option.

tsbpd=1|0
When true, use timestamp-based packet transmission mode. The default behavior depends on the transfer type: enabled in live mode, disabled in file mode.

Guess you like

Origin blog.csdn.net/weixin_35804181/article/details/132718040