FMS的安装、基本配置及基本测试

来源:互联网 发布:拓扑图算法 编辑:程序博客网 时间:2024/05/21 11:02

下载及安装

下载地址:
http://www.adobe.com/support/flashmediaserver/downloads_updaters.html
最新已经到了5.0.10版了,全部默认安装即可
序列号:1652-5826-9939-6068-8981-7289(源于网络)
激活后为extented版

配置

1、修改rootinstall/conf/fms.ini, 将其中的
ADAPTOR.HOSTPORT = :1935,80一行,改为
ADAPTOR.HOSTPORT =:1935;
同时,将其中
HTTPPROXY.HOST = :8134一行,改为:
HTTPPROXY.HOST =

2、FMS中自带的apache默认端口为8134,可以与自己安装的apache共存,只要监听不同的端口就行

3、HTTP Origin Module 不用配置,FMS自带安装的Apache都已经配置好了这些支持Http Dynamic Streaming的模块,主要用于点播 和直播时下发流媒体数据到观看端

4、配置FMS server在直播时使用绝对时间,打开rootinstall/applications/livepkgr/Application.xml,修改 /Application/StreamManager/Live/AssumeAbsoluteTime节点为true.

<Application>    <StreamManager>        <Live>            <AssumeAbsoluteTime>true</AssumeAbsoluteTime>        </Live>    </StreamManager></Application>

5、修改rootinstall/conf/Server.xml,将MaxFlushTime的值改为1

<Root>     <Server>        <ResourceLimits>             <RecBuffer>                <MaxFlushTime> 1 <MaxFlushTime>            </RecBuffer>        </ResourceLimits>     </Server></Root> 

自定义application及event

以下说明将自定义一个application:xlive,及一个event:lives
1、在rootinstall\application下新建目录xlive
2、将rootinstall\samples\applications\livepkgr下的所有文件拷贝到xlive目录下
3、在rootinstall\applications\xlive\events_definst_下新建目录lives
4、将rootinstall\applications\xlive\events_definst_\liveevent下的所有文件拷贝到3新建的目录下
5、修改rootinstall\applications\xlive\events_definst_\lives\event.xml,主要是修改eventid,其他参数视实际情况定:

<Event>  <EventID>lives</EventID>  <Recording>    <FragmentDuration>2000</FragmentDuration>    <SegmentDuration>4000</SegmentDuration>    <DiskManagementDuration>0.02</DiskManagementDuration>  </Recording></Event>

基本测试

测试需要直播源,可以使用网络上公用的直播源:
rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov
rtmp://live.hkstv.hk.lxdns.com/live/hks
http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8

或者安装Flash Media Live Encoder捕获电脑的摄像头和麦克风制作直播源:
下载地址:
http://www.adobe.com/products/flash-media-encoder.html
安装后将其conf/config.xml的/flashmedialiveencoder_config /mbrconfig/streamsynchronization/enable节点值为true.
(使用绝对时间)

<mbrconfig>    <streamsynchronization>        <enable>true</enable>    </streamsynchronization></mbrconfig>

Flash Media Live Encoder的音视频编码配置详见下图:
这里写图片描述
这里设置里3个bitrate(用于实际使用中pc和mobile使用不同的视频质量),并且在右边stream栏里有%i用于匹配这3个bitrate:
xstream_%i?adbe-live-event=lives

WEB显示测试(PC及移动)

pc及安卓使用flash播放rtmp,ios使用h5的video播放hls(m3u8)。
经过测试,最后选用ckplayer,它在pc、安卓、ios及对rtmp的支持最好(只是我测试的,如果有其他的或者自己写的flash播放器也可以)。

<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no"></head><body><div id="a1"></div><script type="text/javascript" src="ckplayer/ckplayer.js" charset="utf-8"></script><script type="text/javascript">    CKobject.embed('ckplayer/ckplayer.swf','a1','ckplayer_a1','480','300',false,{f:'rtmp://192.168.1.128/xlive/xstream_1',c:0,b:1},['http://192.168.1.128:8134/hls-live/xlive/_definst_/lives/xstream_1.m3u8']);</script></body></html>

结果:
这里写图片描述
这里写图片描述

1 0
原创粉丝点击