From 7c6e84609440d4c107d97207345c095291bcd4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Mon, 1 Apr 2024 09:26:07 +0200 Subject: [PATCH] fix(transmuxer): Support raw AAC with TS extension (#6360) Fixes https://github.com/shaka-project/shaka-player/issues/6322 Fixes https://github.com/shaka-project/shaka-player/issues/6357 --- karma.conf.js | 1 + lib/transmuxer/ts_transmuxer.js | 45 ++++++++++++++++-- .../assets/hls-ts-raw-aac/fileSequence0.ts | Bin 0 -> 7131 bytes .../assets/hls-ts-raw-aac/fileSequence1.ts | Bin 0 -> 7542 bytes .../assets/hls-ts-raw-aac/fileSequence2.ts | Bin 0 -> 8152 bytes .../assets/hls-ts-raw-aac/fileSequence3.ts | Bin 0 -> 7423 bytes test/test/assets/hls-ts-raw-aac/index.m3u8 | 4 ++ test/test/assets/hls-ts-raw-aac/playlist.m3u8 | 14 ++++++ test/transmuxer/transmuxer_integration.js | 16 +++++++ 9 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 test/test/assets/hls-ts-raw-aac/fileSequence0.ts create mode 100644 test/test/assets/hls-ts-raw-aac/fileSequence1.ts create mode 100644 test/test/assets/hls-ts-raw-aac/fileSequence2.ts create mode 100644 test/test/assets/hls-ts-raw-aac/fileSequence3.ts create mode 100644 test/test/assets/hls-ts-raw-aac/index.m3u8 create mode 100644 test/test/assets/hls-ts-raw-aac/playlist.m3u8 diff --git a/karma.conf.js b/karma.conf.js index adba5beb44..a01444c678 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -254,6 +254,7 @@ module.exports = (config) => { {pattern: 'test/test/assets/hls-ts-muxed-ac3-h264/*', included: false}, {pattern: 'test/test/assets/hls-ts-muxed-mp3-h264/*', included: false}, {pattern: 'test/test/assets/hls-ts-muxed-ec3-h264/*', included: false}, + {pattern: 'test/test/assets/hls-ts-raw-aac/*', included: false}, {pattern: 'test/test/assets/hls-ts-rollover/*', included: false}, {pattern: 'dist/shaka-player.ui.js', included: false}, {pattern: 'dist/locales.js', included: false}, diff --git a/lib/transmuxer/ts_transmuxer.js b/lib/transmuxer/ts_transmuxer.js index 7008541e76..6407ae3b79 100644 --- a/lib/transmuxer/ts_transmuxer.js +++ b/lib/transmuxer/ts_transmuxer.js @@ -7,6 +7,7 @@ goog.provide('shaka.transmuxer.TsTransmuxer'); goog.require('shaka.media.Capabilities'); +goog.require('shaka.transmuxer.AacTransmuxer'); goog.require('shaka.transmuxer.Ac3'); goog.require('shaka.transmuxer.ADTS'); goog.require('shaka.transmuxer.Ec3'); @@ -16,6 +17,7 @@ goog.require('shaka.transmuxer.MpegAudio'); goog.require('shaka.transmuxer.TransmuxerEngine'); goog.require('shaka.util.BufferUtils'); goog.require('shaka.util.Error'); +goog.require('shaka.util.Id3Utils'); goog.require('shaka.util.ManifestParserUtils'); goog.require('shaka.util.MimeUtils'); goog.require('shaka.util.Mp4Generator'); @@ -45,6 +47,9 @@ shaka.transmuxer.TsTransmuxer = class { /** @private {?shaka.util.TsParser} */ this.tsParser_ = null; + + /** @private {?shaka.transmuxer.AacTransmuxer} */ + this.aacTransmuxer_ = null; } @@ -54,6 +59,10 @@ shaka.transmuxer.TsTransmuxer = class { */ destroy() { this.initSegments.clear(); + + if (this.aacTransmuxer_) { + this.aacTransmuxer_.destroy(); + } } @@ -187,14 +196,44 @@ shaka.transmuxer.TsTransmuxer = class { */ transmux(data, stream, reference, duration, contentType) { const ContentType = shaka.util.ManifestParserUtils.ContentType; + const Uint8ArrayUtils = shaka.util.Uint8ArrayUtils; + + const uint8ArrayData = shaka.util.BufferUtils.toUint8(data); + + if (contentType == ContentType.AUDIO && + !shaka.util.TsParser.probe(uint8ArrayData)) { + const id3Data = shaka.util.Id3Utils.getID3Data(uint8ArrayData); + let offset = id3Data.length; + for (; offset < uint8ArrayData.length; offset++) { + if (shaka.transmuxer.MpegAudio.probe(uint8ArrayData, offset)) { + return Promise.reject(new shaka.util.Error( + shaka.util.Error.Severity.CRITICAL, + shaka.util.Error.Category.MEDIA, + shaka.util.Error.Code.TRANSMUXING_FAILED)); + } + } + offset = id3Data.length; + for (; offset < uint8ArrayData.length; offset++) { + if (shaka.transmuxer.ADTS.probe(uint8ArrayData, offset)) { + if (!this.aacTransmuxer_) { + this.aacTransmuxer_ = + new shaka.transmuxer.AacTransmuxer('audio/aac'); + } + return this.aacTransmuxer_ + .transmux(data, stream, reference, duration, contentType); + } + } + return Promise.reject(new shaka.util.Error( + shaka.util.Error.Severity.CRITICAL, + shaka.util.Error.Category.MEDIA, + shaka.util.Error.Code.TRANSMUXING_FAILED)); + } + if (!this.tsParser_) { this.tsParser_ = new shaka.util.TsParser(); } else { this.tsParser_.clearData(); } - const Uint8ArrayUtils = shaka.util.Uint8ArrayUtils; - - const uint8ArrayData = shaka.util.BufferUtils.toUint8(data); const tsParser = this.tsParser_.parse(uint8ArrayData); const streamInfos = []; diff --git a/test/test/assets/hls-ts-raw-aac/fileSequence0.ts b/test/test/assets/hls-ts-raw-aac/fileSequence0.ts new file mode 100644 index 0000000000000000000000000000000000000000..220a47823b06abf80a586958723522c48fdc3b7a GIT binary patch literal 7131 zcmd^Ei91wp8y+)u6~--SyXU-0X_-fPZz&s;O}p6A@p{oKzzD4ipWAo@TWpFy1ij*1|V z!&P@#drwa{Cs`j~Zzp?qXOGLWzTWm8KAu;-eNDG6oppA1^6|BI_uTp{XlLdEZO%HJ zfw&GAgJ@n6p)dGh>u{qnBnx@Un`z(SNKG0UsrGbzQ`UK7Wo9*mMtdfw<0YplE5XXt z5&^2liwQs(!EWwxgEn<5a^$9pnc?q}_n>A6=Er9;mti|W1zth!r*{*3hf zy55^Tmbqz>KAKj0=Lctspp;d+Q^S!DUpJb2bk!D2cul)>xphptG{$%Gnw(bob|=9y zE+Nty$w1|NuAF|0{$pg#aBF=o4lI~KnZ92hV85<>hfSjG?QUy+F=1r|A&xNN(rH=e zD^queqp6&wdnC-DCfY7pGANmSE`6%{_a%z2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J{gIJA=?%Y5NH5PS-S|%noUUG6cDvX0of_R79QHJUD@%1qWh~bTfX_NM!jX|0g#UME{w4q!||BaPZ|S^sW3M6iRp{ib260 z`diBS-*%w%XH#Ad0J+Ej{dCOu*74*7jUwG!_^&gxj>;MCXdJ+iUTF6mVKWQWO#o~! zFvM`TFwD3PUt|8WT(cMTIpz(O(A_3*$cuw;p8sa;|Ko(q8@;7K?Qlz-AaV5(p4J!6 zy`Jrx&+ur;!%serUA~&QNK<{~BYx^>9NWo}WO-U94mTXO zmnFXuGU>Fl|4~#M)P6oLMA$MfNj)z~E4+%HP{r*}+LDLAxFx}c#BavI-^kmv3dbXv z%YE(@@8nn4XQa#B$O2{p7AhOo2%15iT*x&Q@+rjuRG{{za_1rY%{)_q=7ZlK9n#cv z?J&WnG&?VDTQ6#JMiW!MdF?=_qv-Y4qxaHA?NpJW(&-;xZ3^=HylRI;#eGlN; znF2ZI`;x~t;f8KByI{X8-P!D)D^+xhqa!9)>UK9hW3Q{GgJn{IN`{)~mc*N5WiwT+ zRFwNihgfUT!x}_#muTYl?nhpc8Xl?<7Rf65#oJmQcBsTa{Sl{s{a;I_WwF`rys*4a0Q;yZn9<_$ z&hq)XzpEv64HSnblb3C@R4MhfTeqy?d^43uleN@#D!*QfBu_p$`yJgMm6~akRbSmj z=EQzyadIM)8sO|75WIFtXo?X0HI8;7_(|vc>{PK5ueOX}ogSmLln=$MFvR_=(VKH` z6JD-P_Trfj7|3S(WV(9%tGH46PB-_pK;iq=_nFS%iv6bP{JZZ8Giyq=0a?v4(4h3u z(lkU%Iz@0_mYjjoL6QX#CTG=n;X!rm&$KZ_z}6)4gYw8c&U literal 0 HcmV?d00001 diff --git a/test/test/assets/hls-ts-raw-aac/index.m3u8 b/test/test/assets/hls-ts-raw-aac/index.m3u8 new file mode 100644 index 0000000000..80534b2527 --- /dev/null +++ b/test/test/assets/hls-ts-raw-aac/index.m3u8 @@ -0,0 +1,4 @@ +#EXTM3U +#EXT-X-INDEPENDENT-SEGMENTS +#EXT-X-STREAM-INF:BANDWIDTH=128000,CODECS="mp4a.40.2" +playlist.m3u8 \ No newline at end of file diff --git a/test/test/assets/hls-ts-raw-aac/playlist.m3u8 b/test/test/assets/hls-ts-raw-aac/playlist.m3u8 new file mode 100644 index 0000000000..d9bc663957 --- /dev/null +++ b/test/test/assets/hls-ts-raw-aac/playlist.m3u8 @@ -0,0 +1,14 @@ +#EXTM3U +#EXT-X-TARGETDURATION:11 +#EXT-X-VERSION:3 +#EXT-X-MEDIA-SEQUENCE:0 +#EXT-X-PLAYLIST-TYPE:VOD +#EXTINF:9.98458, +fileSequence0.ts +#EXTINF:9.98458, +fileSequence1.ts +#EXTINF:9.98459, +fileSequence2.ts +#EXTINF:10.03102, +fileSequence3.ts +#EXT-X-ENDLIST diff --git a/test/transmuxer/transmuxer_integration.js b/test/transmuxer/transmuxer_integration.js index 76a1dada17..624aa55c3c 100644 --- a/test/transmuxer/transmuxer_integration.js +++ b/test/transmuxer/transmuxer_integration.js @@ -189,6 +189,22 @@ describe('Transmuxer Player', () => { await player.unload(); }); + it('raw AAC with ts extension', async () => { + await player.load('/base/test/test/assets/hls-ts-raw-aac/index.m3u8'); + await video.play(); + expect(player.isLive()).toBe(false); + + // Wait for the video to start playback. If it takes longer than 10 + // seconds, fail the test. + await waiter.waitForMovementOrFailOnTimeout(video, 10); + + // Play for 15 seconds, but stop early if the video ends. If it takes + // longer than 45 seconds, fail the test. + await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 15, 45); + + await player.unload(); + }); + it('AAC in TS', async () => { await player.load('/base/test/test/assets/hls-ts-aac/playlist.m3u8'); await video.play();