Oup's
authorChocobozzz <me@florianbigard.com>
Wed, 17 Oct 2018 15:58:21 +0000 (17:58 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 17 Oct 2018 15:58:21 +0000 (17:58 +0200)
server/helpers/ffmpeg-utils.ts

index a53a7bae40d9b12bb7e858f9828ab08ea0c44ad7..037bf703a4bfae96ebfecd28986bd64e575f2b63 100644 (file)
@@ -118,13 +118,13 @@ function transcode (options: TranscodeOptions) {
   return new Promise<void>(async (res, rej) => {
     let fps = await getVideoFileFPS(options.inputPath)
     // On small/medium resolutions, limit FPS
-    // if (
-    //   options.resolution !== undefined &&
-    //   options.resolution < VIDEO_TRANSCODING_FPS.KEEP_ORIGIN_FPS_RESOLUTION_MIN &&
-    //   fps > VIDEO_TRANSCODING_FPS.AVERAGE
-    // ) {
-    //   fps = VIDEO_TRANSCODING_FPS.AVERAGE
-    // }
+    if (
+      options.resolution !== undefined &&
+      options.resolution < VIDEO_TRANSCODING_FPS.KEEP_ORIGIN_FPS_RESOLUTION_MIN &&
+      fps > VIDEO_TRANSCODING_FPS.AVERAGE
+    ) {
+      fps = VIDEO_TRANSCODING_FPS.AVERAGE
+    }
 
     let command = ffmpeg(options.inputPath, { niceness: FFMPEG_NICE.TRANSCODING })
                     .output(options.outputPath)