feat: configure timemark for video thumbnails

This commit is contained in:
Bobby 2022-09-24 06:24:56 +07:00
parent 2952765513
commit 32efacd411
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09
2 changed files with 7 additions and 2 deletions

View File

@ -594,7 +594,10 @@ module.exports = {
video: true,
// Placeholder defaults to 'public/images/unavailable.png'.
placeholder: null,
size: 200
size: 200,
// https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/tree/v2.1.2#screenshotsoptions-dirname-generate-thumbnails
// Only accepts a single value. Defaults to 20%.
videoTimemark: '20%'
},
/*

View File

@ -524,7 +524,9 @@ self.generateThumbs = async (name, extname, force) => {
.screenshots({
folder: paths.thumbs,
filename: name.slice(0, -extname.length) + '.png',
timestamps: ['20%'],
timemarks: [
config.uploads.generateThumbs.videoTimemark || '20%'
],
size: videoStream.width >= videoStream.height
? `${self.thumbsSize}x?`
: `?x${self.thumbsSize}`