CentOS7下安裝配置流媒體播放器FMS5.0

背景:因工做須要,要研究一些流媒體服務器相關的技術,主要是爲了搭建直播所用的服務器,本文是基於CentOS7搭建FMS流媒體服務器,利用OBS推流工具可實現簡單的直播、觀看功能。先說明一下AMS全稱是adobe media server,在5.0版本以前名稱是FMS(flash media server)。html

  • 下載nginx

咱們能夠直接從adobe官網下載最新版本的Adobe Media Server,由於咱們是在Linux系統搭建的環境,這裏選擇Download the Linux Update (64-bit)。點擊跳轉下載頁面git

wKiom1luwRexZduUAAEtJbIg-5s100.png-wh_50

下載完成以後,上傳至/use/local路徑下,而後就能夠開始解壓安裝了。web

[root@bogon ~]# cd /usr/local/
[root@bogon local]# ls
AdobeMediaServer5_x64.tar.gz  bin  etc  games  include  lib  lib64  libexec  sbin  share  src
  • 安裝apache

咱們把剛纔上傳的AdobeMediaServer5_x64.tar.gz先解壓bash

tar -zxvf AdobeMediaServer5_x64.tar.gz

解壓成功後進入目錄服務器

cd AMS_5_0_14_r4006/

執行安裝命令:
app

./installAMS

安裝的步驟比較多,若是不是特殊需求,能夠默認安裝(出現提示敲回車就行~)j_0010.giftcp


注意了(敲黑板!~),重點開始了,下面開始詳細的安裝流程ide


因爲我是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 Linux
Adobe Media Server 5 will be installed on this machine.
You will be asked a series of questions during the install
process and will be presented with the defaults for these questions.
Support is available at http://www.adobe.com/go/ams
To 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 Agreement
NOTICE 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 NEGOTIAT
ED 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 TH
E 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.    Definitions
1.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 Conte
nt 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 manip
ulates 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 a
specific 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  secure
distribution 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 of
the 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鍵入序列號繼續1652-5826-9939-6068-8981-7289

Congratulations.  You have enabled the
Adobe Media Server Extended!
Adobe Media Server 5 requires approximately 200MB of
disk space.
The installer will install Adobe Media Server 5 in the
following directory
Default [/opt/adobe/ams]:

出現此提示說明序列號可用,他提示咱們安裝大約須要200M的磁盤空間,將默認安裝在/opt/adobe/ams路徑下。若是想要安裝在其餘路徑下,在這裏輸入路徑,默認路徑能夠直接回車。

我把他安裝在/usr/local路徑下了,這裏輸入/usr/local/ams,繼續

The administrative user name and password you provide here is required to use
the Adobe Media Server Management Console for
administration, 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 service
can be run as a user other than "root". The server would change to this user
when the server is started and has acquired its ports.
Please enter the user that the Adobe Media Server service will run as
Default 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-assigned
port of 1935, which is the port most Flash applications expect,
and can also communicate on port 80
over RTMPT, HTTP webserver proxy, and for HTTP Dynamic Streaming origin services.
Please enter the Adobe Media Server port(s), comma-separated
Default [1935,80]:

這個時候是提示咱們設置FMS服務的端口和web服務所須要的端口,這裏直接回車,默認便可。

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

這是設置管理FMS的服務端口。經過這個端口,咱們能夠經過FMS提供的flash應用界面登陸並管理FMS系統。 直接回車便可,默認爲1111

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

問咱們是否要以守護進程的形式運行,固然是OK了,直接回車便可,默認爲y

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

而後就會詢問咱們安裝完成以後是否要運行,咱們接受即可,直接回車。

到此,FMS5.0的安裝配置已經完成了,接下來就會出現:

----------- Install Action Summary -----------
Installation directory         = /usr/local/ams
Adobe Media Server Port        = 1935,80
Adobe Media Admin Server Port  = 1111
Interface (IP address) AMS will listen on  = auto-detect
Administrative username        = admin
Administrative password        = (suppressed)
service owner                  = ams
service user                   = ams
service group                  = ams
Run as daemon                  = Yes
Start Adobe Media Server       = Yes
Proceed 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:start
WARNING: Your Linux distribution, RedHat x86_64  is not supported by this
          installer.
14991
WARNING: AMS requires the maximum number of processes > 32K.
         Adjust ulimit to match system requirements.
NPTL 2.17
Starting Adobe Media Server (please check /var/log/messages)
Admin server:amsadmin command:start
WARNING: 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/tcp
firewall-cmd --permanent --zone=public --add-port=1935/udp
firewall-cmd --permanent --zone=public --add-port=1111/tcp
firewall-cmd --permanent --zone=public --add-port=1111/udp
firewall-cmd --reload
  • 測試推流

使用免費開源推流工具OBS進行推流測試:

wKioL1lvAhPgEwYEAABfwAhnd9Q705.png-wh_50

wKiom1lvAhmhybQzAAweaP9UPQ8464.png-wh_50

設置推流地址爲FMS服務器地址,右下角綠色燈亮起表示推流成功!!

接下來咱們進行拉流測試

  • 測試拉流

使用FMS官方的拉流測試工具進行測試,點擊直達

wKioL1lvA5SjKnpwAAcE058F46Q311.png-wh_50


ok,測試成功。

wKioL1lvBfejhYfYAAP6PdOe0qw068.png-wh_50

附上一張圖,該圖右側爲電腦時間,左側爲直播畫面的時間。經過obs推流工具實時獲取電腦畫面實現該測試,因而可知,直播延遲在1-2s之間。注:該測試在局域網中,非外網。

相關文章
相關標籤/搜索