reordered cli arguments for ffmpeg to improve speed to generate thumbnails from videos (#917)
This commit is contained in:
parent
b8504c47be
commit
68cc2a0eee
|
@ -143,12 +143,12 @@ func (worker *FfmpegWorker) EncodeVideoThumbnail(inputPath string, outputPath st
|
||||||
thumbnailOffsetSeconds := fmt.Sprintf("%d", int(probeData.Format.DurationSeconds*0.25))
|
thumbnailOffsetSeconds := fmt.Sprintf("%d", int(probeData.Format.DurationSeconds*0.25))
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
|
"-ss", thumbnailOffsetSeconds, // grab frame at time offset
|
||||||
"-i",
|
"-i",
|
||||||
inputPath,
|
inputPath,
|
||||||
"-vframes", "1", // output one frame
|
"-vframes", "1", // output one frame
|
||||||
"-an", // disable audio
|
"-an", // disable audio
|
||||||
"-vf", "scale='min(1024,iw)':'min(1024,ih)':force_original_aspect_ratio=decrease:force_divisible_by=2",
|
"-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,
|
outputPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue