Javascript &引用;初始化段未命中预期的aac轨迹。”;甚至附加音频初始段

Javascript &引用;初始化段未命中预期的aac轨迹。”;甚至附加音频初始段,javascript,mpeg-dash,media-source,Javascript,Mpeg Dash,Media Source,我目前正在使用DASH播放媒体,在播放双声道(视频和音频)媒体时遇到问题 现在我有一个破折号清单如下: <?xml version='1.0' encoding='UTF-8'?> <MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xx xx> <Period id="0" start="PT0S"> <AdaptationSet segmentAlignment="true" mimeType="vide

我目前正在使用DASH播放媒体,在播放双声道(视频和音频)媒体时遇到问题

现在我有一个破折号清单如下:

<?xml version='1.0' encoding='UTF-8'?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xx xx>
  <Period id="0" start="PT0S">
    <AdaptationSet segmentAlignment="true" mimeType="video/mp4" startWithSAP="1">
      <SegmentTemplate initialization="videoInitialFragmentUrl" timescale="1000" startNumber="19" media="someTemplateUrl">
        <SegmentTimeline>
          <S t="37968" d="1994" />
          <S d="2067" />
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation id="video" bandwidth="492421" width="1920" height="1080" frameRate="14.99" codecs="avc1.4d4028" scanType="progressive"/>
    </AdaptationSet>
    <AdaptationSet segmentAlignment="true" mimeType="audio/mp4" startWithSAP="1">
      <SegmentTemplate initialization="audioInitialFragmentUrl" timescale="1000" startNumber="19" media="someTemplateUrl">
        <SegmentTimeline>
          <S t="37968" d="1994"/>
          <S d="2067" />
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation id="audio" bandwidth="64633" audioSamplingRate="8000" codecs="alaw">
        <AudioChannelConfiguration xx xx/>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>

我使用以下步骤初始化souceBuffer:

  • 使用mimeType“video/mp4;编解码器创建mediaSouce= avc1.4d0020,mp4a.40.2“
  • 创建sourceBuffer并将其添加到mediaSource
  • 从audioInitialFragmentUrl和audioInitialFragmentUrl获取ArrayBuffer,并连接它们
  • 将缓冲区追加到sourceBuffer
  • 然后我得到了错误“初始化段未命中预期的aac轨迹”,但我非常确定缓冲区包含我从audioInitialFragmentUrl获取的音频部分。
    有关于原因的帮助吗?

    为多路复用内容创建的单个SourceBuffer需要一个包含两个曲目初始化信息的初始化段-您有两个初始化段,每个初始化段都有一个曲目,因此会出现此错误

    您需要有单独的源缓冲区-每个AdaptionSet一个