Last active
October 30, 2023 18:24
-
-
Save diogopms/2b9be8e66ff5b30dc803 to your computer and use it in GitHub Desktop.
Get video information using ffprobe and url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
}) |
You can add --location
option to curl for allow http redirection with localtion http header.
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
Thanks !!!