live
The 'live' directive enables live streaming for a specific application in the NGINX RTMP module.
Description
The 'live' directive is used within the NGINX RTMP module to designate an application as a live streaming endpoint. When enabled, this directive allows for the streaming of live video feeds from publishers to multiple viewers. This means that users can publish their streams in real-time and have them immediately accessible to clients subscribing to that stream.
This directive accepts a single argument—typically 'on'—to activate live streaming for the application context. Additionally, it facilitates features such as recording of streams, access control for publishing and playing, and support for transcoding streams for compatibility with various codecs and formats. When a client publishes a stream to this application, it becomes available for subscribers instantly, emphasizing the directive's role in real-time media delivery.
In practical use, combining the 'live' directive with other configuration options such as recording settings can enhance the functionality of the streaming application. Users can easily manage streams, apply security measures, and optimize performance according to their specific requirements and scenarios.
Config Example
rtmp {
server {
listen 1935;
application live {
live on;
allow publish all;
allow play all;
}
}
}Ensure that the 'live' directive is set in the correct application context; it should not be declared in the server context directly.
Be cautious with resource limits; excessive simultaneous connections can lead to performance degradation.
When switching from a recorded stream to a live stream, ensure the proper configuration to avoid interruptions.