hls_path

The 'hls_path' directive specifies the file path for HLS segments and playlists generated by the NGINX RTMP module.

Syntaxhls_path path;
Defaultnone
Context
Arguments1

Description

The 'hls_path' directive is essential for configuring the location where HTTP Live Streaming (HLS) segments and playlists will be stored when using the NGINX RTMP module. It allows the user to indicate a specific directory on the server's filesystem for HLS content, enabling the live streaming of multimedia content efficiently. When a stream is published, the HLS segments (.ts files) and playlists (.m3u8 files) are generated in the specified directory, thus making it easier for clients to access the streamed media subsequently.

This directive accepts a single argument which specifies the path to use for storing the generated HLS segments and playlists. It is commonly used in conjunction with other directives such as 'dash' which allows for multi-protocol streaming configurations. The specified path must be writable by the NGINX worker processes to ensure that it can generate and store the necessary streaming files without errors.

By correctly configuring the 'hls_path', users can manage their media contents systematically and apply further configurations such as directory cleanup or segment management, ensuring a fluid streaming experience for end-users. It's important to note that the path should be set following the directory structure that fits the application requirements, ultimately facilitating easy access to HLS resources through a web server setup.

Config Example

hls_path /var/www/html/hls;

Ensure the specified path exists and has the correct permissions for NGINX to write files.

Remember to set proper access controls for the HLS directory to avoid unauthorized access.

Overwriting existing segments or playlists can lead to unexpected behavior; plan the file naming and rotation accordingly.

← Back to all directives