ffmpeg: generate smart previews as .png instead of .jpg
Generate smart previews as .png so we don't suffer recompression losses when we convert the preview frame from a full size image down to a 150x150 .jpg thumbnail.
This commit is contained in:
@@ -14,12 +14,12 @@ class FFmpeg
|
|||||||
@file = file.is_a?(String) ? File.open(file) : file
|
@file = file.is_a?(String) ? File.open(file) : file
|
||||||
end
|
end
|
||||||
|
|
||||||
# Generate a .jpg preview image for a video or animation. Generates
|
# Generate a .png preview image for a video or animation. Generates
|
||||||
# thumbnails intelligently by avoiding blank frames.
|
# thumbnails intelligently by avoiding blank frames.
|
||||||
#
|
#
|
||||||
# @return [MediaFile] the preview image
|
# @return [MediaFile] the preview image
|
||||||
def smart_video_preview
|
def smart_video_preview
|
||||||
vp = Tempfile.new(["video-preview", ".jpg"], binmode: true)
|
vp = Tempfile.new(["video-preview", ".png"], binmode: true)
|
||||||
|
|
||||||
# https://ffmpeg.org/ffmpeg.html#Main-options
|
# https://ffmpeg.org/ffmpeg.html#Main-options
|
||||||
# https://ffmpeg.org/ffmpeg-filters.html#thumbnail
|
# https://ffmpeg.org/ffmpeg-filters.html#thumbnail
|
||||||
|
|||||||
Reference in New Issue
Block a user