segment_duration
The `segment_duration` directive sets the duration of segments in media streams processed by the Kaltura Media Framework module for NGINX.
Description
The segment_duration directive is used to define the length of media segments that are generated by the Kaltura Media Framework for streaming. This directive is crucial when utilizing adaptive bitrate streaming protocols such as HLS or DASH, where the media content is divided into smaller, manageable segments. The specified duration helps ensure consistency in playback and buffering behavior across different devices and network conditions.
When setting the segment_duration, you should consider the nature of the content and the target audience. Shorter segments can lead to more frequent HTTP requests, while longer segments might improve network utilization by reducing the number of requests. However, they may also increase start-up latency on the client side. This directive accepts a single argument, which specifies the duration in seconds for each segment that is created during media streaming.
It’s important to note that if the segment duration does not match the codec-specific settings (e.g., GOP size in video encoding), it may result in suboptimal stream performance. Therefore, tuning the segment_duration should take into account other media encoding parameters to achieve the best results during streaming.
Config Example
segment_duration 10;
Segment duration must be a positive integer value.
Setting a very short segment duration can lead to excessive overhead in network requests.
Ensure segment duration aligns with video frame GOP to avoid playback issues.