Merge pull request #461 from HaveAGitGat/2.10.01

2.10.01
This commit is contained in:
HaveAGitGat 2023-09-07 05:03:50 +01:00 committed by GitHub
commit c4adc08df8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 328 additions and 330 deletions

View file

@ -77,15 +77,22 @@ var plugin = function (args) {
greaterThanBits *= 1000000;
lessThanBits *= 1000000;
}
var hasVideoBitrate = false;
if ((_b = (_a = args.inputFileObj) === null || _a === void 0 ? void 0 : _a.mediaInfo) === null || _b === void 0 ? void 0 : _b.track) {
args.inputFileObj.mediaInfo.track.forEach(function (stream) {
if (stream['@type'] === 'video') {
if (stream.BitRate) {
hasVideoBitrate = true;
}
if (stream.BitRate >= greaterThanBits && stream.BitRate <= lessThanBits) {
isWithinRange = true;
}
}
});
}
if (!hasVideoBitrate) {
throw new Error('Video bitrate not found');
}
return {
outputFileObj: args.inputFileObj,
outputNumber: isWithinRange ? 1 : 2,