ts_dash

The `ts_dash` directive enables the generation of live MPEG-DASH streams in a specified location.

Syntaxts_dash path=PATH [segment=MIN[:MAX]] [segments=NUMBER] [max_size=SIZE] [noclean];
Defaultnone
Contextlocation
Arguments1+

Description

The ts_dash directive is part of the NGINX MPEG-TS Live Module and is used to create and manage live MPEG-DASH streams. This directive is essential for handling MPEG-TS data and making it accessible via MPEG-DASH, a widely-used format for adaptive streaming. When defined within a location block in the NGINX configuration, it allows the server to receive MPEG-TS streams from sources like FFmpeg and subsequently serve them as MPEG-DASH content to clients.

The directive takes several parameters, including path, which specifies the directory where the DASH manifest and segment files will be generated. The segment parameter indicates the minimum and maximum duration for each video segment, with missing values defaulting to preset times, ensuring smooth playback. Additionally, the segments parameter limits the number of segments retained in the playlist, thereby controlling the size of the playback playlist. Lastly, the max_size parameter permits setting a maximum size for each segment, ensuring that no segment exceeds a specified size during live streaming.

Config Example

location /live {
    ts;
    ts_dash path=/var/dash segment=10s;
}

Ensure to specify a valid path; NGINX must have write permissions to that directory.

Misconfiguring segment durations may lead to playback issues for clients.

Using incompatible values for segment min/max durations can result in unpredictable segment lengths.

← Back to all directives