From 8ea6b05f4290009a81f999bd785dc32d31888d77 Mon Sep 17 00:00:00 2001 From: David Colburn Date: Mon, 26 Feb 2024 14:21:54 -0800 Subject: [PATCH] no keyframe interval for segments (#618) --- pkg/config/output.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/config/output.go b/pkg/config/output.go index eea6403e..7d546ca6 100644 --- a/pkg/config/output.go +++ b/pkg/config/output.go @@ -163,12 +163,11 @@ func (p *PipelineConfig) updateEncodedOutputs(req EncodedOutput) error { } } - if p.KeyFrameInterval == 0 && p.Outputs[types.EgressTypeStream] != nil { + if segmentConf := p.Outputs[types.EgressTypeSegments]; segmentConf != nil { + p.KeyFrameInterval = 0 + } else if p.KeyFrameInterval == 0 && p.Outputs[types.EgressTypeStream] != nil { // default 4s for streams p.KeyFrameInterval = 4 - } else if segmentConf := p.Outputs[types.EgressTypeSegments]; segmentConf != nil && len(segmentConf) > 0 { - // double the segment length - p.KeyFrameInterval = float64(2 * segmentConf[0].(*SegmentConfig).SegmentDuration) } err := p.updateImageOutputs(images)