From 5324d235bf32e70d1091444c2459bcb559a89c03 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Thu, 29 Apr 2021 14:26:25 -0700 Subject: [PATCH] Force an i-frame every second for consistent segment lenghts with minimum latency. --- core/transcoder/transcoder.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core/transcoder/transcoder.go b/core/transcoder/transcoder.go index a7b0d0901..93c72ad4f 100644 --- a/core/transcoder/transcoder.go +++ b/core/transcoder/transcoder.go @@ -327,14 +327,7 @@ func (v *HLSVariant) getVideoQualityString(t *Transcoder) string { return fmt.Sprintf("-map v:0 -c:v:%d copy", v.index) } - // Determine if we should force key frames every 1, 2 or 3 frames. - isEven := t.currentLatencyLevel.SecondsPerSegment%2 == 0 - gop := v.framerate * 2 - if t.currentLatencyLevel.SecondsPerSegment == 1 { - gop = v.framerate - } else if !isEven { - gop = v.framerate * 3 - } + gop := v.framerate // force an i-frame every second // For limiting the output bitrate // https://trac.ffmpeg.org/wiki/Limiting%20the%20output%20bitrate