如何从python中的.mpd清单文件中检索视频片段的URL?

时间:2017-06-01 07:02:28

标签: python streaming video-streaming mpeg-dash

我需要从.mpd文件中检索视频的所有片段(流)的网址。我无法弄清楚如何从.mpd文件生成url。

 <?xml version="1.0" ?>
  <MPD mediaPresentationDuration="PT2H34M47.960S" minBufferTime="PT3.00S" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013">
    <!-- Created with Bento4 mp4-dash.py, VERSION=1.7.0-613 -->
    <Period>
      <!-- Video -->
      <AdaptationSet maxHeight="360" maxWidth="640" mimeType="video/mp4" minHeight="180" minWidth="320" segmentAlignment="true" startWithSAP="1">
        <!-- MPEG Common Encryption -->
        <ContentProtection cenc:default_KID="7cac8db7-a352-568e-9c06-e5d26147da86" schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc"/>
        <!-- Widevine -->
        <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
          <cenc:pssh>AAAAdHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAFQSEOHBxsC86lMVrHwU7a6LubISEHysjbejUlaOnAbl0mFH2oYSEAvHADm/u1gUlLVvSEU2ha8aDHNvdGFsYXBhbGF5YSIIMTAwMTczMzdI49yVmwY=</cenc:pssh>
        </ContentProtection>
        <SegmentTemplate duration="3000" initialization="$RepresentationID$/init.mp4?svdghahgdahd hvdhvhavdha" media="$RepresentationID$/seg-$Number$.m4s?agsdjsgajfjagfjafjag fgaj" startNumber="1" timescale="1000"/>
        <Representation bandwidth="79914" codecs="avc1.42C00C" frameRate="25" height="180" id="video/1" scanType="progressive" width="320"/>
        <Representation bandwidth="137430" codecs="avc1.42C01E" frameRate="25" height="360" id="video/2" scanType="progressive" width="640"/>
        <Representation bandwidth="265383" codecs="avc1.42C01E" frameRate="25" height="360" id="video/3" scanType="progressive" width="640"/>
        <Representation bandwidth="521314" codecs="avc1.42C01E" frameRate="25" height="360" id="video/4" scanType="progressive" width="640"/>
        <Representation bandwidth="777245" codecs="avc1.42C01E" frameRate="25" height="360" id="video/5" scanType="progressive" width="640"/>
        <Representation bandwidth="1033211" codecs="avc1.42C01E" frameRate="25" height="360" id="video/6" scanType="progressive" width="640"/>
        <Representation bandwidth="1545041" codecs="avc1.42C01E" frameRate="25" height="360" id="video/7" scanType="progressive" width="640"/>
      </AdaptationSet>
      <!-- Audio -->

0 个答案:

没有答案