Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ffmpeg executable path configurable #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Basic configuration
*/
module.exports = function () {
this.bin = 'ffmpeg';
this.encoding = 'utf8';
this.timeout = 0;
this.maxBuffer = 200 * 1024
Expand Down
4 changes: 2 additions & 2 deletions lib/ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) || []
Expand Down
2 changes: 1 addition & 1 deletion lib/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('') + '"' : [])
Expand Down