orz-l

[login]

Date

Tag

Read

Comment

What Is a Media Server?---FMS Server是什么

2011-07-13 15:35:43 [FMS]
FMS3 is an open socket server.
The key difference between open socket servers and Web servers is that as soon as you receive information from a Web server, the connection is broken.
It may look as if you're still connected to the Web server, especially with a Flash page that's animating materials. However, that's not the way it works.
If you open a Web page, the Web server sends you the page along with all associated graphics, text, and other media; and your computer sends a message back that says, "Got it!" (or something to that effect), and the connection closes.
With an open socket server, the connection stays open until you quit the application or trigger an event that cuts the connection.
Because the connection remains open, you can stream audio, video, text, and any other media available on the Internet, in real time.
You just can't do that with a regular Web server because it has an entirely different architecture.

FMS3是一个开放端口server。
开放端口server 和 web server的主要区别是,
web server 一旦收到了来自服务器的数据,连接就关闭了。
web server 能使其看起来好像你仍连着web网络,特别是有模拟动画的页面。
然而,它并不是这么工作的。
如果你打开个web 页面,
web server 把相关的图像,文本,或者其他东西一块发给你,然后你的电脑返回一条信息“收到!”(或者类似的),然后 连接就关闭了。
但是开放端口的server,连接是一直开启的,除非你退出程序,或者触发了切断连接的事件。
由于连接是一直开启着的,你可以实时流传输音频,视频,文本,或者各种可以在Internet上传输的媒体。
你不能用一般的 web server 来做这些, 他们俩是完全不同的架构。

Enter RTMP---了解RTMP

2011-07-14 15:12:06 [FMS]
When you use a regular Web page, you're most likely using HTTP (Hypertext Transfer Protocol), which allows you to look at Web pages.
To be able to work with streaming media, Adobe developed Real-Time Messaging Protocol (RTMP). Generally, when you use FMS3, you first connect to a Web server via HTTP and then to Flash Media Server using RTMP.
Because of this arrangement, you're working simultaneously with different protocols—one for the Web site and the other for the streaming media.

当你使用一个常规的web 页面,你最可能使用HTTP(超文本传输协议)来允许你看web页面。
为了能够工作于流媒体,Adobe 开发了实时信息协议(RTMP)。
通常,当你使用FMS3,你首先通过HTTP连接到web server然后使用RTMP连接到 佛拉屎 媒体服务器。
由于这个原因,你同时使用两个协议来协作,一个用于web站点,一个用于流媒体。

Testing FMS3 Connections--测试FMS3连接

2011-07-14 16:05:55 [FMS]
The protocol to connect to Flash Media Server 3 is RTMP—Real-Time Messaging Protocol.
The newest version of RTMP is RTMPE (E for Encryption).
The examples show both.
The older RTMP is a bit faster, but RTMPE performs better for encryption and is more secure.
You set up a net connection, and then place the RTMP path in your NetConnection instance.
The basic routine is as follows:

nc = new NetConnection( );
nc.connect("rtmp:/appName");

连接到FMS Server是使用RTMP协议。
RTMP最新的版本是RTMPE(E 是加密)。
RTMP比较快,但是RTMPE比较安全。
初始化一个connect,然后把RTMP的路径放入NetConnection的实例里。

If your path is to a server on the same computer (or physical server) as your application, you use only a single "/" slash; however, if your path is to a remote server or LAN, you use a double slash "//" as follows:

Same computer:
nc.connect("rtmp:/FMSapp")

Different computers:
nc.connect("rtmp://www.myDomain.com/FMSapp")

如果你的RTMP路径是到同一台电脑的server作为你的程序,你只用一个反斜线就行;如果是远程或者局域网,那就用两个反斜线。

接下来是我用flex 连接FMS的例子。
首先,我在FMS 根目录下的 applications 里建了一个 connect空文件夹。
我只有一台电脑。。所以我的RTMP路径就是:

rtmp://127.0.0.1/connect
或者
rtmp:/connect

然后是我的flex代码,很简单。



当文本框返回NetConnection.Connect.Success,那么连接就成功了。

Using the FMS3 Administration Console----使用FMS 控制台

2011-07-14 20:09:11 [FMS]
FMS的控制台是个好东西。
他能告诉你FMS服务器正在发生的事情。
譬如有多少客户端连接了哪个服务端的程序。
消耗了多少资源。
我记得RED5好像没这个。

可以通过控制台的路径在浏览器直接打开。
譬如我的控制台地址是:
http://localhost/fms_adminConsole.htm

如果是在windows上安装的FMS,也可以通过:
所有程序->adobe->FMS(你的版本)->Adobe Flash Media Server Administration Console打开。

打开上一篇文章里做的客户端程序。
你就会在控制台看到相应的信息,如图:


随着你对FMS开发的深入,你会发现这是个好东西,他能让你知道FMS正在做什么。

[1]

All by huayun321