Skip to content

Instantly share code, notes, and snippets.

@zinzinday
Created September 2, 2017 23:49
Show Gist options
  • Save zinzinday/f0c14c67b0f02e6244fded98fb1c6e7b to your computer and use it in GitHub Desktop.
Save zinzinday/f0c14c67b0f02e6244fded98fb1c6e7b to your computer and use it in GitHub Desktop.
Get video information using ffprobe and url
var exec = require('child_process').exec;
var url = 'https://URL';
var command = 'curl --silent ' + url + '| ffprobe pipe:0 -print_format json -show_format';
exec(command, function callback(error, stdout, stderr){
if(stderr.indexOf("Invalid data") > -1) {
console.log("Error!");
}
console.log(stdout);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment