From 34e5095e167117bf4e0f0986cd7003367ad8b2d7 Mon Sep 17 00:00:00 2001 From: Moe Date: Tue, 9 Oct 2018 16:26:49 -0700 Subject: [PATCH] make "availableHWAccels" configurable --- libs/ffmpeg.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libs/ffmpeg.js b/libs/ffmpeg.js index 1dac20bd..2672a374 100644 --- a/libs/ffmpeg.js +++ b/libs/ffmpeg.js @@ -86,15 +86,17 @@ module.exports = function(s,config,onFinish){ } //check available hardware acceleration methods var checkFfmpegHwAccelMethods = function(callback){ - hwAccels = execSync(config.ffmpegDir+" -loglevel quiet -hwaccels").toString().split('\n') - hwAccels.shift() - availableHWAccels = [] - hwAccels.forEach(function(method){ - if(method && method !== '')availableHWAccels.push(method.trim()) - }) - config.availableHWAccels = availableHWAccels - config.availableHWAccels = ['auto'].concat(config.availableHWAccels) - console.log('Available Hardware Acceleration Methods : ',availableHWAccels.join(', ')) + if(config.availableHWAccels === undefined){ + hwAccels = execSync(config.ffmpegDir+" -loglevel quiet -hwaccels").toString().split('\n') + hwAccels.shift() + availableHWAccels = [] + hwAccels.forEach(function(method){ + if(method && method !== '')availableHWAccels.push(method.trim()) + }) + config.availableHWAccels = availableHWAccels + config.availableHWAccels = ['auto'].concat(config.availableHWAccels) + console.log('Available Hardware Acceleration Methods : ',availableHWAccels.join(', ')) + } callback() } var completeFfmpegCheck = function(){