4

MPD ファイルにセグメント URL のリストがない場合、DASH メディアのセグメント数を確認するにはどうすればよいですか? セグメント テンプレートしかないため、この MPD に関連付けられているメディアにセグメントがいくつあるかわかりません。これは私が話しているMPDです:

<MPD type="static" xmlns="urn:mpeg:DASH:schema:MPD:2011" profiles="urn:mpeg:dash:profile:full:2011" minBufferTime="PT1.5S" mediaPresentationDuration="PT0H1M59.89S">
 <ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
  <Title>Media Presentation Description for file hdworld_0696kbps_ffmpeg_track1.mp4 generated with GPAC </Title>
 </ProgramInformation>
 <Period start="PT0S" duration="PT0H1M59.89S">
  <AdaptationSet>
   <ContentComponent id="1" contentType="video"/>
   <SegmentTemplate initialization="/$Bandwidth$/hdworld_ffmpeg_track1_dash.mp4" timescale="1000" duration="4920" media="/$Bandwidth$/hdworld_ffmpeg_track1_$Number$.m4s" startNumber="1"/>
   <Representation id="1" mimeType="video/mp4" codecs="avc1.64001f" width="1280" height="720" startWithSAP="1" bandwidth="534343"/>   
   <Representation id="2" mimeType="video/mp4" codecs="avc1.64001f" width="1280" height="720" startWithSAP="1" bandwidth="812553"/>
   <Representation id="3" mimeType="video/mp4" codecs="avc1.64001f" width="1280" height="720" startWithSAP="1" bandwidth="1607692"/>
  </AdaptationSet>
   <AdaptationSet>
   <ContentComponent id="2" contentType="audio" lang="und"/>
   <SegmentTemplate initialization="/audio/HDWorld_audio_init.mp4"/>
   <Representation id="6" mimeType="audio/mp4" codecs="mp4a.40.02" sampleRate="44100" numChannels="2" lang="und" startWithSAP="1" bandwidth="257141">
    <SegmentTemplate timescale="1000" duration="9980" media="/audio/hdworld_seg_audio$Number$.m4s" startNumber="1"/>
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>

私の目標は、存在するすべてのセグメントの URI を取得することです。

4

1 に答える 1

18

この例では、オーディオ セグメントの長さがそれぞれ 9.98 秒 (duration=9980、timescale=1000) であることがわかります。プレゼンテーションの長さは 1 分 59.89 秒 (duration="PT0H1M59.89S") であるため、約 13 セグメント (最後のセグメントは短い) になります。URL テンプレート (/audio/hdworld_seg_audio$Number$.m4s) を使用して各セグメントを取得します ($Number$ を必要なセグメント番号 (最初の番号は 1) に置き換えます)。ビデオ セグメントにも同じことが当てはまります (4.92 であることを除いて)。秒ごとなので、25 のセグメントがあります)

于 2014-02-09T00:50:41.677 に答える