Turn audio into a shareable video. forked from nypublicradio/audiogram

combine-frames.js 474B

1234567891011121314
  1. var exec = require("child_process").exec;
  2. function combineFrames(options, cb) {
  3. // Raw ffmpeg command with standard mp4 setup
  4. // Some old versions of ffmpeg require -strict for the aac codec
  5. var cmd = "ffmpeg -r " + options.framesPerSecond + " -i \"" + options.framePath + "\" -i \"" + options.audioPath + "\" -c:v libx264 -c:a aac -strict experimental -shortest -pix_fmt yuv420p \"" + options.videoPath + "\"";
  6. exec(cmd, cb);
  7. }
  8. module.exports = combineFrames;