Skip to content

Instantly share code, notes, and snippets.

@diogopms
Last active October 30, 2023 18:24
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save diogopms/2b9be8e66ff5b30dc803 to your computer and use it in GitHub Desktop.
Save diogopms/2b9be8e66ff5b30dc803 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.error('Error!')
}
console.log(stdout)
})
@bertho-zero
Copy link

Thanks !!!

@bertho-zero
Copy link

You can add --location option to curl for allow http redirection with localtion http header.

@MatayoshiMariano
Copy link

There is no need of using curl, here is an example ffprobe -v quiet -print_format json -show_format -show_streams -show_error -show_chapters https://www.videvo.net/videvo_files/converted/2016_04/preview/EMIT__Connections_Plexus.mov23794.webm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment