mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Support image clips/gifs (#3583)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@ var ErrUnsupportedFormat = errors.New("unsupported image format")
|
||||
|
||||
type ImageThumbnailOptions struct {
|
||||
InputFormat ffmpeg.ImageFormat
|
||||
OutputFormat ffmpeg.ImageFormat
|
||||
OutputPath string
|
||||
MaxDimensions int
|
||||
Quality int
|
||||
@@ -29,12 +30,15 @@ func ImageThumbnail(input string, options ImageThumbnailOptions) ffmpeg.Args {
|
||||
VideoFilter(videoFilter).
|
||||
VideoCodec(ffmpeg.VideoCodecMJpeg)
|
||||
|
||||
args = append(args, "-frames:v", "1")
|
||||
|
||||
if options.Quality > 0 {
|
||||
args = args.FixedQualityScaleVideo(options.Quality)
|
||||
}
|
||||
|
||||
args = args.ImageFormat(ffmpeg.ImageFormatImage2Pipe).
|
||||
Output(options.OutputPath)
|
||||
Output(options.OutputPath).
|
||||
ImageFormat(options.OutputFormat)
|
||||
|
||||
return args
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user