Make setting the segment length optional
This commit is contained in:
parent
51e2e68017
commit
d51901e191
@ -31,7 +31,6 @@ instanceDetails:
|
|||||||
url: http://soundcloud.com/owncast
|
url: http://soundcloud.com/owncast
|
||||||
|
|
||||||
videoSettings:
|
videoSettings:
|
||||||
chunkLengthInSeconds: 4
|
|
||||||
streamingKey: abc123
|
streamingKey: abc123
|
||||||
offlineContent: static/offline.m4v # Is displayed when a stream ends
|
offlineContent: static/offline.m4v # Is displayed when a stream ends
|
||||||
|
|
||||||
|
@ -155,6 +155,15 @@ func (c *config) GetFFMpegPath() string {
|
|||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) GetVideoSegmentSecondsLength() int {
|
||||||
|
if c.VideoSettings.ChunkLengthInSeconds != 0 {
|
||||||
|
return c.VideoSettings.ChunkLengthInSeconds
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default
|
||||||
|
return 4
|
||||||
|
}
|
||||||
|
|
||||||
//Load tries to load the configuration file
|
//Load tries to load the configuration file
|
||||||
func Load(filePath string, versionInfo string) error {
|
func Load(filePath string, versionInfo string) error {
|
||||||
Config = new(config)
|
Config = new(config)
|
||||||
|
@ -190,7 +190,7 @@ func NewTranscoder() Transcoder {
|
|||||||
transcoder.playlistOutputPath = config.Config.PublicHLSPath
|
transcoder.playlistOutputPath = config.Config.PublicHLSPath
|
||||||
|
|
||||||
transcoder.input = utils.GetTemporaryPipePath()
|
transcoder.input = utils.GetTemporaryPipePath()
|
||||||
transcoder.segmentLengthSeconds = config.Config.VideoSettings.ChunkLengthInSeconds
|
transcoder.segmentLengthSeconds = config.Config.GetVideoSegmentSecondsLength()
|
||||||
|
|
||||||
qualities := config.Config.VideoSettings.StreamQualities
|
qualities := config.Config.VideoSettings.StreamQualities
|
||||||
if len(qualities) == 0 {
|
if len(qualities) == 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user