Skip to content

Commit

Permalink
fix(thumb): cannot generate thumb using ffmpeg for specific format (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
HFO4 committed Jul 18, 2023
1 parent a26893a commit 247e310
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/thumb/ffmpeg.go
Expand Up @@ -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
Expand Down

0 comments on commit 247e310

Please sign in to comment.