Enable passthrough video, where there is no reencoding and is lighterweight

This commit is contained in:
Gabe Kangas
2020-06-12 12:55:50 -07:00
parent 6439075f36
commit d53fe98543
5 changed files with 40 additions and 21 deletions

View File

@@ -53,13 +53,16 @@ func getVariantIndexFromPath(fullDiskPath string) int {
var variants []Variant
func monitorVideoContent(pathToMonitor string, configuration Config, storage ChunkStorage) {
// Create structures to store the segments for the different stream variants
// Create at least one structure to store the segments for the different stream variants
variants = make([]Variant, len(configuration.VideoSettings.StreamQualities))
for index := range variants {
variants[index] = Variant{index, make([]Segment, 0)}
if len(configuration.VideoSettings.StreamQualities) > 0 && !configuration.VideoSettings.EnablePassthrough {
for index := range variants {
variants[index] = Variant{index, make([]Segment, 0)}
}
} else {
variants[0] = Variant{0, make([]Segment, 0)}
}
log.Printf("Using %s for storing files with %d variants...\n", pathToMonitor, len(variants))
log.Printf("Using directory %s for storing files with %d variants...\n", pathToMonitor, len(variants))
w := watcher.New()