use ffprobedata (#307)

This commit is contained in:
HaveAGitGat 2022-05-17 20:06:49 +02:00 committed by GitHub
parent a1c711fb9b
commit 94710291c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,8 +96,13 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
logOutFile = currentfilename.substr(0, currentfilename.lastIndexOf(".")) + ".out"
console.log("Log out file: " + logOutFile)
//get an updated version of the file for checking metadata
var probeData = JSON.parse(require("child_process").execSync(`ffprobe -v quiet -print_format json -show_format -show_streams "${currentfilename}"`).toString())
let probeData;
if (file && file.ffProbeData && file.ffProbeData.format) {
probeData = file.ffProbeData;
} else {
//get an updated version of the file for checking metadata
probeData = JSON.parse(require("child_process").execSync(`ffprobe -v quiet -print_format json -show_format -show_streams "${currentfilename}"`).toString())
}
//setup required varibles
var loudNorm_i = -23.0