Skip to content

Commit

Permalink
no keyframe interval for segments (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 authored Feb 26, 2024
1 parent 552fc86 commit 8ea6b05
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/config/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8ea6b05

Please sign in to comment.