Reputation: 3838
I am trying to use the MediaSource API to play chunked HE-AAC v2 in Chrome.
Chrome explicitly allows this codec (mp4a.40.29
) and as far as I can see is capable of decoding it. (For example, the decodeAudioData
method from the Web Audio API does decode the same data).
Unfortunately, trying to play chunks of HE-AAC v2 using the MediaSource API in Chrome results in the errors below, even though the exact same page works perfectly in Safari.
I've put together a test page demonstrating the problem (in Chrome) and success (in Safari).
How can I make Chrome play these chunks?
Errors:
pipeline: decode error
kInitDemuxer
Append: stream parsing failed. Data size=15634 append_window_start=0 append_window_end=inf
Upvotes: 3
Views: 1979
Reputation: 21
You used the wrong decoder. audio/mp4; codecs="mp4a.40.29"
expects an AAC stream encapsulated in MP4 format, but you provided only an AAC stream. Therefore, the decoder should select "audio/aac"
instead.
// var codec = 'audio/mp4; codecs="mp4a.40.29"'; // HE-AAC v2
var codec = 'audio/aac'; // HE-AAC v2
mediaSource.addSourceBuffer(codec);
Upvotes: 0
Reputation: 16934
Your audio codec is HE-AAC which I believe is listed as a NOT supported audio codec on the Chrome Codec, Containers and File Extensions Support page http://www.chromium.org/audio-video
AAC (Main only, not AAC-LC, AAC-SSR, HE-AAC) [Google Chrome only]
Upvotes: 0