From d082580ee04dee2fbac71a8186e6fe7a78e4d275 Mon Sep 17 00:00:00 2001 From: ExceptionalError <43562640+ExceptionalError@users.noreply.github.com> Date: Wed, 9 Oct 2019 06:15:00 +0200 Subject: [PATCH 1/3] modified args for screenshot --- pkg/ffmpeg/encoder_screenshot.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/ffmpeg/encoder_screenshot.go b/pkg/ffmpeg/encoder_screenshot.go index 47853249d..cb018e33b 100644 --- a/pkg/ffmpeg/encoder_screenshot.go +++ b/pkg/ffmpeg/encoder_screenshot.go @@ -18,14 +18,14 @@ func (e *Encoder) Screenshot(probeResult VideoFile, options ScreenshotOptions) { options.Quality = 1 } args := []string{ - "-v", options.Verbosity, - "-ss", fmt.Sprintf("%v", options.Time), + "-v " + options.Verbosity, + fmt.Sprintf("-ss %v", options.Time), "-y", - "-i", `"` + probeResult.Path + `"`, - "-vframes", "1", - "-q:v", fmt.Sprintf("%v", options.Quality), - "-vf", fmt.Sprintf("scale=%v:-1", options.Width), - "-f", "image2", + "-i \"" + probeResult.Path + "\"", + "-vframes 1", + fmt.Sprintf("-q:v %v", options.Quality), + fmt.Sprintf("-vf scale=%v:-1", options.Width), + "-f image2", options.OutputPath, } _, _ = e.run(probeResult, args) From 10af75a6701b50fabc0ce1b273da2d43df8b10d4 Mon Sep 17 00:00:00 2001 From: ExceptionalError <43562640+ExceptionalError@users.noreply.github.com> Date: Wed, 9 Oct 2019 06:16:17 +0200 Subject: [PATCH 2/3] Added output of error message --- pkg/ffmpeg/encoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ffmpeg/encoder.go b/pkg/ffmpeg/encoder.go index caf6413b6..2cf03d483 100644 --- a/pkg/ffmpeg/encoder.go +++ b/pkg/ffmpeg/encoder.go @@ -57,7 +57,7 @@ func (e *Encoder) run(probeResult VideoFile, args []string) (string, error) { stdoutString := string(stdoutData) if err := cmd.Wait(); err != nil { - logger.Errorf("ffmpeg error when running command <%s>", strings.Join(cmd.Args, " ")) + logger.Errorf("ffmpeg error when running command <%s>: %s", strings.Join(cmd.Args, " "), stdoutString) return stdoutString, err } From 4eb843d83ea5d087c4cb9fe532b762288e20a070 Mon Sep 17 00:00:00 2001 From: ExceptionalError <43562640+ExceptionalError@users.noreply.github.com> Date: Sat, 12 Oct 2019 16:04:00 +0200 Subject: [PATCH 3/3] revert changes #117 --- pkg/ffmpeg/encoder_screenshot.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/ffmpeg/encoder_screenshot.go b/pkg/ffmpeg/encoder_screenshot.go index cb018e33b..14ced4d18 100644 --- a/pkg/ffmpeg/encoder_screenshot.go +++ b/pkg/ffmpeg/encoder_screenshot.go @@ -18,14 +18,14 @@ func (e *Encoder) Screenshot(probeResult VideoFile, options ScreenshotOptions) { options.Quality = 1 } args := []string{ - "-v " + options.Verbosity, - fmt.Sprintf("-ss %v", options.Time), + "-v", options.Verbosity, + "-ss", fmt.Sprintf("%v", options.Time), "-y", - "-i \"" + probeResult.Path + "\"", - "-vframes 1", - fmt.Sprintf("-q:v %v", options.Quality), - fmt.Sprintf("-vf scale=%v:-1", options.Width), - "-f image2", + "-i", probeResult.Path, // TODO: Wrap in quotes? + "-vframes", "1", + "-q:v", fmt.Sprintf("%v", options.Quality), + "-vf", fmt.Sprintf("scale=%v:-1", options.Width), + "-f", "image2", options.OutputPath, } _, _ = e.run(probeResult, args)