mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-02-21 20:59:04 +00:00
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:
parent
e7fc354729
commit
de70b93cc6
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user