mirror of
https://github.com/owncast/owncast.git
synced 2024-11-25 06:12:23 +03:00
Add default video settings if none are provided
This commit is contained in:
parent
873e2535f8
commit
2bd016ae15
2 changed files with 11 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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…
Reference in a new issue