From 80bc88c1330c5cf6f5da0ec9252f905e30037f59 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Fri, 27 Jul 2018 11:45:05 +0200 Subject: Nice ffmpeg to 15 and 2 Niceness 15 for video conversionNiceness 2 for image generation (niceness 2 doesn't make it slower, just don't block servers and other app) --- server/helpers/ffmpeg-utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/helpers') diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index 13bce7d30..ab187aa59 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts @@ -1,7 +1,7 @@ import * as ffmpeg from 'fluent-ffmpeg' import { join } from 'path' import { VideoResolution } from '../../shared/models/videos' -import { CONFIG, VIDEO_TRANSCODING_FPS } from '../initializers' +import { CONFIG, VIDEO_TRANSCODING_FPS, FFMPEG_NICE } from '../initializers' import { unlinkPromise } from './core-utils' import { processImage } from './image-utils' import { logger } from './logger' @@ -56,7 +56,7 @@ async function generateImageFromVideoFile (fromPath: string, folder: string, ima try { await new Promise((res, rej) => { - ffmpeg(fromPath) + ffmpeg(fromPath, { 'niceness': FFMPEG_NICE.THUMBNAIL }) .on('error', rej) .on('end', () => res(imageName)) .thumbnail(options) @@ -84,7 +84,7 @@ type TranscodeOptions = { function transcode (options: TranscodeOptions) { return new Promise(async (res, rej) => { - let command = ffmpeg(options.inputPath) + let command = ffmpeg(options.inputPath, { 'niceness': FFMPEG_NICE.TRANSCODING }) .output(options.outputPath) .outputOption('-threads ' + CONFIG.TRANSCODING.THREADS) .renice(5) // we don't want to make the system unrepsonsive -- cgit v1.2.3