CentOS7下安装配置流媒体服务器FMS5.0

来源:互联网 发布:战锤全面战争 mac中文 编辑:程序博客网 时间:2024/05/30 05:16

背景:因工作需要,要研究一些流媒体服务器相关的技术,主要是为了搭建直播所用的服务器,本文是基于CentOS7搭建FMS流媒体服务器,利用OBS推流工具可实现简单的直播、观看功能。先说明一下AMS全称是adobe media server,在5.0版本之前名称是FMS(flash media server)。

  • 下载

我们可以直接从adobe官网下载最新版本的Adobe Media Server,因为我们是在Linux系统搭建的环境,这里选择Download the Linux Update (64-bit)。点击跳转下载页面

下载完成之后,上传至/use/local路径下,然后就可以开始解压安装了。

[root@bogon ~]# cd /usr/local/[root@bogon local]# lsAdobeMediaServer5_x64.tar.gz  bin  etc  games  include  lib  lib64  libexec  sbin  share  src

  • 安装

我们把刚才上传的AdobeMediaServer5_x64.tar.gz先解压

tar -zxvf AdobeMediaServer5_x64.tar.gz

解压成功后进入目录

cd AMS_5_0_14_r4006/

执行安装命令:

./installAMS

安装的步骤比较多,如果不是特殊需求,可以默认安装(出现提示敲回车就行~)j_0010.gif


注意了(敲黑板!~),重点开始了,下面开始详细的安装流程


由于我是CentOS 7.2 64bit版本,所以安装的过程中出现此提示:

WARNING: Your Linux distribution, RedHat i386_x64  is not supported by this         Adobe Media Server installer.Copyright(C) 1993-2013 Adobe Systems Incorporated. All rights reserved.Adobe Media Server 5 for LinuxAdobe Media Server 5 will be installed on this machine.You will be asked a series of questions during the installprocess and will be presented with the defaults for these questions.Support is available at http://www.adobe.com/go/amsTo install Adobe Media Server now, press ENTER.To cancel the installation at any time, press Control-C.

大概的意思就是这个FMS版本不支持这个系统版本,安装的时候可能会遇到问题,确定要继续安装的话敲ENTER键,要随时取消安装,请按Control-C。这仅仅是警告,依然不影响使用。这时候,敲回车继续安装。


这时候会出现一个说明,很长~ 很长~

