Skip to content

Instantly share code, notes, and snippets.

@Laurian
Created August 19, 2016 18:31
Show Gist options
  • Save Laurian/6dc4c52728e839d232189e0014d9fb5c to your computer and use it in GitHub Desktop.
Save Laurian/6dc4c52728e839d232189e0014d9fb5c to your computer and use it in GitHub Desktop.
VideoStitch with URLs (videos from PalestineRemix.com)

To allow URLs I had to modify https://github.com/ArsalanDotMe/VideoStitch/blob/master/lib/videoconcat.js#L48

let child = shelljs.exec(`ffmpeg -f concat -i ${args.fileList} -c copy ${outputFileName}`, { async: true, silent: spec.silent });

to

let child = shelljs.exec(`ffmpeg -f concat -safe 0 -protocol_whitelist file,http,https,tcp,tls -i ${args.fileList} -c copy ${outputFileName}`, { async: true, silent: spec.silent });
'use strict';
let videoStitch = require('video-stitch'); // https://github.com/ArsalanDotMe/VideoStitch
let videoConcat = videoStitch.concat;
videoConcat({
silent: false // optional. if set to false, gives detailed output on console
})
.clips([
{
"startTime": "00:03:53",
"fileName": "http://player.vimeo.com/external/110467238.hd.mp4?s=1d8125fcb86fbc884d8e7ab2d71aa9d5",
"duration": "00:00:29"
},
{
"startTime": "00:22:31",
"fileName": "http://player.vimeo.com/external/110467238.hd.mp4?s=1d8125fcb86fbc884d8e7ab2d71aa9d5",
"duration": "00:00:23"
},
{
"startTime": "00:28:01",
"fileName": "http://player.vimeo.com/external/110904621.hd.mp4?s=b5055337d78a967c8e98372a11b57b0a",
"duration": "00:00:09"
},
{
"startTime": "00:38:25",
"fileName": "http://player.vimeo.com/external/111081091.hd.mp4?s=fcf751b56cab4dc49e24efb01e8a0ae1",
"duration": "00:01:05"
},
{
"startTime": "00:39:30",
"fileName": "http://player.vimeo.com/external/111081091.hd.mp4?s=fcf751b56cab4dc49e24efb01e8a0ae1",
"duration": "00:00:17"
}
])
.output("/tmp/test.mp4") //optional absolute file name for output file
.concat()
.then((outputFileName) => {
console.log(outputFileName);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment