Skip to content

Instantly share code, notes, and snippets.

@joelongstreet
Created August 31, 2021 14:27
Show Gist options
  • Save joelongstreet/4f3d35929b7e6976c423b213b0933c12 to your computer and use it in GitHub Desktop.
Save joelongstreet/4f3d35929b7e6976c423b213b0933c12 to your computer and use it in GitHub Desktop.
const ffmpeg = require('fluent-ffmpeg');
const c = new ffmpeg('video1.mp4')
.addInput('video2.mp4')
.on('error', function(err) {
console.log('an error happened: ' + err.message);
})
.on('end', function() {
console.log('final video saved');
})
.mergeToFile('output.mp4', '/');
c.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment