应用强到缓冲规则。退出切换比特率MPEG DASH

时间:2015-07-14 11:28:55

标签: google-chrome video ffmpeg mpeg-dash

我正在使用mpeg dash从我的服务器中自适应比特率视频流。

我使用ffmpeg和MP4Box从我的源码生成4个不同质量的视频文件.mp4

生成的.mpd文件具有以下代码

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.5.1-DEV-rev5619  on 2015-07-14T11:07:18Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H3M1.42S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
 <ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
  <Title>test/test.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT0H3M1.42S">
  <AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="24" par="16:9" lang="und" subsegmentStartsWithSAP="1">
   <Representation id="1" mimeType="video/mp4" codecs="avc1.64000d" width="320" height="240" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="375715">
    <BaseURL>400_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="904-1403">
      <Initialization range="0-903"/>
    </SegmentBase>
   </Representation>
   <Representation id="2" mimeType="video/mp4" codecs="avc1.640015" width="420" height="270" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="644824">
    <BaseURL>700_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="905-1404">
      <Initialization range="0-904"/>
    </SegmentBase>
   </Representation>
   <Representation id="3" mimeType="video/mp4" codecs="avc1.64001f" width="1024" height="576" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="1349484">
    <BaseURL>1500_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="905-1404">
      <Initialization range="0-904"/>
    </SegmentBase>
   </Representation>
   <Representation id="4" mimeType="video/mp4" codecs="avc1.64001f" width="1280" height="720" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="2264379">
    <BaseURL>2500_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="905-1404">
      <Initialization range="0-904"/>
    </SegmentBase>
   </Representation>
   <Representation id="5" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="24" sar="1:1" startWithSAP="1" bandwidth="3633049">
    <BaseURL>4000_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="906-1405">
      <Initialization range="0-905"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>

我正在使用video.js和dash.js来播放客户端的mpeg破折号内容。问题是,当我从chrome dev工具模拟网络状况时,视频无法完美播放。

它有时会起作用,而不适用于其他人。例如,流以400kbps的比特率开始,然后检测到足够的可用带宽,因此切换到2500kbps。然后,当我再次将带宽降低到400kbps时,视频会在某个时间点冻结​​。

有时,当视频尝试切换流时,视频会在几秒钟的初始播放后冻结。我认为在通过ffmpeg生成视频文件或通过MP4Box生成.mpd文件时,可能会出现一些命令行参数。

下面是我用于ffmpeg和MP4Box的命令

ffmpeg -y -i inputfile -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -r 24 – g 24 -b:v 1500k -maxrate 1500k -bufsize 1000k -vf "scale=-1:720" outputfile.mp4


MP4Box -dash [DURATION] -rap -frag-rap -profile [PROFILE] -out [path/to/outpout.file] [path/to/input1.file] [path/to/input2.file] [path/to/input3.file]

此外,当我通过MP4Box生成.mpd文件时,我在控制台

中收到以下警告
[DASH]: Files have non-proportional track layouts (320x240 vs 420x270) but sample size and aspect ratio match, assuming precision issue
[DASH]: Files have non-proportional track layouts (320x240 vs 1024x576) but sample size and aspect ratio match, assuming precision issue
[DASH]: Files have non-proportional track layouts (320x240 vs 1280x720) but sample size and aspect ratio match, assuming precision issue
[DASH]: Files have non-proportional track layouts (320x240 vs 1920x1080) but sample size and aspect ratio match, assuming precision issue

每当视频停止播放时,Chrome控制台都会显示这些日志

Number of times the buffer has run dry: 25
Apply STRONG to buffer rule.
Quit switching bit rates.

我没有任何关于为什么缓冲区干涸并且停止切换比特率的线索。

过程中哪些主要是错误的?

0 个答案:

没有答案