gop_max_video_count

The `gop_max_video_count` directive limits the maximum number of video segments in a Group of Pictures (GOP) for adaptive streaming.

Syntaxgop_max_video_count number;
Defaultnone
Context
Arguments1

Description

The gop_max_video_count directive is used in NGINX's RTMP module to define the maximum number of video segments that can be stored in a Group of Pictures (GOP). This is particularly relevant when handling adaptive bitrate streaming, where the GOP structure helps manage the video's temporal accessibility and latency during playback. By limiting the video segment count, this directive helps to ensure that the media streaming does not consume excessive server resources, which can be crucial when serving many concurrent streams.

When the configured maximum of video segments is reached, the older segments will be discarded to accommodate the new ones. This mechanism helps in maintaining a balance between resource usage and playback quality. The parameter takes an integer value, designating the maximum allowable video segments. Configurations that exceed the server's limitations in terms of memory or processing capacity can lead to degraded performance or resource exhaustion.

By carefully configuring the gop_max_video_count, administrators can optimize streaming performance while ensuring a consistent and reliable user experience. The directive is placed within the RTMP application configuration block to take effect during streaming operations.

Config Example

application live {
    gop_max_video_count 10;
}

Setting a value that is too high may lead to excessive memory usage.

If video segments are not properly managed, users may experience delays or buffering during playback.

← Back to all directives