无法在浏览器上播放Dash Stream

时间:2018-02-08 02:57:40

标签: nginx mpeg-dash mp4box dash.js

我有一个nginx服务器,我在其中安装了nginx-rtmp-module,我想公开视频流throw rtmp和mpeg-dash协议。 rtmp端点工作正常,但mpeg-dash端点没有。

我得到的问题是当我用dash.js播放视频时我用MP4Box生成了一个带有这行的mdp文件

 sudo MP4Box -dash 10000 -frag 10000 -profile dashavc264:on-demand -rap -out bbb.mpd bbb.mp4

但是当我尝试在任何浏览器上播放视频时,我会不断收到此日志

日志

 Debug.js:130 [14] Playback Initialized 
 Debug.js:130 [15] [dash.js 2.6.5] MediaPlayer has been initialized 
 Debug.js:130 [15] Converted video element to dash.js player and added 
 content: http://xxx.xxx.xxxx.xxxx/doc/bbb.mpd  
 Debug.js:130 [35] Parsing complete: ( xml2json: 9.57ms, objectiron: 4.06ms, total: 0.0136s) 
 Debug.js:130 [43] MediaSource attached to element.  Waiting on open... 
 Debug.js:130 [44] Manifest has been refreshed at Wed Feb 07 2018 15:00:37 GMT-0600 (Hora estándar, América Central)[1518037237.401]  
 Debug.js:130 [47] MediaSource is open! 
 Debug.js:130 [47] Duration successfully set to: 596.48 
 Debug.js:130 [48] Added 0 inline events 
 Debug.js:130 [49] No video data. 
 Debug.js:130 [49] No audio data. 
 Debug.js:130 [49] No text data. 
 Debug.js:130 [50] No fragmentedText data. 
 Debug.js:130 [51] No embeddedText data. 
 Debug.js:130 [52] Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines 
 Debug.js:130 [52] No image data. 
 Debug.js:130 [53] No streams to play. 

mp4文件与mpd文件位于同一路径,MP4Box也生成了一个dashinit.mp4文件。

