1、修改Flash Media Live Encoder下\Conf\config.xm,將標記flashmedialiveencoder_config/mbrconfig/streamsynchronization/enable設置為true:
2、Adobe Media Server安裝目錄下applications/livepkgr/events/_definst_/liveevent刪除Manifest.xml文件或重命名,編輯Event.xml使其如下所示
<Event>
<EventID> liveevent </ EventID>
<Recording>
<FragmentDuration> 4000 </ FragmentDuration>
<SegmentDuration> 16000 </ SegmentDuration>
<DiskManagementDuration> 3 </ DiskManagementDuration>
</ Recording>
</ Event>
3、要創建F4M集合清單:
a 瀏覽器中打開安裝目錄/tools/f4mconfig/configurator/f4mconfig.html,選擇f4m文件類型,Base URL輸入以下內容:http://localhost/hds-live/livepkgr/_definst_/liveevent
b 單擊add按鈕添加
Stream URI Bitrate
livestream1.f4m 150
livestream2.f4m 500
livestream3.f4m 700
c 預覽文件,單擊View Manifest,清單文件如下所示:
<manifest xmlns="http://ns.adobe.com/f4m/2.0"> <font></font>
<baseURL>http://localhost/hds-live/livepkgr/_definst_/liveevent/</baseURL> <font></font>
<media href="livestream1.f4m" bitrate="150"/> <font></font>
<media href="livestream2.f4m" bitrate="500"/> <font></font>
<media href="livestream3.f4m" bitrate="700"/> <font></font>
</manifest>
d 單擊Save Manifest,文件另存為liveevent.f4m到webroot目錄下
5、創建M3U8變體播放列表文件
a 瀏覽器打開tools/f4mconfig/configurator/f4mconfig.html,選擇m3u8
b 為每個流輸入Stream URI和bitrate
Stream URI Bitrate
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream1.m3u8 150
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream2.m3u8 500
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream3.m3u8 700
c 對于m3u8文件,可以選擇為每個流添加一個編解碼器。如果一個流僅是音頻,請指定一個音頻編解碼器
d 點擊View Manifest查看清單:
#EXTM3U <font></font>
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=150000 <font></font>
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream1.m3u8 <font></font>
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=500000 <font></font>
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream2.m3u8 <font></font>
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=700000 <font></font>
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream3.m3u8
e 文件另存為liveevent.m3u8到文件夾rootinstall / webroot
6、將實時流發布到Adobe Media Server,請啟動Flash Media Live Encoder并執行以下操作
a 在“ Encoding Options”面板中,從“ Preset(預設)”彈出菜單中,選擇“Multi Bitrate(多比特率-)3個流(1500 Kbps)-H.264”。如果有音頻,Audio打勾 選擇“Format為 AAC”。
b 單擊Format旁邊的扳手,打開Advanced Encoder Settings.Keyframe frequency(關鍵幀頻率),選擇4秒(與Applications / livepkgr / events / _definst_ / liveevent / Event.xml文件中的<FragmentDuration>值匹配)。
c 對于“Bit Rate(比特率)”,請選擇150、500和700
d 在“ AMS URL”文本框中,輸入以下內容:rtmp://localhost/ livepkgr
e Stream文本框輸入:livestream%i?adbe-live-event = liveevent或者livestream1?adbe-live-event = liveevent,livestream2?adbe-live-event = liveevent。
f 保存設置到文件
g 點擊Start
7、播放:拷貝 samples / videoPlayer到rootinstall / webroot 瀏覽器中輸入http://localhost/videoPlayer/videoplayer.html
STREAM URL中輸入http://localhost/liveevent.f4m