Add:FFProbe api endpoint

This commit is contained in:
advplyr 2023-06-25 16:16:11 -05:00
parent a0e80772cd
commit d0bce2949e
12 changed files with 201 additions and 114 deletions

View file

@ -309,3 +309,23 @@ function probe(filepath, verbose = false) {
})
}
module.exports.probe = probe
/**
* Ffprobe for audio file path
*
* @param {string} filepath
* @returns {Object} ffprobe json output
*/
function rawProbe(filepath) {
if (process.env.FFPROBE_PATH) {
ffprobe.FFPROBE_PATH = process.env.FFPROBE_PATH
}
return ffprobe(filepath)
.catch((err) => {
return {
error: err
}
})
}
module.exports.rawProbe = rawProbe