Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix storyboard generation with some videos

Chocobozzz888b142e2ef9
diff --git a/packages/ffmpeg/src/ffmpeg-images.ts b/packages/ffmpeg/src/ffmpeg-images.ts
index 296cd10fba..52076de546 100644
--- a/packages/ffmpeg/src/ffmpeg-images.ts
+++ b/packages/ffmpeg/src/ffmpeg-images.ts
@@ -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(',')