]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/ffprobe-utils.ts
Don't use min FPS, throw instead
[github/Chocobozzz/PeerTube.git] / server / helpers / ffprobe-utils.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
 }