From f7bb2bb5a753b3f1a37301dcff2d58e434ecd3af Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Oct 2021 10:37:25 +0200 Subject: Don't use min FPS, throw instead Avoir creating a big output from a very low FPS input file --- server/helpers/ffprobe-utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/helpers') diff --git a/server/helpers/ffprobe-utils.ts b/server/helpers/ffprobe-utils.ts index 8381dee84..767f37f9c 100644 --- a/server/helpers/ffprobe-utils.ts +++ b/server/helpers/ffprobe-utils.ts @@ -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 } -- cgit v1.2.3