hls_fragment_naming_granularity

The `hls_fragment_naming_granularity` directive specifies the naming granularity of HLS fragments in the NGINX RTMP module.

Syntaxhls_fragment_naming_granularity value;
Defaultnone
Context
Arguments1

Description

The hls_fragment_naming_granularity directive controls how the names of HLS fragment files are constructed. Specifically, it allows for more granularity in naming by taking a timestamp and optionally applying a specific value that determines the fragment naming pattern. This can help facilitate better management of fragments, especially in live streaming scenarios where each fragment must be uniquely identifiable.

In practice, the directive takes an argument in milliseconds, defining the granularity level for naming the HLS segments. For example, if set to 1000, each fragment will be named based on distinct timestamps increments of one second. This method allows developers to work closely with their video segments and helps in avoiding fragment naming clashes, especially in active streams where multiple fragments are created simultaneously.

It's important to note that this directive is typically used in contexts related to real-time media streaming applications where the precise naming of segments is crucial for maintaining a seamless streaming experience. When utilized correctly, it can optimize the performance and organization of the media files produced during streaming sessions.

Config Example

hls_fragment_naming_granularity 1000;

Ensure that the value is set appropriately; too small may lead to excessive file creation and resource usage.

Remember that this directive is context-specific—refer to documentation for valid contexts.

← Back to all directives