ADOBE MEDIA SERVER End User License AgreementNOTICE TO USER:    THIS END USER LICENSE AGREEMENT (.GREEMENT. GOVERNS INSTALLATION  AND  USE  BY  LICENSEES  OF  THE  ADOBE  SOFTWARE  DESCRIBED  HEREIN. LICENSEE AGREES THAT THIS AGREEMENT IS LIKE ANY WRITTEN NEGOTIATED AGREEMENT SIGNED BY LICENSEE.  BY CLICKING TO ACKNOWLEDGE AGREEMENT TO BE BOUND DURING REVIEW OF AN ELECTRONIC VERSION OF THIS LICENSE, OR DOWNLOADING, COPYING, INSTALLING OR USING THE SOFTWARE, LICENSEE ACCEPTS ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.   THIS AGREEMENT IS ENFORCEABLE AGAINST ANY PERSON OR ENTITY THAT INSTALLS AND USES THE SOFTWARE AND ANY PERSON OR ENTITY (E.G., SYSTEM INTEGRATOR, CONSULTANT OR CONTRACTOR) THAT INSTALLS OR USES THE SOFTWARE ON ANOTHER PERSON. OR ENTITY. BEHALF.THIS AGREEMENT SHALL APPLY ONLY TO THE SOFTWARE TO WHICH LICENSEE HAS OBTAINED A VALID LICENSE REGARDLESS OF WHETHER OTHER SOFTWARE IS REFERRED TO OR DESCRIBED HEREIN.LICENSEE. RIGHTS UNDER THIS AGREEMENT MAY BE SUBJECT TO ADDITIONAL TERMS AND CONDITIONS IN A SEPARATE WRITTEN AGREEMENT WITH ADOBE THAT SUPPLEMENTS OR SUPERSEDES ALL OR PORTIONS OF THIS AGREEMENT.1.    Definitions1.1.        .dobe. means  Adobe  Systems  Incorporated, a  Delaware  corporation, 345  Park  Avenue,  San  Jose, California 95110, if subsection 9(a) of this Agreement applies; otherwise it means Adobe Systems Software Ireland Limited, 4-6 Riverwalk Drive, Citywest Business Campus, Saggart D24, Dublin, Republic of Ireland, a company organized under the laws of Ireland and an affiliate and licensee of Adobe Systems Incorporated.1.2         "Adobe Runtime" means Adobe AIR, Adobe Flash Player and any other future runtimes utilizing Adobe.Flash technology distributed by Adobe or its licensees. 1.3        .uthorized Users.means employees and individual contractors (i.e., temporary employees) of Licensee that (a) develop and/or build applications using the Software; and/or (b) use the Software to deliver Content to end users.1.4         .omputer.means one or more central processing units in a hardware device (including hardware devices accessed by multiple users through a network that accepts information in digital or similar form and manipulates it for a specific result based on a sequence of instructions.1.5         .onnections.means the number of connections over which the client can receive and deliver Content from a single Computer or Virtual Computer where the Software is installed.1.6         .oncurrent Connections.means the total number of simultaneous Connections from software clients to aspecific Computer or Virtual Computer.1.7         .ontent.means video, audio and/or data files in file formats supported by the Software and may be protected according to the Documentation.1.8         .ontent  Encryption  Key. means  a  cryptographic  value  for  use  in  encrypting  Content  for  securedistribution and to decrypt encrypted Content for access and use in accordance with the accompanying metadata.1.9         .tarter Server.means Adobe Media Server Starter, a particular configuration and license ofthe Software with a limited number of Concurrent Connections.......

如果你想看的话不妨仔细阅读以下,不过并没什么用。这里我就直接跳过了,按键盘上的Q键或者ctrl+c跳过。之后就会出现:

Do you agree with the license agreement? (y/n):

你同意许可协议吗?(y/n),这里不用多说了吧,不同意就退出安装了,输入y同意,随后就会出现:

Please enter your Adobe Media Server 5 serial number.

请输入您的Adobe Media Server 5序列号。

好吧,其实并不是免费的,所以我们需要一个序列号:1652-5580-8001-8333-2201-1631键入序列号继续

Congratulations.  You have enabled theAdobe Media Server Extended!Adobe Media Server 5 requires approximately 200MB ofdisk space.The installer will install Adobe Media Server 5 in thefollowing directoryDefault [/opt/adobe/ams]:

出现此提示说明序列号可用,他提示我们安装大约需要200M的磁盘空间,将默认安装在/opt/adobe/ams路径下。如果想要安装在其他路径下,在这里输入路径,默认路径可以直接回车。

我把他安装在/usr/local路径下了,这里输入/usr/local/ams,继续

The administrative user name and password you provide here is required to usethe Adobe Media Server Management Console foradministration, monitoring, and debugging.Please enter the administrative username:

这里的意思大概就是需要一个用户名和密码,通过Adobe媒体服务器管理控制台进行管理、监控和调试,需要在这里输入用户名,比如:admin,继续

For increased security, enter a password of at least 8 characters. Please enter the administrative password:

接着要求我们输入密码,我设置的密码是:12345678。密码最少是8位,紧接着重复输入一次密码。

When the Adobe Media Server service is started, the servicecan be run as a user other than "root". The server would change to this userwhen the server is started and has acquired its ports.Please enter the user that the Adobe Media Server service will run asDefault user [ams]:

接着提示我们FMS服务以什么身份运行,这里我们默认就行,直接回车,默认的是【ams】

User "ams" does not exist. Do you want to create it?(y/n)Default [y]:

之后会提示我们ams用户不存在,要帮我们创建该用户,接受便可,直接回车,默认是【y】

User "ams" does not exist. Do you want to create it?(y/n)Default [y]:

接着会提示我们,要创建一个用户所归属的组,这里我们默认就行,直接回车,默认的是【ams】

Group "ams" does not exist!.  This installer will create one ...User "ams" created and added to group "ams"Do you want to install apache? (y/n)Default [y]:

接着提示我们,组ams不存在,帮我们创建了该组,创建了ams用户并添加到了该组中。

然后提示我们是否需要安装apache,这个时候你输入y会自动安装apache。因为我已经安装了nginx,所以,我输入了:n

The Adobe Media Server communicates on the IANA-assignedport of 1935, which is the port most Flash applications expect,and can also communicate on port 80over RTMPT, HTTP webserver proxy, and for HTTP Dynamic Streaming origin services.Please enter the Adobe Media Server port(s), comma-separatedDefault [1935,80]:

这个时候是提示我们设置FMS服务的端口和web服务所需要的端口,这里直接回车,默认即可。

Please enter the port to use for the Admin service. You can only specify oneadmin port.Default [1111]:

这是设置管理FMS的服务端口。通过这个端口,我们可以通过FMS提供的flash应用界面登录并管理FMS系统。 直接回车即可,默认为1111

Do you want the Adobe Media Server service to run as adaemon? (y/n)Default [y]:

问我们是否要以守护进程的形式运行,当然是OK了,直接回车即可,默认为y

Do you want to start the Adobe Media Serverafter the installation is done? (y/n)Default [y]:

然后就会询问我们安装完成之后是否要运行,我们接受便可,直接回车。

到此,FMS5.0的安装配置已经完成了,接下来就会出现:

----------- Install Action Summary -----------Installation directory         = /usr/local/amsAdobe Media Server Port        = 1935,80Adobe Media Admin Server Port  = 1111Interface (IP address) AMS will listen on  = auto-detectAdministrative username        = adminAdministrative password        = (suppressed)service owner                  = amsservice user                   = amsservice group                  = amsRun as daemon                  = YesStart Adobe Media Server       = YesProceed with the installation? (y/n/q):

安装摘要,检查一下安装配置是否正确。如果有误的话,请输入n重新来一遍。如果不想继续安装下去,输入q退出安装。输入y立即安装。我们输入y,然后耐心等待他安装完成。。。

Installing Adobe Media Server files...Configuring Adobe Media Server...Adding "ams" service.Setting default admin to "ams".Setting autostart for "ams".Server:ams command:startWARNING: Your Linux distribution, RedHat x86_64  is not supported by this          installer.14991WARNING: AMS requires the maximum number of processes > 32K.         Adjust ulimit to match system requirements.NPTL 2.17Starting Adobe Media Server (please check /var/log/messages)Admin server:amsadmin command:startWARNING: Your Linux distribution, RedHat x86_64  is not supported by this          installer.Starting Adobe Media Admin Server (please check /var/log/messages)The Adobe Media Server installation is complete.

The Adobe Media Server installation is complete. 

安装完成!!!j_0013.gif


不要忘记开启防火墙端口:

firewall-cmd --permanent --zone=public --add-port=1935/tcpfirewall-cmd --permanent --zone=public --add-port=1935/udpfirewall-cmd --permanent --zone=public --add-port=1111/tcpfirewall-cmd --permanent --zone=public --add-port=1111/udpfirewall-cmd --reload

  • 测试推流

使用免费开源推流工具OBS进行推流测试:



设置推流地址为FMS服务器地址,右下角绿色灯亮起表示推流成功!!

接下来我们进行拉流测试

  • 测试拉流

使用FMS官方的拉流测试工具进行测试,点击直达



ok,测试成功。


附上一张图,该图右侧为电脑时间,左侧为直播画面的时间。通过obs推流工具实时获取电脑画面实现该测试,由此可见,直播延迟在1-2s之间。注:该测试在局域网中,非外网。


原创粉丝点击