thumbnail generation fix and scale

ffmpeg can sometimes generate broken thumbnails (sometimes a full grey image) when it seeks in the input instead of the output. When it's added after the input, it is a bit slower but it is more stable and will fixes the issue for various formats like HEVC or Prores.

The resolution could benefit from being increased 3x for users who scale up the webpage in their browser or tablet views. It becomes scaled up 200% or 300% when viewed on a smaller screen.
This commit is contained in:
camjac251 2020-05-29 05:51:38 -05:00 committed by GitHub
parent e7fc354729
commit de70b93cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,12 +265,12 @@ self.generateThumbs = async (name, extname, force) => {
await new Promise((resolve, reject) => {
ffmpeg(input)
.inputOptions([
`-ss ${duration * 20 / 100}`
])
.output(thumbname)
.outputOptions([
`-ss ${duration * 20 / 100}`,
'-vframes 1',
'-vf scale=200:200:force_original_aspect_ratio=decrease'
'-vf scale=600:600:force_original_aspect_ratio=decrease'
])
.on('error', async error => {
// Try to unlink thumbnail,