Stitches video clips on top of another clip using ffmpeg
npm install video-stitchNote that ffmpeg executable must be in your PATH for this module to work.
``javascript
'use strict';
let videoStitch = require('video-stitch');
let videoMerge = videoStitch.merge;
videoMerge({
// ffmpeg_path:
})
.original({
"fileName": "FILENAME",
"duration": "hh:mm:ss"
})
.clips([
{
"startTime": "hh:mm:ss",
"fileName": "FILENAME",
"duration": "hh:mm:ss"
},
{
"startTime": "hh:mm:ss",
"fileName": "FILENAME",
"duration": "hh:mm:ss"
},
{
"startTime": "hh:mm:ss",
"fileName": "FILENAME",
"duration": "hh:mm:ss"
}
])
.merge()
.then((outputFile) => {
console.log('path to output file', outputFile);
});
`
`javascript
'use strict';
let videoStitch = require('video-stitch');
let videoCut = videoStitch.cut;
videoCut({
silent: true // optional. if set to false, gives detailed output on console
// ffmpeg_path:
})
.original({
"fileName": "FILENAME",
"duration": "hh:mm:ss"
})
.exclude([
{
"startTime": "hh:mm:ss",
"duration": "hh:mm:ss"
},
{
"startTime": "hh:mm:ss",
"duration": "hh:mm:ss"
},
{
"startTime": "hh:mm:ss",
"duration": "hh:mm:ss"
}
])
.cut()
.then((videoClips) => {
// [{startTime, duration, fileName}]
});
`
`javascript
'use strict';
let videoStitch = require('video-stitch');
let videoConcat = videoStitch.concat;
videoConcat({
// ffmpeg_path:
silent: true, // optional. if set to false, gives detailed output on console
overwrite: false // optional. by default, if file already exists, ffmpeg will ask for overwriting in console and that pause the process. if set to true, it will force overwriting. if set to false it will prevent overwriting.
})
.clips([
{
"fileName": "FILENAME"
},
{
"fileName": "FILENAME"
},
{
"fileName": "FILENAME"
}
])
.output("myfilename") //optional absolute file name for output file
.concat()
.then((outputFileName) => {
});
``