Skip to content

Commit

Permalink
use lower of segment duration and keyframe interval (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 authored Apr 10, 2024
1 parent 6b1c207 commit 1ed7616
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/config/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ func (p *PipelineConfig) updateEncodedOutputs(req egress.EncodedOutput) error {
}

if segmentConf := p.Outputs[types.EgressTypeSegments]; segmentConf != nil {
if stream != nil && p.KeyFrameInterval > 0 {
// segment duration must match keyframe interval - use the lower of the two
conf := segmentConf[0].(*SegmentConfig)
conf.SegmentDuration = min(int(p.KeyFrameInterval), conf.SegmentDuration)
}
p.KeyFrameInterval = 0
} else if p.KeyFrameInterval == 0 && p.Outputs[types.EgressTypeStream] != nil {
// default 4s for streams
Expand Down

0 comments on commit 1ed7616

Please sign in to comment.