總結(jié)有福利
C++實(shí)現(xiàn)RTSP/RTP流媒體服務(wù)器,同時(shí)支持linux和windows編譯環(huán)境。使用VLC客戶端測(cè)試通過(guò)。實(shí)現(xiàn)RTSP的OPTIONS、DESCRIBE、SETUP、PLAY、PAUSE、TEARDOWN,實(shí)現(xiàn)SDP生成,實(shí)現(xiàn)RTP打包,實(shí)現(xiàn)TS文件解析。有相應(yīng)的源碼分析文檔。
新增功能
一別名
別名主要是替換URL中真實(shí)的文件名和路徑。使用別名,Helix Universal Server管理員可以偽裝真實(shí)的資源在發(fā)布的URL中,這樣做可以使URL更友好,更短。
二內(nèi)容緩存
內(nèi)容緩存可以使兩臺(tái)以上的Helix Universal Server傳輸多媒體文件,這樣做有兩個(gè)好處:
第一:緩存改進(jìn)了客戶播放內(nèi)容的品質(zhì)
第二:內(nèi)容緩存節(jié)約了傳送成本,直接將內(nèi)容緩存至離客戶最近的網(wǎng)絡(luò)。
三定制日志
定制日志是系統(tǒng)生成報(bào)告的一個(gè)靈活功能。這里使用了模板功能,它定義了哪些信息被捕捉,什么時(shí)候去捕捉。你可以使用默認(rèn)的模板也可以創(chuàng)建你自己的模板。
四模仿直播傳輸代理 SLTA (Simulated Live Transfer Agent )
SLTA可以像直播那樣傳輸一個(gè)流媒體片度,它使RealNetworks下一代的工具。SLTA像上一代技術(shù)G2SLTA一樣支持很多的流媒體格式,它提供了一種發(fā)布流媒體的更強(qiáng)勁的方式,像一臺(tái)直播機(jī)一樣,將一個(gè)流媒體發(fā)布到接受者那里。
五RTSP 緩存指示
在默認(rèn)的情況下,一個(gè)代理可能緩存所有的點(diǎn)播內(nèi)容和直播內(nèi)容在一臺(tái)Helix Universal Server上。但是可能你不想緩存其中的一些內(nèi)容。RTSP緩存指示可以告訴那些緩存的 Helix Universal Server 應(yīng)該緩存什么內(nèi)容,不應(yīng)該緩存什么內(nèi)容。RTSP所賦予你更大的靈活性。
六冗余服務(wù)
本功能可以使你為內(nèi)容發(fā)布添加等級(jí)。默認(rèn)的情況下,RealOne Player在中斷后,將向Helix Universal Server重新申請(qǐng)連接。不論如何,你可以指定另外一個(gè)服務(wù)器來(lái)讓RealOne Player連接。
七Windows Media 流媒體支持
Helix Universal Server可以使用MMS協(xié)議或者HTTP協(xié)議向Windows Media Player傳輸Windows Media格式的流媒體。它也可以通過(guò)HTTP方式與Windows Media Encoder連接,允許傳輸Windows Media 的廣播到其他的Helix Unviersal Servers.因此,你可以使用一個(gè)統(tǒng)一的流媒體網(wǎng)絡(luò)來(lái)發(fā)布多種格式的流媒體,例如:RealMedia,Windows Media 以及QuickTime。
八MPEG 流媒體支持
Helix Universal Server可以發(fā)布MPEG-1,MPEG-2,MP3,以及MPEG-4格式的內(nèi)容。詳細(xì)內(nèi)容參見“MPEG音頻與視頻”
九智能流
Helix Universal Serve可以幫助在保證帶寬的情況下進(jìn)行Real音頻或者Real視頻的廣播。使用智能流你可以先從服務(wù)器端發(fā)送測(cè)試包到接受者那里,不管客戶端使用什么樣的流媒體碼率,在智能流的控制下,只有一個(gè)適合客戶端的碼率可以被接受。
十RealOne Player 的統(tǒng)計(jì)
新的客戶統(tǒng)計(jì)狀態(tài)類型4,可以更好的返回RealOne Player的信息,包含每一個(gè)流信息包,帶寬等信息,以便可以更好的根據(jù)返回結(jié)果使用TurboPlay功能.
架設(shè)網(wǎng)絡(luò)直播電視

