hls_sync
The `hls_sync` directive configures synchronization settings for HLS output streams in the NGINX RTMP module.
Description
The hls_sync directive within the NGINX RTMP module is designed to control how HLS (HTTP Live Streaming) segments should be synced over a series of streams. When enabled, this directive helps ensure that HLS clients can play back streams without experienced discrepancies in playback timing, which is critical for live broadcast scenarios. The directive works by adjusting the timestamps of incoming HLS segments to maintain consistency across distributed playback, particularly beneficial for multi-bitrate streams or scenarios where segments from multiple sources may be aggregated.
The parameter for hls_sync is a boolean value, where setting it to 'on' activates synchronization strategies for HLS streams. If left 'off', or not specified, NGINX will not perform any synchronization between HLS segments, which might result in desynchronized playback, especially under varying network conditions or client capabilities. The default behavior, therefore, is to remain unsynchronized unless explicitly turned on by this directive.
By implementing hls_sync, administrators can improve the viewing experience by providing smoother playback with fewer interruptions caused by timing offsets between stream segments. This is especially important in scenarios where viewers are switching between different streaming qualities or sources. The directive is typically used in conjunction with other HLS-related settings, optimizing the overall streaming configuration for live events or broadcasting applications.
Config Example
hls {
hls_sync on;
hls_fragment 5s;
hls_playlist_length 60s;
}Ensure hls_sync is set to 'on' for applications that require precise synchronization between multiple segments.
Misconfiguring hls_sync may lead to playback issues if other HLS settings are not compatible with synchronization requirements.