Differentiate between error and standard terminal log with ffmpeg - nodejs
问题 I'm using ffmpeg in node js. Both the standard terminal output and the error seems to be sent to stdout, so I don't know how to differentiate between error and success... Here's my code: var convertToMp3 = function(filePath) { var ffmpeg = child_process.spawn('ffmpeg',['-i', filePath, '-y', 'output.mp3']); var err = ''; ffmpeg.stderr .on('data', function(c) { err += c; }) .on('end', function() { console.log('stderr:', err); }); var d = ''; ffmpeg.stdout .on('data', function(c){d +=c;}) .on(