ts_buffer_size

The 'ts_buffer_size' directive sets the buffer size for transmitting transport stream packets in Kaltura Media Framework.

Syntaxts_buffer_size size;
Defaultnone
Contextstream, stream server
Arguments1

Description

The 'ts_buffer_size' directive is used within the context of stream and stream server blocks in NGINX to define the size of the buffer allocated for the transmission of transport stream data. Specifically, this parameter allows for the efficient handling of streaming media, particularly in scenarios where large volumes of data must be buffered before being sent to clients. This is especially relevant for live streaming applications where latency and data integrity are critical.

When configured, the value defined by 'ts_buffer_size' dictates the amount of memory to reserve for buffering transport stream (TS) packets. This can help mitigate issues related to network latency or fluctuations in bandwidth, ensuring smoother transmission during playback. The value is specified in bytes and directly influences how much data can be accumulated before the NGINX server must push it to the downstream clients or processors. A larger buffer size may help in maintaining a smoother streaming experience; however, it can also increase memory usage on the server. Therefore, it's important to balance the buffer size based on the expected traffic and resource availability.

Additionally, while setting this directive, it's important to consider client capabilities and the underlying network infrastructure, as excessively large buffers may lead to increased latency. For smaller streams or lower-capacity servers, a conservative buffer size may preserve performance without introducing undue memory strain. Overall, this directive plays a vital role in optimizing media delivery pipelines within the Kaltura Media Framework architecture.

Config Example

stream {
    server {
        listen 1935;
        ts_buffer_size 8k;
    }
}

Using an excessively large buffer may lead to increased latency in media playback.

Ensure the buffer size is compatible with the client's capabilities; some clients may not handle large buffers well.

Adjusting this directive can affect overall memory usage on the server, so monitor resources accordingly.

← Back to all directives