recv_latency

The `recv_latency` directive configures the maximum receive latency for SRT connections, enhancing control over SRT stream behavior.

Syntaxrecv_latency milliseconds;
Defaultnone
Context
Arguments1

Description

The recv_latency directive plays a critical role in managing the reception behavior in SRT (Secure Reliable Transport) connections established via the NGINX SRT module. By defining a latency value, this directive influences how SRT handles incoming data packets before delivery to the application. It essentially helps balance the trade-off between timely data delivery and jitter, minimizing variations in packet arrival times.

The maximum latency specified by this directive can help protect against sudden variations in the network, allowing SRT to buffer packets and smooth out data flows. If the network experiences fluctuations or latency spikes, the SRT protocol can make use of this buffer to maintain a stable stream, providing a more consistent playback experience for users. Setting this value requires careful consideration of the application's tolerance for delays versus its need for real-time data.

The directive accepts a single argument, which is an integer value representing the desired maximum receive latency in milliseconds. An appropriate setting for recv_latency depends on the specific requirements of the use case and the underlying network conditions. If not configured, SRT may use its default latency behavior, which might not be optimal for all scenarios.

Config Example

recv_latency 100;

Setting the latency too high can introduce desirable buffering but may degrade real-time experience.

Not all network environments might benefit equally from configured latency, adjustments should be tested based on actual throughput.

← Back to all directives