reordered cli arguments for ffmpeg to improve speed to generate thumbnails from videos (#917)

This commit is contained in:
Andreas
2024-03-29 20:35:50 +01:00
committed by GitHub
parent b8504c47be
commit 68cc2a0eee

View File

@@ -143,12 +143,12 @@ func (worker *FfmpegWorker) EncodeVideoThumbnail(inputPath string, outputPath st
thumbnailOffsetSeconds := fmt.Sprintf("%d", int(probeData.Format.DurationSeconds*0.25))
args := []string{
"-ss", thumbnailOffsetSeconds, // grab frame at time offset
"-i",
inputPath,
"-vframes", "1", // output one frame
"-an", // disable audio
"-vf", "scale='min(1024,iw)':'min(1024,ih)':force_original_aspect_ratio=decrease:force_divisible_by=2",
"-ss", thumbnailOffsetSeconds, // grab frame at time offset
outputPath,
}