搭建流媒體服務器(1)


一、前語

本文纂寫時間是2018年12月17日,所描述的軟件Wowza Media Server此時已經出了4或更高,但是2.2.2提供的功能已經是Good enough for me.如果發現4足夠更好,后面文章也許會再續。

本文試圖描述一個在Windows Server 2012上安裝了Wowza Media Server v2.2.2流媒體服務的事件。最終會另服務器提供給外部適當的Server和Stream信息,以給外部提供流媒體服務。

本文所涉及的主要軟件Wowza Media Server v2.2.2由鄭州的LMM老師提供,Java SDK從Java(Oracle)官方網站下載。

二、環境介紹

操作系統:64位 Windows Server 2012 數據中心版

先置軟件:32位 Java(TM) SE Develepment Kit 6 

流媒體服務軟件:Wowza Media Server v2.2.2

開放端口:1935(默認,可修改)

三、安裝步驟

(印象步驟)

1、安裝Java SDK

(1)將Java SDK安裝於C:\JAVA目錄下。

(2)增加環境變量JAVA_HOME = C:\Java\jdk1.6.0_45

(3)在PATH中增加項(每項以;分割), C:\Java\jdk1.6.0_45\bin  亦或 %JAVA_HOME%\bin

2、安裝Wowza Media Server v 2.2.2

(1)*強烈建議有經濟能力的同志通過官方渠道購買*運行.\keygen\keygen.bat 在彈出的 "CRUDE - Wowza Me ..."標題窗口中復制安裝Serial序列號。

(2)運行.\setup\WowzaMediaServer-2.2.2.exe ,選擇安裝目錄為某盤符的根目錄(至少不要默認的中間帶空格的目錄),下一步至安裝完成。

(3)運行 

C:\Wowza Media Systems\Wowza Media Server 2.2.2\examples\installall.bat

運行后 C:\Wowza Media Systems\Wowza Media Server 2.2.2\applications 目錄下會出現若干子目錄,其中包含目錄vod。

(4)編輯C:\Wowza Media Systems\Wowza Media Server 2.2.2\conf\vod\Application.xml,將

<RTP>
    <!-- RTP/Authentication/[type]Methods defined in Authentication.xml. Default setup includes; none, basic, digest -->
    <Authentication>
        <PublishMethod>digest</PublishMethod>
        <PlayMethod>digest</PlayMethod>
    </Authentication>
    <!-- RTP/AVSyncMethod. Valid values are: senderreport, systemclock, rtptimecode -->
    <AVSyncMethod>senderreport</AVSyncMethod>
    <MaxRTCPWaitTime>12000</MaxRTCPWaitTime>
    <IdleFrequency>75</IdleFrequency>
    <RTSPSessionTimeout>90000</RTSPSessionTimeout>
    <RTSPMaximumPendingWriteBytes>0</RTSPMaximumPendingWriteBytes>
    <RTSPBindIpAddress></RTSPBindIpAddress>
    <RTSPConnectionIpAddress>0.0.0.0</RTSPConnectionIpAddress>
    <RTSPOriginIpAddress>127.0.0.1</RTSPOriginIpAddress>
    <IncomingDatagramPortRanges>*</IncomingDatagramPortRanges>
    <!-- Properties defined here will override any properties defined in conf/RTP.xml for any depacketizers loaded by this application -->
    <Properties>
    </Properties>
</RTP>

 

修改為

<RTP>
    <!-- RTP/Authentication/[type]Methods defined in Authentication.xml. Default setup includes; none, basic, digest -->
    <Authentication>
        <PublishMethod>none</PublishMethod>
        <PlayMethod>none</PlayMethod>
    </Authentication>
    <!-- RTP/AVSyncMethod. Valid values are: senderreport, systemclock, rtptimecode -->
    <AVSyncMethod>senderreport</AVSyncMethod>
    <MaxRTCPWaitTime>12000</MaxRTCPWaitTime>
    <IdleFrequency>75</IdleFrequency>
    <RTSPSessionTimeout>90000</RTSPSessionTimeout>
    <RTSPMaximumPendingWriteBytes>0</RTSPMaximumPendingWriteBytes>
    <RTSPBindIpAddress></RTSPBindIpAddress>
    <RTSPConnectionIpAddress>0.0.0.0</RTSPConnectionIpAddress>
    <RTSPOriginIpAddress>127.0.0.1</RTSPOriginIpAddress>
    <IncomingDatagramPortRanges>*</IncomingDatagramPortRanges>
    <!-- Properties defined here will override any properties defined in conf/RTP.xml for any depacketizers loaded by this application -->
    <Properties>
    </Properties>
</RTP>

(5)打開Windows Server 2012的服務管理器儀表盤->工具->服務,從列表中找到,服務 Wowza Media Server,右鍵啟動。

(6)目錄C:\Wowza Media Systems\Wowza Media Server 2.2.2\content為視頻的存儲目錄。其中默認已經存放了”Extremists.m4v“和"sample.mp4"兩部小短片。足夠測試,但亦可向其中添加新的視頻,支持中文名稱的文件夾及中文名稱的視頻。

3、測試流媒體服務

(1)准備測試工具

將Windows Server 2012服務器上的文件夾

C:\Wowza Media Systems\Wowza Media Server 2.2.2\examples\LiveVideoStreaming\client

拷貝到本地。

(2)測試

用瀏覽器打開拷貝到本地的./client/live.html 文件。如果沒有Flash播放插件可能需要安裝。

在"Server:"框中輸入 rtmp://192.168.163.136:1935/vod

在"Stream:"框中輸入 mp4:sample.mp4

點擊 "Play" 按鈕。如果開始播放說明流媒體服務正常,若沒有反應或報錯說明錯誤。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2026 CODEPRJ.COM