From ce8f61da940da8ae20333dbef4da362b0c5a3001 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Sun, 22 Oct 2023 09:40:41 -0700 Subject: [PATCH] 1.1.5: Add support for HE-AAC profile in mp4a. --- CHANGELOG.md | 6 ++++++ codecs/codecs.js | 4 ++++ package.json | 2 +- tests/codecs.spec.js | 9 +++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2611939..fd4b535 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [1.1.5] - 2023-10-22 + +### Changed + +- codecs: Add support for HE-AAC profile in mp4a. + ## [1.1.4] - 2023-10-19 ### Changed diff --git a/codecs/codecs.js b/codecs/codecs.js index 82c967d..d3fc265 100644 --- a/codecs/codecs.js +++ b/codecs/codecs.js @@ -294,10 +294,14 @@ function getVP09CodecString(stream) { */ function getMP4ACodecString(stream) { let frag = 'mp4a.40'; + // https://dashif.org/codecs/audio/ switch (stream.profile) { case 'LC': frag += '.2'; break; + case 'HE-AAC': + frag += '.5'; + break; // TODO: more! default: throw `Cannot handle AAC stream with profile ${stream.profile} yet. ` + diff --git a/package.json b/package.json index 6000965..63ded57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@codedread/bitjs", - "version": "1.1.4", + "version": "1.1.5", "description": "Binary Tools for JavaScript", "homepage": "https://github.com/codedread/bitjs", "author": "Jeff Schiller", diff --git a/tests/codecs.spec.js b/tests/codecs.spec.js index 8cd3b56..0d25f17 100644 --- a/tests/codecs.spec.js +++ b/tests/codecs.spec.js @@ -488,6 +488,15 @@ describe('codecs test suite', () => { }); }); + it('recognizes codec_name=HE-AAC', () => { + const info = structuredClone(baseInfo); + info.streams[0].profile = 'HE-AAC'; + info.streams[0].codec_name = 'aac'; + expect(getFullMIMEString(info)) + .to.be.a('string') + .and.equals('audio/mp4; codecs="mp4a.40.5"'); + }); + it('handles codec_name=aac but no codec_tag_string', () => { const info = structuredClone(baseInfo); info.streams[0].profile = 'LC';