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

Increase node child process maxBuffer setting #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qhyun2
Copy link

@qhyun2 qhyun2 commented Dec 6, 2020

Prevents the child process from be killed for long running ffmpeg jobs.

Implemented fix as described in #81

Prevents the child process from be killed for long running ffmpeg jobs
@qhyun2 qhyun2 changed the title Increase node childe process maxBuffer setting Increase node child process maxBuffer setting Dec 6, 2020
@@ -12,6 +12,9 @@ module.exports.exec = function (commands, settings, callback) {
var finalCommand = commands.join(" ");
// Create the timeoutId for stop the timeout at the end the process
var timeoutID = null;

settings.maxBuffer = 1024*1024*1024*5 // 5 GB, default of child_process lib is : 1024*1024 bytes

// Exec the command
var process = exec(finalCommand, settings, function (error, stdout, stderr) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it would be a better idea to change exec() for spawn() ?

https://stackoverflow.com/questions/48698234/node-js-spawn-vs-execute

@joshverd
Copy link

joshverd commented Feb 23, 2023

This fixed the issue described in #81 for me!

I did run into issues using your forked repository's version of this package. It seems like the node-ffmpeg module on npm hasn't been updated in a few years, and the current repository version does not run properly. So, I actually had to find the last commit before it was published to npm and fork the repository from there.

If anyone comes across this issue/PR down the line, this is the repository I created with the correct forked version and fix described above: https://github.com/joshverd/node-ffmpeg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants