publish_time_fix

The `publish_time_fix` directive adjusts the publication timestamp of the RTMP stream.

Syntaxpublish_time_fix on | off;
Defaultoff
Context
Arguments1

Description

The publish_time_fix directive in the NGINX RTMP module is used to rectify issues with inaccurate timestamps that can occur during the streaming process. Specifically, it addresses scenarios where the publication time of an incoming stream may not align properly with the actual content being streamed due to delays or other anomalies. When this directive is enabled, it forces the module to use the correct timestamp for the stream, ensuring smoother playback and synchronization for viewers.

This directive takes a single argument, which typically specifies a boolean value, indicating whether time correction should be applied (1) or not (0). The behavior it alters is critical for applications where precise timing is essential, such as in live broadcasts where content must be synchronized with real-time events. By maintaining accurate timestamps, publish_time_fix helps to provide a more reliable streaming experience for users watching the content.

It is worth noting that using this feature may require testing to see if it complements the existing settings or introduces latency that could affect live performance. The directive should be used carefully to ensure it aligns with the overall streaming strategy and viewer experience objectives.

Config Example

application live {
    live on;
    publish_time_fix on;
}

Ensure the timestamp settings of the source stream are correctly configured before enabling this directive.

Using publish_time_fix may introduce latency; test its impact on your specific streaming use case.

← Back to all directives