damianociarla / node-ffmpeg

ffmpeg module for nodejs
MIT License
600 stars 140 forks source link

How do you increase the max buffer size? #73

Closed lovgrandma closed 4 years ago

lovgrandma commented 4 years ago

For videos of a very large size, the child process buffer is too small to convert the files. I was trying to convert Dallas buyers club (2GB) as a test for my video upload pipeline and I received this error

{ Error: stderr maxBuffer exceeded at Socket.onChildStderr (child_process.js:346:14) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:246:13) at Socket.Readable.push (_stream_readable.js:208:10) at Pipe.onread (net.js:607:20)

cmd: 'ffmpeg -i ./temp/e963f32022114af09a32c4cac53fb1c4.mp4 -x264-params keyint=24:min-keyint=24:no-scenecut -aspect 12:5 -s 1440x600 -an -filter_complex "scale=iw*sar:ih, pad=max(iw\\,ih*(12/5)):ow/(12/5):(ow-iw)/2:(oh-ih)/2" ./temp/da7dda3a7709455e8218f0f010d325ea-1440-raw.mp4' }

I would know how to do this if the child process exec commands were exposed but Im unsure what to edit in the source code to increase max buffer size.