Video streams need a keyframe to start each file, so wait until the next video keyframe afterrecord_interval before rotating the file.
Audio-only streams will always have brkframe = true, so will always be eligible to rotate.
Test: with record_interval 1m, sending a video stream (h264+aac) with a keyframe interval of 10 seconds causes the segments to not always be cut on the same second:
Fixes https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/issues/335
Video streams need a keyframe to start each file, so wait until the next video keyframe after
record_interval
before rotating the file.Audio-only streams will always have
brkframe = true
, so will always be eligible to rotate.Test: with
record_interval 1m
, sending a video stream (h264+aac
) with a keyframe interval of 10 seconds causes the segments to not always be cut on the same second:Playing back all segments in sequence (or concatenating it into a single file) results in a continuous stream, with no missing frames or stuttering.