1

我使用以下 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>
4

0 回答 0