vod_align_segments_to_key_frames

Aligns segment boundaries to key frames for video on-demand packaging.

Syntaxvod_align_segments_to_key_frames on | off;
Defaultoff
Contexthttp, server, location
Arguments1

Description

The 'vod_align_segments_to_key_frames' directive in the NGINX-based VOD Packager module configures the server to align the segment boundaries of video content to key frames in the video stream. This is particularly important for adaptive streaming protocols such as HLS or DASH, where segmenting video files efficiently can enhance playback performance and ensure smooth transitions during streaming. When this directive is enabled, segments will be cut precisely at key frames, avoiding playback issues that may arise from cutting segments at non-key frames, such as artifacts or buffering.

This directive accepts a single argument, which is typically a boolean value: 'on' or 'off'. By default, this setting is 'off', meaning that segments may not strictly align with key frames. When the directive is set to 'on', the video processing mechanism actively seeks the nearest key frame to ensure that each segment begins with a key frame, thereby optimizing playback. This configuration is applied at the 'http', 'server', or 'location' blocks in the NGINX configuration file, making it versatile for application across different server contexts.

Config Example

location /vod {
    vod_align_segments_to_key_frames on;
}

Ensure that the video files being processed contain key frames; otherwise, aligning to key frames may cause segments to be overly long or yield no valid segments.

Be cautious about resource usage when encoding segments; aligning segments to key frames may increase processing time depending on video length and complexity.

← Back to all directives