From 991feec9a3f371e28274884f7635dc2e57dca284 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Fri, 27 Jul 2018 20:41:05 +0200 Subject: ffmpeg auto thread Set thread count to 0 and ffmpeg will chose automaticaly --- server/helpers/ffmpeg-utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index f0e2c0af5..c170fc1a8 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts @@ -86,8 +86,10 @@ function transcode (options: TranscodeOptions) { return new Promise(async (res, rej) => { let command = ffmpeg(options.inputPath, { 'niceness': FFMPEG_NICE.TRANSCODING }) .output(options.outputPath) - .outputOption('-threads ' + CONFIG.TRANSCODING.THREADS) .preset(standard) + if (CONFIG.TRANSCODING.THREADS > 0) { + command.outputOption('-threads ' + CONFIG.TRANSCODING.THREADS) // if we don't set any threads ffmpeg will chose automatically + } let fps = await getVideoFileFPS(options.inputPath) if (options.resolution !== undefined) { -- cgit v1.2.3