Fix storyboard generation with some videos

Where `t` variable is never an integer due to our setpts formula
pull/6266/head
Chocobozzz 2024-03-11 15:40:14 +01:00
parent 23aafafd1e
commit 888b142e2e
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 1 deletions

View File

@ -119,8 +119,10 @@ export class FFmpegImage {
const command = this.commandWrapper.buildCommand(path)
const filter = [
// Fix "t" variable with some videos
`setpts=N/round(FRAME_RATE)/TB`,
`select='not(mod(t,${options.sprites.duration}))'`,
// First frame or the time difference between the last and the current frame is enough for our sprite interval
`select='isnan(prev_selected_t)+gte(t-prev_selected_t,${options.sprites.duration})'`,
`scale=${sprites.size.width}:${sprites.size.height}`,
`tile=layout=${sprites.count.width}x${sprites.count.height}`
].join(',')