DASH包(mpd)我在提升onratechange事件后冻结了

时间:2016-03-03 22:01:59

标签: html5 ffmpeg dash.js bento

我正在尝试从mp4文件创建自适应流。我在做流媒体方面有很多经验,并且已成功通过Silverlight实现流畅的流媒体。我们想要一个适用于HTML5的一切解决方案。我在追求DASH。以下是我采取的步骤......

  1. 使用ffmpeg将mp4重新取样为不同的尺寸。
  2. 使用Bento4s mp4Fragment实用程序确保文件正确分段。
  3. 使用Bento4s mp4dash实用程序创建DASH mpd文件及相关的段。
  4. 我已经做了很多工作来学习这些实用程序,并创建一个我认为可以工作的输出流程。创建可靠的DASH工件。但似乎我做错了什么。以下是我运行的命令行示例。

    对于第一步,我创建了三个不同的文件......对于三种不同的速率和大小......(这些可能不是确切的命令行,它们来自旧笔记......但参数值是我的那些肯定使用)

    ffmpeg -y -i C:\_SIMULATED_SHARE_C\ff\big_buck_bunny.mp4 -c:v libx264 -x264opts keyint=24:min-keyint=24:no-scenecut -b:v 1500k -maxrate 1500k -bufsize 1000k -vf "scale=-1:720" C:\_SIMULATED_SHARE_C\ff\output\outputfile720.mp4
    
    ffmpeg -y -i C:\_SIMULATED_SHARE_C\ff\big_buck_bunny.mp4 -c:v libx264 -x264opts keyint=24:min-keyint=24:no-scenecut -b:v 800k -maxrate 800k -bufsize 500k -vf "scale=-1:540" C:\_SIMULATED_SHARE_C\ff\output\outputfile540.mp4
    
    ffmpeg -y -i C:\_SIMULATED_SHARE_C\ff\big_buck_bunny.mp4 -c:v libx264 -x264opts keyint=24:min-keyint=24:no-scenecut -b:v 400k -maxrate 400k -bufsize 400k -vf "scale=-1:360" C:\_SIMULATED_SHARE_C\ff\output\outputfile360.mp4
    

    这样就可以为您提供需要分段的三个文件。所以我使用Bento4的mp4fragment实用程序对它们进行分段。该命令行很简单,所以我不提供一个例子。

    我使用Bento4s mp4dash来创建破折号。像这样......

    "E:\\_INSTALL\\Bento4\\Bento4-SDK-1-4-3-607.x86-microsoft-win32-vs2010\\Bento4-SDK-1-4-3-607.x86-microsoft-win32-vs2010\\bin\\mp4dash.exe --mpd-name=\"\\\\d9fqt52\\_SIMULATED_SHARE_C\\ff\\output\\dash\\something.mpd\" -f -o \"\\\\d9fqt52\\_SIMULATED_SHARE_C\\ff\\output\\dash\" \"\\\\d9fqt52\\_SIMULATED_SHARE_C\\ff\\output\\bunny360f.mp4\" \"\\\\d9fqt52\\_SIMULATED_SHARE_C\\ff\\output\\bunny540f.mp4\" \"\\\\d9fqt52\\_SIMULATED_SHARE_C\\ff\\output\\bunny720f.mp4\" "
    

    运行正常。并创建mpd文件,带有段文件的音频文件夹,带有3个文件夹的视频文件夹,每个文件夹带有段文件。

    我可以配置IIS来播放mpd ok。以及segement文件。视频播放正常...然后停止播放。它在50到60秒之间冻结。在冻结之前,我可以确认HTML5视频标记的onratechange事件已经引发。这是一个随着比赛的变化而提高的事件。我没有做任何改变,只是发生了。

    有问题的实际视频大约1小时。我也使用dash.js库作为播放器。

    如果您可以识别我应该更改的任何组件或细节,请告诉我们!

    2016年3月7日更新

    这里要求的是MPD内容......

    <?xml version="1.0" ?>
    <MPD mediaPresentationDuration="PT51M51.909S" minBufferTime="PT0.80S" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011">
      <!-- Created with Bento4 mp4-dash.py, VERSION=1.6.0-607 -->
      <Period>
        <!-- Audio -->
        <AdaptationSet lang="en" mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1">
          <SegmentTemplate duration="801" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4f" startNumber="1" timescale="1000"/>
          <Representation audioSamplingRate="48000" bandwidth="132491" codecs="mp4a.40.2" id="audio/en">
            <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
          </Representation>
        </AdaptationSet>
        <!-- Video -->
        <AdaptationSet maxHeight="720" maxWidth="1280" mimeType="video/mp4" minHeight="540" minWidth="640" segmentAlignment="true" startWithSAP="1">
          <SegmentTemplate duration="801" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4f" startNumber="1" timescale="1000"/>
          <Representation bandwidth="785536" codecs="avc1.64001F" frameRate="30000/1001" height="540" id="video/1" scanType="progressive" width="960"/>
          <Representation bandwidth="403537" codecs="avc1.64001E" frameRate="30000/1001" height="360" id="video/2" scanType="progressive" width="640"/>
          <Representation bandwidth="1496514" codecs="avc1.64001F" frameRate="30000/1001" height="720" id="video/3" scanType="progressive" width="1280"/>
        </AdaptationSet>
      </Period>
    </MPD>
    

    2016年3月7日更新

    这是两个不同视频的控制台输出,这些视频在50到60秒之间因某种未知原因而停止

    ///ABS VIDEO 
    
    58393][rulesController] [RULES]: playbackTimeRule [Fragment:download,82,MediaSegment,0video] Default 
    dash.all.js:11 [58395][rulesController] [RULES]: sameTimeRequestRule [Fragment:download,82,MediaSegment,0,video] Default 
    dash.all.js:11 [58401][indexHandler][audio] Getting the request for time: 82.082 
    dash.all.js:11 [58403][indexHandler][audio] Index for time 82.082 is 81 
    dash.all.js:11 [58405][indexHandler][audio] SegmentTemplate: 81.08099999999999 / 1361.235 
    dash.all.js:11 [58406][indexHandler][audio] SegmentTemplate: 82.082 / 1361.235 
    dash.all.js:11 [58407][rulesController] [RULES]: playbackTimeRule [Fragment:download,82,MediaSegment,0audio] Default 
    dash.all.js:11 [58417][fragmentLoader] loaded video:MediaSegment:82.082 (200, 18ms, 2ms) 
    dash.all.js:11 [58419][rulesController] [RULES]: sameTimeRequestRule [Fragment:download,82,MediaSegment,0,audio] Default 
    dash.all.js:11 [58435][fragmentLoader] loaded audio:MediaSegment:82.082 (200, 14ms, 0ms) 
    dash.all.js:11 [59390][indexHandler][video] Getting the request for time: 83.083 
    dash.all.js:11 [59392][indexHandler][video] Index for time 83.083 is 82 
    dash.all.js:11 [59393][indexHandler][video] SegmentTemplate: 82.082 / 1361.235 
    dash.all.js:11 [59394][indexHandler][video] SegmentTemplate: 83.08299999999998 / 1361.235 
    dash.all.js:11 [59395][rulesController] [RULES]: playbackTimeRule [Fragment:download,83,MediaSegment,0video] Default 
    dash.all.js:11 [59396][rulesController] [RULES]: sameTimeRequestRule [Fragment:download,83,MediaSegment,0,video] Default 
    dash.all.js:11 [59401][indexHandler][audio] Getting the request for time: 83.083 
    dash.all.js:11 [59403][indexHandler][audio] Index for time 83.083 is 82 
    dash.all.js:11 [59404][indexHandler][audio] SegmentTemplate: 82.082 / 1361.235 
    dash.all.js:11 [59406][indexHandler][audio] SegmentTemplate: 83.08299999999998 / 1361.235 
    dash.all.js:11 [59408][rulesController] [RULES]: playbackTimeRule [Fragment:download,83,MediaSegment,0audio] Default 
    dash.all.js:11 [59416][fragmentLoader] loaded video:MediaSegment:83.08299999999998 (200, 17ms, 1ms) 
    dash.all.js:11 [59418][rulesController] [RULES]: sameTimeRequestRule [Fragment:download,83,MediaSegment,0,audio] Default 
    dash.all.js:11 [59437][fragmentLoader] loaded audio:MediaSegment:83.08299999999998 (200, 14ms, 1ms) 
    dash.all.js:11 [59902][scheduleController][video] Stalling Buffer 
    dash.all.js:11 [59903][bufferController][video] Waiting for more buffer before starting playback. 
    dash.all.js:11 [59906][scheduleController][audio] Stalling Buffer 
    dash.all.js:11 [59907][bufferController][audio] Waiting for more buffer before starting playback. 
    dash.all.js:11 [63684][playbackController] <video> ratechange:  0 
    
    
    
    
    ///HOG VIDEO
    
    [58250][rulesController] [RULES]: playbackTimeRule [Fragment:download,105,MediaSegment,0audio] Default 
    dash.all.js:11 [58266][fragmentLoader] loaded video:MediaSegment:84.105 (200, 28ms, 1ms) 
    dash.all.js:11 [58269][rulesController] [RULES]: sameTimeRequestRule [Fragment:download,105,MediaSegment,0,audio] Default 
    dash.all.js:11 [58287][fragmentLoader] loaded audio:MediaSegment:84.105 (200, 14ms, 1ms) 
    dash.all.js:11 [58982][indexHandler][video] Getting the request for time: 84.906 
    dash.all.js:11 [58983][indexHandler][video] Index for time 84.906 is 105 
    dash.all.js:11 [58984][indexHandler][video] SegmentTemplate: 84.105 / 3111.909 
    dash.all.js:11 [58984][indexHandler][video] SegmentTemplate: 84.906 / 3111.909 
    dash.all.js:11 [58985][rulesController] [RULES]: playbackTimeRule [Fragment:download,106,MediaSegment,0video] Default 
    dash.all.js:11 [58986][rulesController] [RULES]: sameTimeRequestRule [Fragment:download,106,MediaSegment,0,video] Default 
    dash.all.js:11 [58989][indexHandler][audio] Getting the request for time: 84.906 
    dash.all.js:11 [58990][indexHandler][audio] Index for time 84.906 is 105 
    dash.all.js:11 [58991][indexHandler][audio] SegmentTemplate: 84.105 / 3111.909 
    dash.all.js:11 [58992][indexHandler][audio] SegmentTemplate: 84.906 / 3111.909 
    dash.all.js:11 [58993][rulesController] [RULES]: playbackTimeRule [Fragment:download,106,MediaSegment,0audio] Default 
    dash.all.js:11 [59002][fragmentLoader] loaded video:MediaSegment:84.906 (200, 14ms, 1ms) 
    dash.all.js:11 [59003][rulesController] [RULES]: sameTimeRequestRule [Fragment:download,106,MediaSegment,0,audio] Default 
    dash.all.js:11 [59014][fragmentLoader] loaded audio:MediaSegment:84.906 (200, 8ms, 1ms) 
    dash.all.js:11 [59735][scheduleController][video] Stalling Buffer 
    dash.all.js:11 [59736][bufferController][video] Waiting for more buffer before starting playback. 
    dash.all.js:11 [59738][scheduleController][audio] Stalling Buffer 
    dash.all.js:11 [59739][bufferController][audio] Waiting for more buffer before starting playback. 
    dash.all.js:11 [61695][playbackController] <video> ratechange:  0 
    

1 个答案:

答案 0 :(得分:0)

您可以提供更多信息,例如bento产生的清单,以及播放停止时dash.js生成的调试控制台日志吗?此外,您使用的是哪个版本的dash.js - 最新发布的版本是2.0,您可以在https://github.com/Dash-Industry-Forum/dash.js.git

从/ dev分支获取每晚构建版本

干杯

威尔