mdp文件

 <?xml version="1.0"?>
 <!-- MPD file Generated with GPAC version 0.7.2-DEV-revUNKNOWN_REV  at 2018-02-07T18:37:55.769Z-->
 <MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H9M56.459S" maxSegmentDuration="PT0H0M6.000S" profiles="urn:mpeg:dash:profile:full:2011">
 <ProgramInformation moreInformationURL="http://gpac.io">
     <Title>bbb.mpd generated by GPAC</Title>
     </ProgramInformation>

 <Period duration="PT0H9M56.459S">
 <AdaptationSet segmentAlignment="true" maxWidth="854" maxHeight="480" maxFrameRate="24" par="854:480" lang="und">
 <Representation id="1" mimeType="video/mp4" codecs="mp4v.20.1" width="854" height="480" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="252026">
 <BaseURL>bbb_out_dashinit.mp4</BaseURL>
 <SegmentList timescale="12288" duration="49152">
     <Initialization range="0-947"/>
     <SegmentURL mediaRange="948-371939" indexRange="948-1027"/>
     <SegmentURL mediaRange="371940-598770" indexRange="371940-372019"/>
     <SegmentURL mediaRange="598771-719115" indexRange="598771-598850"/>
     <SegmentURL mediaRange="719116-845164" indexRange="719116-719195"/>
     <SegmentURL mediaRange="845165-939217" indexRange="845165-845244"/>
     <SegmentURL mediaRange="939218-1083759" indexRange="939218-939297"/>
     <SegmentURL mediaRange="1083760-1236268" indexRange="1083760-1083839"/>
     <SegmentURL mediaRange="1236269-1345284" indexRange="1236269-1236348"/>
     <SegmentURL mediaRange="1345285-1428505" indexRange="1345285-1345364"/>
     <SegmentURL mediaRange="1428506-1575514" indexRange="1428506-1428585"/>
     <SegmentURL mediaRange="1575515-1683015" indexRange="1575515-1575594"/>
     <SegmentURL mediaRange="1683016-1772957" indexRange="1683016-1683095"/>
     <SegmentURL mediaRange="1772958-1951623" indexRange="1772958-1773037"/>
     <SegmentURL mediaRange="1951624-2007815" indexRange="1951624-1951703"/>
     <SegmentURL mediaRange="2007816-2196819" indexRange="2007816-2007895"/>
     <SegmentURL mediaRange="2196820-2346549" indexRange="2196820-2196899"/>
     <SegmentURL mediaRange="2346550-2422631" indexRange="2346550-2346629"/>
     <SegmentURL mediaRange="2422632-2513555" indexRange="2422632-2422711"/>
     <SegmentURL mediaRange="2513556-2608893" indexRange="2513556-2513635"/>
     <SegmentURL mediaRange="2608894-2716457" indexRange="2608894-2608973"/>
     <SegmentURL mediaRange="2716458-2871087" indexRange="2716458-2716537"/>
     <SegmentURL mediaRange="2871088-3027517" indexRange="2871088-2871167"/>
     <SegmentURL mediaRange="3027518-3203104" indexRange="3027518-3027597"/>
     <SegmentURL mediaRange="3203105-3335227" indexRange="3203105-3203184"/>
     <SegmentURL mediaRange="3335228-3415345" indexRange="3335228-3335307"/>
     <SegmentURL mediaRange="3415346-3546065" indexRange="3415346-3415425"/>
     <SegmentURL mediaRange="3546066-3680253" indexRange="3546066-3546145"/>
     <SegmentURL mediaRange="3680254-3805628" indexRange="3680254-3680333"/>
     <SegmentURL mediaRange="3805629-3933292" indexRange="3805629-3805708"/>
     <SegmentURL mediaRange="3933293-4034604" indexRange="3933293-3933372"/>
     <SegmentURL mediaRange="4034605-4141186" indexRange="4034605-4034684"/>
     <SegmentURL mediaRange="4141187-4291704" indexRange="4141187-4141266"/>
     <SegmentURL mediaRange="4291705-4376607" indexRange="4291705-4291784"/>
     <SegmentURL mediaRange="4376608-4500789" indexRange="4376608-4376687"/>
     <SegmentURL mediaRange="4500790-4654093" indexRange="4500790-4500869"/>
     <SegmentURL mediaRange="4654094-4838338" indexRange="4654094-4654173"/>
     <SegmentURL mediaRange="4838339-5000967" indexRange="4838339-4838418"/>
     <SegmentURL mediaRange="5000968-5134554" indexRange="5000968-5001047"/>
     <SegmentURL mediaRange="5134555-5310739" indexRange="5134555-5134634"/>
     <SegmentURL mediaRange="5310740-5413540" indexRange="5310740-5310819"/>
     <SegmentURL mediaRange="5413541-5509680" indexRange="5413541-5413620"/>
     <SegmentURL mediaRange="5509681-5769750" indexRange="5509681-5509760"/>
     <SegmentURL mediaRange="5769751-5919447" indexRange="5769751-5769830"/>
     <SegmentURL mediaRange="5919448-5982728" indexRange="5919448-5919527"/>
     <SegmentURL mediaRange="5982729-6113405" indexRange="5982729-5982808"/>
     <SegmentURL mediaRange="6113406-6164963" indexRange="6113406-6113485"/>
     <SegmentURL mediaRange="6164964-6261817" indexRange="6164964-6165043"/>
     <SegmentURL mediaRange="6261818-6382431" indexRange="6261818-6261897"/>
     <SegmentURL mediaRange="6382432-6608733" indexRange="6382432-6382511"/>
     <SegmentURL mediaRange="6608734-6773092" indexRange="6608734-6608813"/>
     <SegmentURL mediaRange="6773093-6903031" indexRange="6773093-6773172"/>
     <SegmentURL mediaRange="6903032-7003808" indexRange="6903032-6903111"/>
     <SegmentURL mediaRange="7003809-7073030" indexRange="7003809-7003888"/>
     <SegmentURL mediaRange="7073031-7261463" indexRange="7073031-7073110"/>
     <SegmentURL mediaRange="7261464-7408699" indexRange="7261464-7261543"/>
     <SegmentURL mediaRange="7408700-7494904" indexRange="7408700-7408779"/>
     <SegmentURL mediaRange="7494905-7559720" indexRange="7494905-7494984"/>
     <SegmentURL mediaRange="7559721-7718295" indexRange="7559721-7559800"/>
     <SegmentURL mediaRange="7718296-7843295" indexRange="7718296-7718375"/>
     <SegmentURL mediaRange="7843296-8026646" indexRange="7843296-7843375"/>
     <SegmentURL mediaRange="8026647-8120020" indexRange="8026647-8026726"/>
     <SegmentURL mediaRange="8120021-8200525" indexRange="8120021-8120100"/>
     <SegmentURL mediaRange="8200526-8397978" indexRange="8200526-8200605"/>
     <SegmentURL mediaRange="8397979-8598474" indexRange="8397979-8398058"/>
     <SegmentURL mediaRange="8598475-8708686" indexRange="8598475-8598554"/>
     <SegmentURL mediaRange="8708687-8922854" indexRange="8708687-8708766"/>
     <SegmentURL mediaRange="8922855-9048866" indexRange="8922855-8922934"/>
     <SegmentURL mediaRange="9048867-9117310" indexRange="9048867-9048946"/>
     <SegmentURL mediaRange="9117311-9396562" indexRange="9117311-9117390"/>
     <SegmentURL mediaRange="9396563-9601586" indexRange="9396563-9396642"/>
     <SegmentURL mediaRange="9601587-9872600" indexRange="9601587-9601666"/>
     <SegmentURL mediaRange="9872601-10023397" indexRange="9872601-9872680"/>
     <SegmentURL mediaRange="10023398-10189135" indexRange="10023398-10023477"/>
     <SegmentURL mediaRange="10189136-10257212" indexRange="10189136-10189215"/>
     <SegmentURL mediaRange="10257213-10354360" indexRange="10257213-10257292"/>
     <SegmentURL mediaRange="10354361-10459304" indexRange="10354361-10354440"/>
     <SegmentURL mediaRange="10459305-10585444" indexRange="10459305-10459384"/>
     <SegmentURL mediaRange="10585445-10682468" indexRange="10585445-10585524"/>
     <SegmentURL mediaRange="10682469-10959442" indexRange="10682469-10682548"/>
     <SegmentURL mediaRange="10959443-11129350" indexRange="10959443-10959522"/>
     <SegmentURL mediaRange="11129351-11269555" indexRange="11129351-11129430"/>
     <SegmentURL mediaRange="11269556-11531406" indexRange="11269556-11269635"/>
     <SegmentURL mediaRange="11531407-11846144" indexRange="11531407-11531486"/>
     <SegmentURL mediaRange="11846145-11965717" indexRange="11846145-11846224"/>
     <SegmentURL mediaRange="11965718-12313906" indexRange="11965718-11965797"/>
     <SegmentURL mediaRange="12313907-12518743" indexRange="12313907-12313986"/>
     <SegmentURL mediaRange="12518744-12840608" indexRange="12518744-12518823"/>
     <SegmentURL mediaRange="12840609-12908817" indexRange="12840609-12840688"/>
     <SegmentURL mediaRange="12908818-13043983" indexRange="12908818-12908897"/>
     <SegmentURL mediaRange="13043984-13273328" indexRange="13043984-13044063"/>
     <SegmentURL mediaRange="13273329-13528268" indexRange="13273329-13273408"/>
     <SegmentURL mediaRange="13528269-13588626" indexRange="13528269-13528348"/>
     <SegmentURL mediaRange="13588627-13714270" indexRange="13588627-13588706"/>
     <SegmentURL mediaRange="13714271-13897127" indexRange="13714271-13714350"/>
     <SegmentURL mediaRange="13897128-13962922" indexRange="13897128-13897207"/>
     <SegmentURL mediaRange="13962923-14167752" indexRange="13962923-13963002"/>
     <SegmentURL mediaRange="14167753-14290028" indexRange="14167753-14167832"/>
     <SegmentURL mediaRange="14290029-14422261" indexRange="14290029-14290108"/>
     <SegmentURL mediaRange="14422262-14599322" indexRange="14422262-14422341"/>
     <SegmentURL mediaRange="14599323-14773932" indexRange="14599323-14599402"/>
     <SegmentURL mediaRange="14773933-14961284" indexRange="14773933-14774012"/>
     <SegmentURL mediaRange="14961285-15168471" indexRange="14961285-14961364"/>
     <SegmentURL mediaRange="15168472-15570586" indexRange="15168472-15168551"/>
     <SegmentURL mediaRange="15570587-16045908" indexRange="15570587-15570666"/>
     <SegmentURL mediaRange="16045909-16538110" indexRange="16045909-16045988"/>
     <SegmentURL mediaRange="16538111-17143952" indexRange="16538111-16538190"/>
     <SegmentURL mediaRange="17143953-17645813" indexRange="17143953-17144032"/>
     <SegmentURL mediaRange="17645814-17855829" indexRange="17645814-17645893"/>
     <SegmentURL mediaRange="17855830-17990494" indexRange="17855830-17855909"/>
     <SegmentURL mediaRange="17990495-18102479" indexRange="17990495-17990574"/>
     <SegmentURL mediaRange="18102480-18267167" indexRange="18102480-18102559"/>
     <SegmentURL mediaRange="18267168-18498008" indexRange="18267168-18267247"/>
     <SegmentURL mediaRange="18498009-18759580" indexRange="18498009-18498088"/>
     <SegmentURL mediaRange="18759581-18790384" indexRange="18759581-18759624"/>
   </SegmentList>
 </Representation>
</AdaptationSet>
</Period>
</MPD>

1 个答案:

答案 0 :(得分:0)

您的输入文件使用的视频编解码器(mp4v.20.1)似乎不受网络浏览器的支持,这可能是播放问题的一部分。

因此,您必须首先使用支持的编解码器对输入文件进行编码,例如: H264 / AVC,它应该按预期工作。这个tutorial逐步解释了如何使用MP4Box正确创建分段内容

仅供参考:为了检查,如果浏览器支持特定的编解码器/配置文件/级别,您可以对其进行测试here。只需复制并粘贴编解码器字符串,然后点击&#34;测试!&#34;按钮。