1
0
Fork 0
mirror of https://github.com/codedread/bitjs synced 2025-10-03 09:39:16 +02:00

1.1.5: Add support for HE-AAC profile in mp4a.

This commit is contained in:
Jeff Schiller 2023-10-22 09:40:41 -07:00
parent 2d0bb47014
commit ce8f61da94
4 changed files with 20 additions and 1 deletions

View file

@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file. 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 ## [1.1.4] - 2023-10-19
### Changed ### Changed

View file

@ -294,10 +294,14 @@ function getVP09CodecString(stream) {
*/ */
function getMP4ACodecString(stream) { function getMP4ACodecString(stream) {
let frag = 'mp4a.40'; let frag = 'mp4a.40';
// https://dashif.org/codecs/audio/
switch (stream.profile) { switch (stream.profile) {
case 'LC': case 'LC':
frag += '.2'; frag += '.2';
break; break;
case 'HE-AAC':
frag += '.5';
break;
// TODO: more! // TODO: more!
default: default:
throw `Cannot handle AAC stream with profile ${stream.profile} yet. ` + throw `Cannot handle AAC stream with profile ${stream.profile} yet. ` +

View file

@ -1,6 +1,6 @@
{ {
"name": "@codedread/bitjs", "name": "@codedread/bitjs",
"version": "1.1.4", "version": "1.1.5",
"description": "Binary Tools for JavaScript", "description": "Binary Tools for JavaScript",
"homepage": "https://github.com/codedread/bitjs", "homepage": "https://github.com/codedread/bitjs",
"author": "Jeff Schiller", "author": "Jeff Schiller",

View file

@ -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', () => { it('handles codec_name=aac but no codec_tag_string', () => {
const info = structuredClone(baseInfo); const info = structuredClone(baseInfo);
info.streams[0].profile = 'LC'; info.streams[0].profile = 'LC';