]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Don't use min FPS, throw instead
authorChocobozzz <me@florianbigard.com>
Tue, 12 Oct 2021 08:37:25 +0000 (10:37 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 12 Oct 2021 08:37:25 +0000 (10:37 +0200)
Avoir creating a big output from a very low FPS input file

server/helpers/ffprobe-utils.ts
server/initializers/constants.ts

index 8381dee84facea27f4b9bbd18173e97fd745f452..767f37f9ca3141fbfd539321e1605c42908c1ba0 100644 (file)
@@ -302,7 +302,10 @@ function computeFPS (fpsArg: number, resolution: VideoResolution) {
 
   // Hard FPS limits
   if (fps > VIDEO_TRANSCODING_FPS.MAX) fps = getClosestFramerateStandard(fps, 'HD_STANDARD')
-  else if (fps < VIDEO_TRANSCODING_FPS.MIN) fps = VIDEO_TRANSCODING_FPS.MIN
+
+  if (fps < VIDEO_TRANSCODING_FPS.MIN) {
+    throw new Error(`Cannot compute FPS because ${fps} is lower than our minimum value ${VIDEO_TRANSCODING_FPS.MIN}`)
+  }
 
   return fps
 }
index 2fa0aa7bfbab06b6d237bbdb9de81fd0550b6ff2..facd3b721fc5cc96359d7efa42ff9e2567ddf042 100644 (file)
@@ -346,7 +346,7 @@ const VIEW_LIFETIME = {
 let CONTACT_FORM_LIFETIME = 60000 * 60 // 1 hour
 
 const VIDEO_TRANSCODING_FPS: VideoTranscodingFPS = {
-  MIN: 10,
+  MIN: 1,
   STANDARD: [ 24, 25, 30 ],
   HD_STANDARD: [ 50, 60 ],
   AVERAGE: 30,