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

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

  • 下載

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

wKiom1luwRexZduUAAEtJbIg-5s100.png-wh_50

下載完成之後,上傳至/use/local路徑下,然後就可以開始解壓安裝了。

[root@bogon ~]# cd /usr/local/
[root@bogon local]# ls
AdobeMediaServer5_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 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之間。注:該測試在局域網中,非外網。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章