mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 08:32:24 -05:00
[chore] Thumbnail only first frame of animated media (#3448)
This commit is contained in:
parent
ffc86f9092
commit
602c858379
9 changed files with 76 additions and 17 deletions
|
|
@ -78,23 +78,17 @@ func ffmpegGenerateWebpThumb(ctx context.Context, inpath, outpath string, width,
|
|||
// (NOT as libwebp_anim).
|
||||
"-codec:v", "libwebp",
|
||||
|
||||
// Select thumb from first 7 frames.
|
||||
// (in particular <= 7 reduced memory usage, marginally)
|
||||
// (thumb filter: https://ffmpeg.org/ffmpeg-filters.html#thumbnail)
|
||||
"-filter:v", "thumbnail=n=7,"+
|
||||
// Only one frame
|
||||
"-frames:v", "1",
|
||||
|
||||
// Scale to dimensions
|
||||
// (scale filter: https://ffmpeg.org/ffmpeg-filters.html#scale)
|
||||
"scale="+strconv.Itoa(width)+
|
||||
":"+strconv.Itoa(height)+","+
|
||||
// Scale to dimensions
|
||||
// (scale filter: https://ffmpeg.org/ffmpeg-filters.html#scale)
|
||||
"-filter:v", "scale="+strconv.Itoa(width)+":"+strconv.Itoa(height)+","+
|
||||
|
||||
// Attempt to use original pixel format
|
||||
// (format filter: https://ffmpeg.org/ffmpeg-filters.html#format)
|
||||
"format=pix_fmts="+pixfmt,
|
||||
|
||||
// Only one frame
|
||||
"-frames:v", "1",
|
||||
|
||||
// Quality not specified,
|
||||
// i.e. use default which
|
||||
// should be 75% webp quality.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue