]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add missing niceness to ffmpeg thumbnail processes
authorChocobozzz <me@florianbigard.com>
Wed, 27 Jan 2021 08:09:59 +0000 (09:09 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 27 Jan 2021 08:09:59 +0000 (09:09 +0100)
server/helpers/ffmpeg-utils.ts
server/initializers/constants.ts

index a4d02908ddcd7ee7aa0e50ef8df57845077267da..f85b9f316872bd24102d6b5e6f2a233b202e5266 100644 (file)
@@ -56,7 +56,7 @@ export type AvailableEncoders = {
 // ---------------------------------------------------------------------------
 
 function convertWebPToJPG (path: string, destination: string): Promise<void> {
-  const command = ffmpeg(path)
+  const command = ffmpeg(path, { niceness: FFMPEG_NICE.THUMBNAIL })
     .output(destination)
 
   return runCommand(command)
@@ -67,7 +67,7 @@ function processGIF (
   destination: string,
   newSize: { width: number, height: number }
 ): Promise<void> {
-  const command = ffmpeg(path)
+  const command = ffmpeg(path, { niceness: FFMPEG_NICE.THUMBNAIL })
     .fps(20)
     .size(`${newSize.width}x${newSize.height}`)
     .output(destination)
index 0b4b412731a5456e21d4f37fde7cd84333eccf2e..a78a66d78409a01326251bdecea1be8f93cc4af1 100644 (file)
@@ -362,8 +362,8 @@ const VIDEO_RATE_TYPES: { [ id: string ]: VideoRateType } = {
 const FFMPEG_NICE: { [ id: string ]: number } = {
   // parent process defaults to niceness = 0
   // reminder: lower = higher priority, max value is 19, lowest is -20
-  THUMBNAIL: 2, // low value in order to avoid blocking server
-  LIVE: 9, // prioritize over VOD
+  LIVE: 5, // prioritize over VOD and THUMBNAIL
+  THUMBNAIL: 10,
   VOD: 15
 }