vod_segment_duration

The `vod_segment_duration` directive sets the segment duration for video on demand (VOD) packaging in NGINX.

Syntaxvod_segment_duration seconds;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The vod_segment_duration directive is used within the NGINX-based VOD packager module to define the length of video segments created during the packaging process. This length is specified in seconds and allows content providers to optimize their media for streaming by controlling the duration of each segment. Shorter segment durations can improve adaptability to changing bandwidth conditions at the expense of increasing the number of segments and potentially increasing load on the server due to more frequent segment requests from the client.

When using this directive, the specified duration will apply to each segment generated from the input media file. For example, if the duration is set to 10 seconds, the output video will consist of segments, each lasting 10 seconds, which can then be used for adaptive streaming technologies such as HLS or DASH. This segmentation also aids in more efficient buffering and preloading, allowing for smoother playback experiences for end-users.

Using the vod_segment_duration directive is straightforward; the only argument required is the duration in seconds. This directive must be placed within the appropriate contexts, namely http, server, or location blocks. The effective configuration enables video on demand services to meet various operational and delivery requirements while ensuring high performance and flexibility.

Config Example

http {
    server {
        location /vod {
            vod_segment_duration 10;
        }
    }
}

Setting segment duration too short may increase server load due to high frequency of requests.

Ensure that the segment duration does not exceed the available bitrate of the input media to avoid playback issues.

← Back to all directives