rtmp_auto_push

The `rtmp_auto_push` directive enables automatic stream pushing across multiple NGINX worker processes to facilitate multi-worker live streaming.

Syntaxrtmp_auto_push on;
Defaultoff
Contextmain
Arguments1

Description

The rtmp_auto_push directive is used to manage the broadcasting of RTMP streams across different worker processes in an NGINX server. This feature is particularly useful in scenarios involving multiple streams, where a single publisher sends data to multiple subscribers concurrently. By enabling this directive, the NGINX RTMP module can automatically distribute outgoing streams to other workers, ensuring efficient load balancing and minimizing latency. This is essential for creating a scalable and responsive live streaming solution where multiple users are expected to watch streams simultaneously. When the rtmp_auto_push directive is set to 'on', the server will handle the internal logic to push streams to available workers, improving performance and reliability in high-traffic environments.

In practical terms, setting this directive in the server block means that as soon as a stream is published, it can be pushed automatically to other workers without additional configurations on the publisher's side. This capability allows for seamless integration of live broadcasts, as the server can handle increased traffic without significant manual intervention or complex scripting. The directive accepts a single argument, typically specified as 'on', which enables this automatic pushing of streams across configured worker processes, enhancing the overall performance and user experience of the RTMP streaming service.

Config Example

rtmp {
    server {
        listen 1935;

        application live {
            live on;
            rtmp_auto_push on;
        }
    }
}

Ensure that your NGINX installation is built with the RTMP module for this directive to work.

Using this directive in conjunction with other stream management settings can lead to unexpected behavior if not configured properly.

If you're operating on Windows, note that automatic stream pushing is not supported and could lead to confusion in configurations.

← Back to all directives