如何解决Mpeg Dash中自适应比特率切换的问题?

时间:2016-09-12 13:53:18

标签: mpeg-dash dash.js mp4box

我使用以下MP4Box命令生成清单文件(.mpd)。清单文件对于不同的视频表示是通用的。

MP4Box -dash 5000 -frag 5000 -fps 25 -frag-rap -rap -bs-switching merge -profile dashavc264:live -mpd-title "Mpeg Dash Preview" -segment-ext null -segment-name seg_ -out test.mpd resolution_480p.mp4#video:baseURL=./v/ resolution_360p.mp4#video:baseURL=./v_360/ resolution_720p.mp4#video:baseURL=./v_720/ resolution_480p.mp4#audio:baseURL=./a/

虽然dash.js正在播放视频,但只有单比特率正在播放而不根据网络状况切换分辨率。我在命令中遗漏了什么吗?或者我应该在播放器中启用自适应比特率切换?

清单文件

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.6.0-revUNKNOWN-UNKNOWN  at 2016-09-12T11:58:50.789Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H1M2.502S" maxSegmentDuration="PT0H0M5.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash264">
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
<Title>Mpeg Dash Preview</Title>
</ProgramInformation>
<Period duration="PT0H1M2.502S">
<AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="25" par="28800:15480" lang="und">
<SegmentTemplate timescale="12800" media="seg_$Number$" startNumber="1" duration="64000" initialization="seg_init"/>
<Representation id="1" mimeType="video/mp4" codecs="avc1.42c015" width="480" height="360" frameRate="25" sar="60:43" startWithSAP="1" bandwidth="796236">
<BaseURL>./v/</BaseURL>
</Representation>
<Representation id="2" mimeType="video/mp4" codecs="avc1.42c01e" width="640" height="480" frameRate="25" sar="60:43" startWithSAP="1" bandwidth="1208202">
<BaseURL>./v_360/</BaseURL>
</Representation>
<Representation id="3" mimeType="video/mp4" codecs="avc1.42c01f" width="1280" height="720" frameRate="25" sar="45:43" startWithSAP="1" bandwidth="2715861">
<BaseURL>./v_720/</BaseURL>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" lang="hin">
<SegmentTemplate timescale="48000" media="seg_$Number$" startNumber="1" duration="240000" initialization="seg_init"/>
<Representation id="4" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" startWithSAP="1" bandwidth="343385">
<BaseURL>./a/</BaseURL>
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
</Representation>
</AdaptationSet>
</Period>
</MPD>

0 个答案:

没有答案