diff --git a/lib/configs.js b/lib/configs.js index 3458232..4f0fa89 100644 --- a/lib/configs.js +++ b/lib/configs.js @@ -2,6 +2,7 @@ * Basic configuration */ module.exports = function () { + this.bin = 'ffmpeg'; this.encoding = 'utf8'; this.timeout = 0; this.maxBuffer = 200 * 1024 diff --git a/lib/ffmpeg.js b/lib/ffmpeg.js index e5e99e9..99cf1d1 100644 --- a/lib/ffmpeg.js +++ b/lib/ffmpeg.js @@ -17,7 +17,7 @@ var ffmpeg = function (/* inputFilepath, settings, callback */) { // Instance the new arrays for the format var format = { modules : new Array(), encode : new Array(), decode : new Array() }; // Make the call to retrieve information about the ffmpeg - utils.exec(['ffmpeg','-formats','2>&1'], settings, function (error, stdout, stderr) { + utils.exec([settings.bin,'-formats','2>&1'], settings, function (error, stdout, stderr) { // Get the list of modules var configuration = /configuration:(.*)/.exec(stdout); // Check if exists the configuration @@ -62,7 +62,7 @@ var ffmpeg = function (/* inputFilepath, settings, callback */) { // New 'promise' instance var deferred = when.defer(); // Make the call to retrieve information about the ffmpeg - utils.exec(['ffmpeg','-i',fileInput,'2>&1'], settings, function (error, stdout, stderr) { + utils.exec([settings.bin,'-i',fileInput,'2>&1'], settings, function (error, stdout, stderr) { // Perse output for retrieve the file info var filename = /from \'(.*)\'/.exec(stdout) || [] , title = /(INAM|title)\s+:\s(.+)/.exec(stdout) || [] diff --git a/lib/video.js b/lib/video.js index 44b1c96..71852cc 100644 --- a/lib/video.js +++ b/lib/video.js @@ -551,7 +551,7 @@ module.exports = function (filePath, settings, infoConfiguration, infoFile) { // Building the value for return value. Check if the callback is not a function. In this case will created a new instance of the deferred class var deferred = typeof callback != 'function' ? when.defer() : { promise : null }; // Create a copy of the commands list - var finalCommands = ['ffmpeg -i'] + var finalCommands = [settings.bin,'-i'] .concat(inputs.join(' -i ')) .concat(commands.join(' ')) .concat(filtersComlpex.length > 0 ? ['-filter_complex "'].concat(filtersComlpex.join(', ')).join('') + '"' : [])