var spawn = require('child_process').spawn;

var render = function(projectPath) {
  var avconv = spawn('avconv', [
  '-y',
  '-r', '60',
  '-i', projectPath + '/bin/render/%07d.png',
  '-itsoffset', '-00:00:00.133',
  '-i', projectPath + '/res/music.mp3',
  '-c:v', 'libx264',
  '-c:a', 'copy',
  '-crf', '16',  
  projectPath + '/bin/render/render.mp4']);
  avconv.stdout.on('data', function(data) {
    console.log(data.toString());
  });
  avconv.stderr.on('data', function(data) {
    console.log(data.toString());
  });
}

module.exports = {render: render};

var spawn = require('child_process').spawn;

var render = function(projectPath) {
  var avconv = spawn('avconv', [
  '-y',
  '-r', '60',
  '-i', projectPath + '/bin/render/%07d.png',
  '-i', projectPath + '/res/music.mp3',
  '-c:v', 'libx264',
  '-c:a', 'copy',
  '-crf', '16',  
  projectPath + '/bin/render/render.mp4']);
  avconv.stdout.on('data', function(data) {
    console.log(data.toString());
  });
  avconv.stderr.on('data', function(data) {
    console.log(data.toString());
  });
}

module.exports = {render: render};

Remove itsoffset from avconv parameters w/@sigvef
Remove itsoffset from avconv parameters w/@sigvef

It turns out that itsoffset is not interpreted in the same way by all
codecs/players etc.

Without really understanding everything about avconv, testing with
multiple renders and watching videos played back in slow motion proved
that removing the negative itsoffset yielded the best synced video &
audio.
