From 7f6c04566873451ee1bbf139b6c0caa56b9ba3ad Mon Sep 17 00:00:00 2001 From: Moe Adham Date: Mon, 19 Feb 2024 15:19:40 +0000 Subject: [PATCH 1/2] [activationBytes] Add support for -activation_bytes option Assists with conversion of AAX files if the activation bytes are available --- lib/options/inputs.js | 17 +++++++++++++++++ test/args.test.js | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/lib/options/inputs.js b/lib/options/inputs.js index 804a21a3..4f6e85e1 100644 --- a/lib/options/inputs.js +++ b/lib/options/inputs.js @@ -175,4 +175,21 @@ module.exports = function(proto) { return this; }; + + /** + * Specify activation bytes for the last specified input + * + * @method FfmpegCommand#activationBytes + * @category Input + * @param {String} bytes activation bytes + * @return FfmpegCommand + */ + proto.activationBytes = function(bytes) { + if (!this._currentInput) { + throw new Error('No input specified'); + } + + this._currentInput.options('-activation_bytes', bytes); + return this; + }; }; diff --git a/test/args.test.js b/test/args.test.js index a57f0d73..d507f542 100644 --- a/test/args.test.js +++ b/test/args.test.js @@ -1119,4 +1119,21 @@ describe('Command', function() { }); }); }); + describe('activationBytes', function() { + it('should apply activation bytes to input', function(done) { + new Ffmpeg({ source: this.testfile, logger: testhelper.logger }) + .activationBytes('12345678') + ._test_getArgs(function(args, err) { + testhelper.logArgError(err); + assert.ok(!err); + + // Check if the '-activation_bytes' option is correctly applied + const activationBytesIndex = args.indexOf('-activation_bytes'); + assert.ok(activationBytesIndex !== -1, 'Activation bytes option not found'); + assert.strictEqual(args[activationBytesIndex + 1], '12345678', 'Activation bytes value does not match'); + + done(); + }); + }); + }); }); From 5690877d6ba5f208950179c7b768683e94b05bf0 Mon Sep 17 00:00:00 2001 From: Moe Adham Date: Thu, 12 Sep 2024 15:58:50 +0100 Subject: [PATCH 2/2] [audible] key and iv support --- lib/options/inputs.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lib/options/inputs.js b/lib/options/inputs.js index 4f6e85e1..6b704731 100644 --- a/lib/options/inputs.js +++ b/lib/options/inputs.js @@ -192,4 +192,38 @@ module.exports = function(proto) { this._currentInput.options('-activation_bytes', bytes); return this; }; + + /** + * Specify audible key for the last specified input + * + * @method FfmpegCommand#audibleKey + * @category Input + * @param {String} key audible key + * @return FfmpegCommand + */ + proto.audibleKey = function(key) { + if (!this._currentInput) { + throw new Error('No input specified'); + } + + this._currentInput.options('-audible_key', key); + return this; + }; + + /** + * Specify audible IV for the last specified input + * + * @method FfmpegCommand#audibleIv + * @category Input + * @param {String} iv audible IV + * @return FfmpegCommand + */ + proto.audibleIv = function(iv) { + if (!this._currentInput) { + throw new Error('No input specified'); + } + + this._currentInput.options('-audible_iv', iv); + return this; + }; };