mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-02-21 20:59:04 +00:00
Potentially much better video thumbnails
Notable changes, use fluent-ffmpeg's functions instead of passing raw ffmpeg switches with inputOptions() or outputOptions(). It seems fluent-ffmpeg may be doing some janks with outputOptions(). I can't get select="eq(pict_type\\,I)" to work with it, but it works with videoFilters(). Weird stuff.
This commit is contained in:
parent
8b4b0e79c5
commit
28c64d531a
@ -261,14 +261,19 @@ self.generateThumbs = async (name, extname, force) => {
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
ffmpeg(input)
|
||||
.inputOptions([
|
||||
`-ss ${duration * 20 / 100}`
|
||||
.seekInput(duration * 20 / 100)
|
||||
.frames(1)
|
||||
.videoFilters([
|
||||
{
|
||||
filter: 'select',
|
||||
options: 'eq(pict_type\\,I)'
|
||||
},
|
||||
{
|
||||
filter: 'scale',
|
||||
options: '200:200:force_original_aspect_ratio=decrease'
|
||||
}
|
||||
])
|
||||
.output(thumbname)
|
||||
.outputOptions([
|
||||
'-vframes 1',
|
||||
'-vf scale=200:200:force_original_aspect_ratio=decrease'
|
||||
])
|
||||
.on('error', async error => {
|
||||
// Try to unlink thumbnail,
|
||||
// since ffmpeg may have created an incomplete thumbnail
|
||||
|
Loading…
Reference in New Issue
Block a user