h2non/videoshow

View on GitHub
lib/merge.js

Summary

Maintainability
A
0 mins
Test Coverage
var os = require('os')
var ffmpeg = require('fluent-ffmpeg')
var applyVideoOptions = require('./options').applyVideo

module.exports = merge

function merge(parts, output, options) {
  parts = parts.slice()
  var video = ffmpeg(parts.shift())

  parts.forEach(function (part) {
    video.input(part)
  })

  if (options) {
    applyVideoOptions(video, options)
  }

  video.mergeToFile(output, os.tmpdir())

  return video
}