var ffmpeg = require('fluent-ffmpeg');
var ff = new ffmpeg();

ff.on('start', function(commandLine) {
  // on start, you can verify the command line to be used
})
.on('progress', function(data) {
  // do something with progress data if you like
})
.on('end', function() {
  // do something when complete
})
.on('error', function(err, stdout, stderr) {
  // handle error conditions
  console.log('Error: ' + err.message)
  console.log('ffmpeg output:\n' + stdout)
  console.log('ffmpeg stderr:\n' + stderr)
})
.addInput('path\to\file')
.addInputOption('-xerror')
.addInputOption('-v error')
.output('-')
.outputOptions('-f null')
.run();