Add configurable transcode sizes (#178)

This commit is contained in:
WithoutPants
2019-11-05 08:38:33 +11:00
committed by Leopere
parent be12a9f5a1
commit d1ea2fffa5
10 changed files with 241 additions and 55 deletions

View File

@@ -1,11 +1,13 @@
package manager
import (
"github.com/stashapp/stash/pkg/ffmpeg"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/models"
"os"
"sync"
"github.com/stashapp/stash/pkg/ffmpeg"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/manager/config"
"github.com/stashapp/stash/pkg/models"
)
type GenerateTranscodeTask struct {
@@ -33,8 +35,10 @@ func (t *GenerateTranscodeTask) Start(wg *sync.WaitGroup) {
}
outputPath := instance.Paths.Generated.GetTmpPath(t.Scene.Checksum + ".mp4")
transcodeSize := config.GetMaxTranscodeSize()
options := ffmpeg.TranscodeOptions{
OutputPath: outputPath,
OutputPath: outputPath,
MaxTranscodeSize: transcodeSize,
}
encoder := ffmpeg.NewEncoder(instance.FFMPEGPath)
encoder.Transcode(*videoFile, options)