Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Add missing niceness to ffmpeg thumbnail processes

Chocobozzza4a8cd39712c
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts
index a4d02908dd..f85b9f3168 100644
--- a/server/helpers/ffmpeg-utils.ts
+++ b/server/helpers/ffmpeg-utils.ts
@@ -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)
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 0b4b412731..a78a66d784 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -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
}