Selectable wall preview type (#510)

* Add optional image preview generation
* Add setting for video preview encoding preset
This commit is contained in:
InfiniteTF
2020-05-27 01:33:49 +02:00
committed by GitHub
parent 197918d13c
commit 4ec6d62e01
18 changed files with 499 additions and 347 deletions

View File

@@ -13,9 +13,10 @@ type ScenePreviewChunkOptions struct {
OutputPath string
}
func (e *Encoder) ScenePreviewVideoChunk(probeResult VideoFile, options ScenePreviewChunkOptions) {
func (e *Encoder) ScenePreviewVideoChunk(probeResult VideoFile, options ScenePreviewChunkOptions, preset string) {
args := []string{
"-v", "error",
"-xerror",
"-ss", strconv.Itoa(options.Time),
"-i", probeResult.Path,
"-t", "0.75",
@@ -25,7 +26,7 @@ func (e *Encoder) ScenePreviewVideoChunk(probeResult VideoFile, options ScenePre
"-pix_fmt", "yuv420p",
"-profile:v", "high",
"-level", "4.2",
"-preset", "slow",
"-preset", preset,
"-crf", "21",
"-threads", "4",
"-vf", fmt.Sprintf("scale=%v:-2", options.Width),