支持多種流媒體文件:
音頻文件:RealAudio.Wav.Au.MPEG-1.MPEG-2.MP3
視頻文件:RealVideo.AVI.QuickTime.
其他類型:RealPix.RealText.GIF.JPEG.SMIL.Real G2 with Flash
等等.
但Helix SERver不支持所有的流媒體文件,所以還要一些軟件支持,因此Helix Universal Platform提供了一功能強(qiáng)大的工具---Helix Producer.它可以將Helix Server 不支持的流媒體文件轉(zhuǎn)換成它支持的流媒體文件.
Helix Server提供了多種類型服務(wù):
1).點(diǎn)播(On-Demand)
任何時(shí)候,用戶都可以通過(guò)單擊Helix Server管理員公布的web連接,向Helix Server提出播放流媒體文件的要求,服務(wù)器再按照用戶的要求,以"流"的方式不斷地把數(shù)據(jù)傳給用戶.用戶就可以像播放本地流媒體文件一樣,隨意控制文件播放.
2).直播(Live)
網(wǎng)絡(luò)直播和現(xiàn)實(shí)生活中的電視直播方式是類似的.直播的過(guò)程大致如下:
1.在現(xiàn)場(chǎng)使用攝像機(jī),話筒等媒體采集工具采集實(shí)況信號(hào).
2.用數(shù)/模轉(zhuǎn)換設(shè)備如視頻采集卡將采集的模擬信號(hào)轉(zhuǎn)換成數(shù)字信號(hào).
3.數(shù)字信號(hào)經(jīng)壓縮編碼軟件如Helix Producer轉(zhuǎn)換成流媒體數(shù)據(jù)流,并送往Helix Server/
4.用戶單擊web連接時(shí),Helix Server將接收到的數(shù)據(jù)流發(fā)送給用戶.和點(diǎn)播不同的是,用戶收看的是實(shí)時(shí)信號(hào),用戶不能控制快進(jìn),暫停.
3).模擬直播(Simulated Live)
模擬直播的過(guò)程如下:
1.流媒體文件儲(chǔ)存在服務(wù)器或其他PC機(jī)上.
2.利用Helix Server提供的輔助工具"SLTA",將流媒體文件以數(shù)據(jù)流的形式發(fā)送給Helix Server.
3.用戶單擊wen連接時(shí),Helix Server將接收到的數(shù)據(jù)流發(fā)送給用戶.用戶看到的是事先制作好的流媒體文件,就像是日常生活中通過(guò)電視收看故事片一樣.
二、Linux環(huán)境下安裝配置
HelixServer安裝[root@localhost data]# ls
DistributedLicensing.lic HelixServer ISP-Hosting.lic setup.tar.gz
[root@localhost data]# tar -zxvf setup.tar.gz #解壓HelixServer Unlimited 11
helix-server-retail-11.01-rhel4-setup.bin
[root@localhost data]# ls
DistributedLicensing.lic helix-server-retail-11.01-rhel4-setup.bin setup.tar.gz
HelixServer ISP-Hosting.lic
[root@localhost data]# chmod 700 helix-server-retail-11.01-rhel4-setup.bin # 添加執(zhí)行權(quán)限
[root@localhost data]# ./helix-server-retail-11.01-rhel4-setup.bin #安裝HelixServer Unlimited 11
Extracting files for Helix installation........................
Welcome to the Helix Server 11.0 (11.0.1.1884) Setup for UNIX
Setup will help you get Helix Server running on your computer.
Press [Enter] to continue...
If a Helix Server license key file has been sent to you,
please enter its directory path below. If you have not
received a Helix Server license key file, then this server
WILL NOT OPERATE until a license key file is placed in
the servers License directory. Please obtain a free
Basic Helix Server license or purchase a commercial license
from our website at http://www.real.com/. If you need
further assistance, please visit our on-line support area
at http://service.real.com/.
License Key File: []: #添加許可證文件 此步先確認(rèn),等HelixServer安裝完畢之后再添加文件。
Installation and use of Helix Server requires
acceptance of the following terms and conditions:
Press [Enter] to display the license text... #列出許可協(xié)議
REALNETWORKS, INC.
END USER LICENSE AGREEMENT
HELIX(tm) BASIC SERVER FROM
REALNETWORKS(r)
redisTRIBUTION NOT PERMITTED
Software License for Helix(tm) Basic
Server from RealNetworks(r)
IMPORTANT -- READ CAREFULLY: This
RealNetworks License Agreement ("License
Agreement") is a legal agreement between
you (either an individual or an entity)
and RealNetworks, Inc. and its suppliers
and licensors (collectively "RN") for
RNs Helix Basic Server, which includes
computer software and associated media
and printed materials, whether provided
in physical form or received on-line in
electronic form ("Software"). You may
install only ONE copy of the Software.
By choosing "Accept," installing,
copying or otherwise using the Software,
you agree to be bound by the terms of
this License Agreement. If you do not
agree to the terms of this License
--More--(4%)
Choose "Accept" to accept the terms of this
license agreement and continue with Helix Server setup.
If you do not accept these terms, enter "No"
and installation of Helix Server will be cancelled.
I accept the above license: [Accept]: #回車,接受許可協(xié)議
Enter the complete path to the directory where you want
Helix Server to be installed. You must specify the full
pathname of the directory and have write privileges to
the chosen directory.
Directory: [/data]: /data/HelixServer #輸入安裝目錄
Please enter a username and password that you will use
to access the web-based Helix Server Administrator and monitor.
Username []: admin #輸入web登錄管理員名稱
Password []: # 輸入web登錄管理員密碼
Confirm Password []: #再次輸入登錄管理員密碼
Please enter a port on which Helix Server will listen for
RTSP connections. These connections have URLs that begin
with "rtsp://"
Port [554]: #設(shè)置RTSP連接端口,保持默認(rèn)。
Please enter a port on which Helix Server will listen for
HTTP connections. These connections have URLs that begin
with "http://"
Port [80]: 8088 #設(shè)置HTTP連接端口,為避免和Apache沖突,建議更改。
Please enter a port on which Helix Server will listen for
MMS connections. These connections have URLs that begin
with "mms://"
Port [1755]: #設(shè)置MMS連接端口,保持默認(rèn)。
Helix Server will listen for Administrator requests on the
port shown. This port has been initialized to a random value
for security. Please verify now that this pre-assigned port
will not interfere with ports already in use on your system;
you can change it if necessary.
Port [27465]: 10000 #設(shè)置HelixServer遠(yuǎn)程管理端口,建議更改以便記憶。
You have selected the following Helix Server configuration:
Admin User/Password: admin/****
Encoder User/Password: admin/****
Monitor Password: ****
RTSP Port: 554
HTTP Port: 8088
MMS Port: 1755
Admin Port: 10000
Destination: /data/HelixServer
Enter [F]inish to begin copying files, or [P]revious to go
back to the previous prompts: [F]: #如果前面配置沒有問(wèn)題,按"Enter"鍵復(fù)制文件,若想修改前面配置參數(shù),按"P"鍵返回修改。
Copying Helix Server files....
Helix Server installation is complete.
If at any time you should require technical
assistance, please visit our on-line support area
at http://service.real.com/.
Cleaning up installation files...
Done.
[root@localhost data]#
[root@localhost data]# cp *.lic /data/HelixServer/License/ #復(fù)制許可證文件
HelixServer 漢化包
[root@localhost HelixAdministrator_CHS]# cp -rf * /data/HelixServer/HelixAdministrator/ #復(fù)制漢化包文件到HelixAdministrator目錄中
[root@localhost data]# cd HelixServer/
[root@localhost HelixServer]# ls
adm_b_db cdi_b_db default.cfg enc_w_db Lib master.cfg Secure
Bin Commerce enc_b_db HelixAdministrator License Plugins slta.cfg
Cache Content enc_r_db helixserver.my Logs rmserver.cfg
HelixServer 服務(wù)啟用和停用
[root@localhost HelixServer]# ./Bin/rmserver rmserver.cfg & #后臺(tái)啟動(dòng)HelixServer
[1] 6868
[root@localhost HelixServer]# Helix Server (c) 1995-2005 RealNetworks, Inc. All rights reserved.
Version: Helix Server 11.0 (11.0.1.1884) (Build 74277/5688)
Platform: linux-rhel4-i686
Using Config File: rmserver.cfg
Linux kernel version 2.6.9-78.EL detected [glibc 2.3.4/NPTL 2.3.4]
Starting PID 6869 TID 3086890688/6869, procnum 0 (controller)
Creating Server Space...
Server has allocated 256 megabytes of memory
Starting TID 3084909440/6871, procnum 1 (timer)
Calibrating timers...
Interval timer enabled (10ms resolution).
Starting TID 3082812288/6872, procnum 2 (core)
Starting Helix Server 11.0 Core...
1 CPU Detected...
Testing File Descriptors...
Setting per-process descriptor capacity to 672(1003), 21...
Testing Mutex...(421.50 ops/usec)
Testing AtomicOps...(61.73 ops/usec)
I: Loading Plugins from /data/HelixServer/Plugins...
I: slicensepln.so 0xb50ec0 RealNetworks Licensing Plugin
I: svrbascauth.so 0x3b9cc0 RealNetworks Basic Authenticator
I: rn5auth.so 0x11dc40 RealNetworks RN5 Authenticator
I: rn5auth.so 0x11dc40 RealNetworks Digest Authenticator
I: rncache.so 0x43c880 RealNetworks Cache Plugin
I: redbcplin.so 0x6f10a0 RealNetworks Broadcast Redundancy Plugin
I: encoplin.so 0x13f8f0 RealNetworks Encoder Broadcast Plugin
I: swfformat.so 0x1ffc30 RealNetworks macromedia Flash 4 File Format Plugin
I: snmpplin.so 0x23fe00 RealNetworks Snmp Plugin (Version 11.0.0.0)
I: miiplin.so 0x2e00e0 RealNetworks Media Import Plugin
I: xmlcfg.so 0x9fa780 RealNetworks XML Configuration Plugin
I: audplin.so 0xce14c0 RealNetworks G.7xx Renderer Plugin
I: audplin.so 0xce14c0 Helix PCM Audio Renderer Plugin
I: audplin.so 0xce14c0 RealNetworks AU File Format Plugin
I: audplin.so 0xce14c0 Helix WAVE File Format Plugin
I: audplin.so 0xce14c0 Helix AIFF File Format Plugin
I: audplin.so 0xce14c0 RealNetworks DVI4 Renderer Plugin
I: meiffpln.so 0x35f3b0 RealNetworks Media Export File Format Plugin
I: smonplin.so 0x91d820 RealNetworks System Monitor
I: ramplin.so 0x36df70 RealNetworks Ramgen File System
I: ppvmsql.so 0x4fea10 RealNetworks Mini SQL PPV Database Plugin
I: wmmcastpln.so 0x3933b0 RealNetworks Windows Media Multicast Plugin
I: allow.so 0x3a6d00 RealNetworks Basic Allowance Plugin
I: mp3fformat.so 0x3c8ea0 RealNetworks MP3 File Format Plugin
I: adminfs.so 0x872920 RealNetworks Admin File System
I: avifformat.so 0xad7050 RealNetworks AVI File Format Plugin
I: imgfformat.so 0x45f150 Helix JPEG File Format Plugin
I: imgfformat.so 0x45f150 Helix GIF File Format Plugin
I: imgfformat.so 0x45f150 Helix PNG File Format Plugin
I: imgfformat.so 0x45f150 Helix RealPix Format Plugin
I: imgfformat.so 0x45f150 Helix RealPix JPEG File Format Codec Plugin
I: imgfformat.so 0x45f150 Helix RealPix GIF File Format Codec Plugin
I: imgfformat.so 0x45f150 Helix RealPix PNG File Format Codec Plugin
I: imgfformat.so 0x45f150 Helix WBMP File Format Plugin
I: wmsrcpln.so 0x3e4000 RealNetworks Windows Media Live Broadcast Source Plugin
I: smlfformat.so 0xaf3330 RealNetworks SMIL File Format Plugin
I: asxplin.so 0x375f60 RealNetworks Asxgen File System
I: cdistpln.so 0x6cbec0 RealNetworks Content Distribution Plugin
I: isphoster.so 0xd430c0 RealNetworks ISP hosting plugin
I: shelfsys.so 0xc28e60 RealNetworks Shell File System
I: mp4fformat.so 0x535d30 RealNetworks Mpeg4 File Format Plugin
I: encfs.so 0x405e10 RealNetworks Encoder Administration File System Plugin
I: ppvbasic.so 0x95cfd0 RealNetworks FlatFile Database Plugin
I: asfwmpln.so 0xc4ecd0 RealNetworks Active Stream Format Version 1 Plugin
I: dbmgr.so 0x40d670 RealNetworks Database Manager
I: ppvallow.so 0x422980 RealNetworks Pay Per View Allowance Plugin
I: pplyplin.so 0xb78160 RealNetworks Scalable Multicast Plugin
I: authmgr.so 0x9c2bf0 Helix Authentication Manager
I: meiplin.so 0x58a400 RealNetworks Media Export Interface Plugin
I: asncfsys.so 0x5a8490 RealNetworks Network Optimized File System
I: qtbcplin.so 0x5bdde0 RealNetworks QuickTime Live Broadcast Plugin
I: smplfsys.so 0x69fcb0 RealNetworks Local File System
I: plusplin.so 0xd95070 RealNetworks PlusURL File Format Plugin
I: hxsdp.so 0xde0180 RealNetworks SDP Stream Description Plugin
I: sdpgenfsys.so 0xe5cac0 RealNetworks Dynamic SDP Generation Plugin
I: bdstplin.so 0x70cc50 RealNetworks Broadcast Distribution Plugin
I: tmplgpln.so 0xd4d3b0 RealNetworks Custom Logging Plugin
I: rmfformat.so 0x7449c0 RealNetworks RealMedia File Format Plugin
I: brcvplin.so 0x7d8910 RealNetworks Broadcast Reception Plugin
I: cdadplin.so 0xdc6000 RealNetworks Content Distribution Advise Plugin
I: tagfsys.so 0xe71730 RealNetworks XMLTagFileSystem
I: rtfformat.so 0x83ffe0 Helix RealText File Format Plugin
I: archplin.so 0xa25500 RealNetworks Live Archiver Plugin
I: httpfsys.so 0x8bed90 RealNetworks HTTP File System with CHTTP Support
I: httpfsys.so 0x8bed90 RealNetworks RFC 2397 Data Scheme File System
I: vsrcplin.so 0x96ed10 RealNetworks View Source Tag Replacement Plugin
I: vsrcplin.so 0x96ed10 RealNetworks View Source Allowance Plugin
I: vsrcplin.so 0x96ed10 RealNetworks View Source File System
Starting TID 3080715136/6873, procnum 3 (rmplug)
Loading Helix Server License Files...
Starting TID 3078617984/6874, procnum 4 (rmplug)
Starting TID 3076520832/6875, procnum 5 (rmplug)
Starting TID 3074423680/6876, procnum 6 (rmplug)
Starting TID 3072326528/6877, procnum 7 (rmplug)
Starting TID 3070229376/6878, procnum 8 (rmplug)
Starting TID 3068132224/6879, procnum 9 (rmplug)
Starting TID 3066035072/6880, procnum 10 (rmplug)
Starting TID 3063937920/6881, procnum 11 (rmplug)
Starting TID 3061840768/6882, procnum 12 (rmplug)
Starting TID 3059743616/6883, procnum 13 (rmplug)
Starting TID 3057646464/6884, procnum 14 (rmplug)
Starting TID 3055549312/6885, procnum 15 (rmplug)
Starting TID 3053452160/6886, procnum 16 (rmplug)
Starting TID 3051355008/6887, procnum 17 (rmplug)
Starting TID 3049257856/6888, procnum 18 (rmplug)
Starting TID 3047160704/6889, procnum 19 (rmplug)
Starting TID 3045063552/6890, procnum 20 (memreap)
Starting TID 3042966400/6891, procnum 21 (streamer)
[root@localhost HelixServer]# ps -ef|grep rmserver #查看當(dāng)前rmserver進(jìn)程
root 6868 6309 0 10:37 pts/1 00:00:00 ./Bin/rmserver rmserver.cfg
root 6869 6868 6 10:37 ? 00:00:00 ./Bin/rmserver rmserver.cfg
root 6870 6868 0 10:37 ? 00:00:00 ./Bin/rmserver rmserver.cfg
root 6893 6309 0 10:37 pts/1 00:00:00 grep rmserver
[root@localhost HelixServer]# cat ./Logs/rmserver.pid #查看 HelixServer進(jìn)程號(hào)
6984
[root@localhost HelixServer]# kill 6984 #停止HelixServer服務(wù)
訪問(wèn)HelixServer管理界面在Web瀏覽器中輸入http://HelixServer 域名或IP:端口號(hào)/admin/index.html,如http://192.168.1.90:10000/admin/index.html將彈出"用戶驗(yàn)證"對(duì)話框,在該對(duì)話框中輸入HelixServer管理員名稱和密 碼。

用戶驗(yàn)證通過(guò)后即可進(jìn)入到HelixServer服務(wù)器管理界面


IP地址綁定:當(dāng)HelixServer被安裝在一個(gè)擁有多個(gè)IP地址的系統(tǒng)上,需要指定服務(wù)器監(jiān) 聽的IP。

加載點(diǎn)配置:加載點(diǎn)出現(xiàn)在Helix Server的每一個(gè)連接中.它是一個(gè)到文件實(shí)際存放位置的訪問(wèn)指向.下面的頁(yè)面中將顯示所有加載點(diǎn)以及它們所對(duì)應(yīng)的實(shí)際存放路徑.

服務(wù)器連接控制:當(dāng)服務(wù)器的帶寬有限時(shí),可以根據(jù)需要限制服務(wù)器的同時(shí)連接數(shù)量,以保留一定帶寬,確保用戶的連接速度。如果連接數(shù)量過(guò)大,后面 用戶發(fā)起的連接將會(huì)失敗,并會(huì)收到服務(wù)器返回錯(cuò)誤信信息。
最大連接數(shù)"0"表示不限制連接

訪問(wèn)控制:通過(guò)在服務(wù)器中建立訪問(wèn)控制規(guī)則,能有效的控制客戶端在訪問(wèn)服務(wù)器時(shí),允許或拒絕來(lái)自某一IP或某臺(tái)機(jī)器對(duì)某個(gè)端口的訪問(wèn)請(qǐng)求。

服務(wù)器監(jiān)控:通過(guò)服務(wù)器監(jiān)可以動(dòng)態(tài)的顯示服務(wù)器的當(dāng)前性能,及連接數(shù)量。

總結(jié);
通過(guò)這個(gè)RTMP流的優(yōu)勢(shì)是,可以避免視頻文件被瀏覽器通過(guò)http方式進(jìn)行下載
所有流服務(wù)器存儲(chǔ)媒體文件的方式都是將文件放在指定目錄下面,且磁盤系統(tǒng)絕大部分I/O都是讀操作,寫操作只會(huì)發(fā)生在上傳和更新媒體文件過(guò)程中。對(duì)于這種I/O操作特性,建議選擇RAID 5用于中小規(guī)模的視頻點(diǎn)播服務(wù)。這樣可以提供比獨(dú)立磁盤更高的數(shù)據(jù)安全性和讀取速度,同時(shí)將成本控制在較小的范圍內(nèi)。實(shí)際可用容量為(N-1)個(gè)磁盤。
文檔 +問(wèn)題 +交流 +學(xué)習(xí)+資料視頻+源碼分享 可以后臺(tái)私信‘資料’
內(nèi)容包括:C/C++,Linux,Nginx,golang,ZeroMQ,MySQL,Redis,fastdfs,MongoDB,ZK,ffmpeg,流媒體, 音視頻,CDN,P2P,K8S,Docker,Golang,TCP/IP,協(xié)程,嵌入式,ARM,DPDK等等。。。