From 247e31079cc971dbd6f6d72ebf98c126df8ce18d Mon Sep 17 00:00:00 2001 From: Aaron Liu <912394456@qq.com> Date: Tue, 18 Jul 2023 15:18:54 +0800 Subject: [PATCH] fix(thumb): cannot generate thumb using ffmpeg for specific format (#1756) --- pkg/thumb/ffmpeg.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/thumb/ffmpeg.go b/pkg/thumb/ffmpeg.go index 5ad9944..d98f107 100644 --- a/pkg/thumb/ffmpeg.go +++ b/pkg/thumb/ffmpeg.go @@ -67,9 +67,8 @@ func (f *FfmpegGenerator) Generate(ctx context.Context, file io.Reader, src, nam // Invoke ffmpeg scaleOpt := fmt.Sprintf("scale=%s:%s:force_original_aspect_ratio=decrease", options["thumb_width"], options["thumb_height"]) - inputFormat := filepath.Ext(name)[1:] cmd := exec.CommandContext(ctx, - ffmpegOpts["thumb_ffmpeg_path"], "-ss", ffmpegOpts["thumb_ffmpeg_seek"], "-f", inputFormat, "-i", tempInputPath, + ffmpegOpts["thumb_ffmpeg_path"], "-ss", ffmpegOpts["thumb_ffmpeg_seek"], "-i", tempInputPath, "-vf", scaleOpt, "-vframes", "1", tempOutputPath) // Redirect IO