on_update

The 'on_update' directive allows defining a callback URL that is triggered whenever a stream update occurs.

Syntaxon_update URL;
Defaultnone
Context
Arguments1

Description

The 'on_update' directive is part of the NGINX RTMP module and serves as a configurable parameter to specify an HTTP callback that will be notified upon certain streaming events, such as when a stream is started or stopped. It expects a single argument: the URL to which the callback will be sent. This can facilitate integration with external systems that need to track the status of the streaming process in real time, enabling functionalities like notifications, logging, or remote management of the streaming session.

When enabled, the NGINX server will make an HTTP request to the specified URL whenever an update event related to RTMP streaming occurs. The HTTP method used is typically POST, and it can include various contextual information about the event. This allows external applications, such as content management systems or monitoring tools, to react dynamically to changes in the stream state. The format of the data sent in the request can vary based on the implementation, but it generally contains identifiers and state information relevant to the stream.

This directive is particularly useful in scenarios that involve automation or requires real-time awareness of the system’s state changes, allowing for better control and flexibility of the media streaming environment.

Config Example

rtmp {
    server {
        listen 1935;

        application live {
            live on;
            on_update http://example.com/stream/update;
        }
    }
}

Ensure that the URL is accessible by the NGINX server and properly handles incoming requests.

Be cautious with network latency as it may affect stream responsiveness, especially if the callback involves external servers.

← Back to all directives