mp4_start_key_frame
The `mp4_start_key_frame` directive configures the HTTP MP4 streaming module to begin video playback from a designated key-frame. — NGINX HTTP Core
Описание
The `mp4_start_key_frame` directive is part of the NGINX HTTP MP4 module that allows users to control the starting point of video playback in MP4 files. When this directive is enabled, NGINX will begin streaming from the closest preceding key-frame in the video stream when a user requests a specific timestamp. This behavior is particularly important for streaming applications where seamless playback is necessary, as it prevents playback from starting on a non-key-frame, which would lead to buffering or playback issues. By default, this directive is turned off, meaning playback might start at any given point in the stream that may not necessarily correlate with a key-frame, potentially affecting performance and user experience.
Пример конфига
mp4; mp4_start_key_frame on;
Ensure that the MP4 files being served contain proper key frames for seamless streaming.
Using this directive may increase the initial load time if the key-frame is far from the requested timestamp.