MPEG-DASH创建初始化段

时间:2014-06-19 10:28:13

标签: ffmpeg video-streaming mpeg-dash

我正在使用ffmpeg -segment对桌面的视频捕获进行细分并通过网络发送,以便提供给客户端并使用dash.js进行播放。问题是玩家正在搜索初始化段,我似乎无法弄清楚如何创建它 我使用这个ffmpeg命令创建段:

ffmpeg -rtbufsize 1500M -f dshow -r 15 -i video="UScreenCapture"
-flags +global_header -vcodec libvpx -crf 10 -quality good -keyint_min 15 -g 15
-cpu-used 3 -b:v 1000k -qmin 10 -qmax 42  -threads 2 -vf scale=-1:480 -bufsize 1
500 -map 0 -f stream_segment -segment_time 2 -segment_format webm http://localho
st:3000/stream/22/%03d

我为流创建的清单看起来像这样:

<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" type="dynamic" availabilityStartTime="2014-06-19T07:47:40.079Z" minBufferTime="PT0S" profiles="urn:mpeg:dash:profile:isoff-live:2011" suggestedPresentationDelay="PT40S" maxSegmentDuration="PT2.000S" minimumUpdatePeriod="PT1000M">
<Period id="1" bitstreamSwitching="true" start="PT0S">
<AdaptationSet mimeType="video/webm" segmentAlignment="true" startWithSAP="1" maxWidth="1280" maxHeight="720" maxFrameRate="15">
<ContentComponent id="1" contentType="video"/>
<SegmentTemplate presentationTimeOffset="0" timescale="90000" media="$Number$/" duration="180000" startNumber="0"/>
<Representation id="1" width="853" height="480" frameRate="15" bandwidth="1000000" codecs="vp8"/>
</AdaptationSet>
</Period>
</MPD> 

播放器调试模式打印以下内容:

Getting the request for time: 0 dash.all.js:2073
Index for time 0 is 0 dash.all.js:2073
Waiting for more video buffer before starting playback. dash.all.js:2073
BufferController video seek: 0 dash.all.js:2073
Marking a special seek for initial video playback. dash.all.js:2073
Start searching for initialization. dash.all.js:2073
Perform init search: stream/22/ dash.all.js:2073
Getting the request for time: 0 dash.all.js:2073
Index for time 0 is 0 dash.all.js:2073
Data changed - loading the video fragment for time: 0 dash.all.js:2073
Getting the request for time: 0 

如何为生成的段创建初始化段?我似乎无法让它发挥作用。

1 个答案:

答案 0 :(得分:0)

我不知道如何从ffmpeg获取初始化段以及媒体段,但是您可以使用其他几种工具来生成MPEG-DASH段,例如:edash-packager和这个模块用于nginx:nginx-rtmp-module with DASH option,来自GPAC的DashCast或来自ITEC大学的DASHEncoder等。