dash
The 'dash' directive enables support for MPEG-DASH within an NGINX RTMP application.
Description
The 'dash' directive is an essential part of the NGINX RTMP module, allowing server administrators to configure their RTMP applications to support MPEG-DASH streaming. When this directive is set to 'on', it facilitates the segmented streaming of media files through Dynamic Adaptive Streaming over HTTP (MPEG-DASH), which is crucial for adapting video quality dynamically according to network conditions. The directive takes a single argument: 'on' or 'off', where 'on' enables MPEG-DASH processing, and 'off' disables it. The MPEG-DASH process involves creating media segments along with an accompanying manifest file that instructs compatible clients on how to retrieve those segments.
The directive is typically placed in an application block of the NGINX RTMP configuration, and when enabled, additional parameters such as 'dash_fragment', 'dash_path', and 'dash_playlist_length' become relevant. These parameters allow further customization, such as specifying the length of each fragment, setting the storage path for DASH files, and managing playlist lengths. Upon streaming initiation, the server handles the creation and management of both video and audio tracks, ensuring clients can seamlessly switch between different quality levels based on their connection capabilities. The NGINX process creates corresponding files and metadata as specified, ensuring a smooth streaming experience.
Usage of this directive provides significant advantages for applications needing scalable video formats over the web. However, it's essential to ensure that the correct supporting directives are also configured for the best performance and compatibility with various video playback systems, including browsers and mobile devices. As with any configuration in a streaming context, testing and validation are essential after initial setup to ensure proper operation.
Config Example
application live {
dash on;
dash_path /tmp/dash;
dash_fragment 1000;
dash_playlist_length 60000;
}Make sure the required parameters for DASH are properly configured; failing to set 'dash_path' can lead to errors in file generation.
Monitor stream performance, as enabling DASH may introduce overhead on resource usage, particularly on lower-end servers.
Ensure the output paths have the appropriate permissions for NGINX to read/write.