Browse Source

Add default video settings if none are provided

pull/53/head
Gabe Kangas 5 years ago
parent
commit
2bd016ae15
  1. 13
      config-example.yaml
  2. 9
      core/ffmpeg/transcoder.go

13
config-example.yaml

@ -37,17 +37,10 @@ videoSettings: @@ -37,17 +37,10 @@ videoSettings:
offlineContent: static/offline.m4v # Is displayed when a stream ends
streamQualities:
# Pass through the exact video and audio that you're streaming.
- full:
videoPassthrough: true
audioPassthrough: true
# Transcode the video to a lower bitrate and resize
# - low:
# videoBitrate: 700
# scaledWidth: 600
# audioPassthrough: true
# encoderPreset: superfast
- medium:
videoBitrate: 800
encoderPreset: superfast
files:
maxNumberInPlaylist: 30

9
core/ffmpeg/transcoder.go

@ -192,7 +192,14 @@ func NewTranscoder() Transcoder { @@ -192,7 +192,14 @@ func NewTranscoder() Transcoder {
transcoder.input = utils.GetTemporaryPipePath()
transcoder.segmentLengthSeconds = config.Config.VideoSettings.ChunkLengthInSeconds
for index, quality := range config.Config.VideoSettings.StreamQualities {
qualities := config.Config.VideoSettings.StreamQualities
if len(qualities) == 0 {
defaultQuality := config.StreamQuality{}
defaultQuality.VideoBitrate = 1000
defaultQuality.EncoderPreset = "superfast"
qualities = append(qualities, defaultQuality)
}
for index, quality := range qualities {
variant := getVariantFromConfigQuality(quality, index)
transcoder.AddVariant(variant)
}

Loading…
Cancel
Save