Skip to content

Commit

Permalink
1.1.5: Add support for HE-AAC profile in mp4a.
Browse files Browse the repository at this point in the history
  • Loading branch information
codedread committed Oct 22, 2023
1 parent 2d0bb47 commit ce8f61d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions codecs/codecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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. ` +
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 9 additions & 0 deletions tests/codecs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit ce8f61d

Please sign in to comment.