Core server architecture



Client-server architecture

Adobe Flash Media Server applications have a client-server architecture. The client code is written in ActionScript (1, 2, or 3) and runs in Adobe Flash Player 6+, Adobe AIR 1+, or Adobe Flash Lite 3+. The server code is written in Server-Side ActionScript, which is like ActionScript 1.0.

The server and the client communicate over a persistent connection using Real-Time Messaging Protocol (RTMP). RTMP is a reliable TCP/IP protocol for streaming and data services. In a typical scenario, a web server delivers the client over HTTP. The client creates a socket connection to Flash Media Server over RTMP. The connection allows data to stream between client and server in real time. Flash Media Server installs with Apache web server by default. You can serve HTTP content from this web server. Alternatively, you can choose to exclude Apache from the Flash Media Server installation and serve SWF and HTML content from any external web server.

View full size graphic
Flash Media Server applications consist of client and server components that work together.

A.
Flash Media Server

B.
Web server sends SWF file.

C.
Flash Player, AIR, or Flash Lite client plays SWF file.

D.
SWF file connects to an application on Flash Media Server. The server streams data over a persistent connection.

View full size graphic

A.
Flash Media Server

B.
Web server sends SWF file.

C.
Flash Player, AIR, or Flash Lite client plays SWF file.

Real-time media server

Flash Media Streaming Server provides two streaming services: live and vod (video on demand). Streaming services are prebuilt server-side applications. Each streaming service offers prebuilt sample clients as well as a client SDK that developers can use to write their own clients.

Real-time collaboration application server

Flash Media Interactive Server and Flash Media Development Server include the same streaming services as Flash Media Streaming Server. In addition, they provide an SDK that lets developers write both the client-side and the server-side components of media applications to create interactive, two-way applications. These server editions also offer a plug‑in SDK. This SDK lets developers write C++ plug‑ins to extend the core functionality of the server.

Built-in Apache HTTP Server

All versions of Flash Media Server 3.5 include of Apache 2.2 HTTP Server. If you install and enable Apache, you can deliver client SWF files, container HTML files, and all media assets from the same server.

Content delivered by HTTP is progressively downloaded and cached by the client. (Content streamed through RTMP is not cached.) By default, Flash Media Server 3.5 proxies HTTP requests from port 80 to port 8134, as shown in the following diagram:


A.
Client requests content over HTTP.

B.
Flash Media Server proxies the request to port 8134.

C.
Apache web server delivers content for progressive download.

D.
Client requests content over RTMPT.

E.
Flash Media Server streams content to client.

You can configure proxying in the fms.ini file. For more information, see “Configuring the web server” in Adobe Flash Media Server Configuration and Administration Guide.

Hosting multiple applications

Flash Media Interactive Server and Flash Media Development Server can host an unlimited number of applications. Flash Media Streaming Server can host an unlimited number of instances of the live and vod services.

Note: Flash Media Streaming Server is restricted to running services provided by Adobe.

For example, Flash Media Interactive Server could host a web conferencing application, a video blogging application, a video chat application, and a multiplayer game. The server can also host the live and vod services. You can create multiple instances of each of these applications. Instances allow groups of people access to the same application without having the groups interact with each other. For example, you could create a video chat application with rooms for different topics.

To create an application, create a folder on the server with the name of the application. To connect to the server, write code in the client that calls the NetConnection.connect() method and passes it the name of the application.

The server has a root applications folder located at RootInstall/applications, by default. To create an application, create a subfolder in the root applications folder. For example, RootInstall/applications/mySampleApp creates an application called “mySampleApp”. To connect to mySampleApp, call myNetConnection.connect("rtmp://serverName/mySampleApp") from the client.

To create instances of an application, create subfolders within the folder of the application. For example, RootInstall/applications/mySampleApp/instance1 creates an instance of the mySampleApp application. To connect to this instance, call myNetConnection.connect("rtmp://serverName.mySampleApp/instance1") from the client. For more information, see “Connecting to the server” in Adobe Flash Media Server Developer Guide.

The server administrator can change the location of the root applications folder. The server administrator can also divide the server into multiple adaptors and virtual hosts, and each virtual host can have its own applications folder. For more information, see Configuring the server.

RTMP (Real-Time Messaging Protocol)

All server editions communicate with Flash Player, AIR, and Flash Lite over Real-Time Messaging Protocol. RTMP is optimized to deliver high-impact streams in real time. An RTMP connection can multiplex any number of streams. Each stream contains synchronized audio, video, and data channels. Remote method invocation and shared object messages are carried in a data-only stream.

There are five types of RTMP connections supported by Flash Media Server 3:

RTMP
This is the standard, unencrypted Real-Time Messaging Protocol. The default port is 1935; if a port is not specified, the client attempts to connect to ports in the following order: 1935, 443, 80 (RTMP), 80 (RTMPT).

RTMPT
This protocol is RTMP tunneled over HTTP; the RTMP data is encapsulated as valid HTTP. The default port is 80.

RTMPS
This protocol is RTMP over SSL. SSL is a protocol for enabling secure communications over TCP/IP. (Flash Media Server provides native support for both incoming and outgoing SSL connections.) The default port is 443.

RTMPE
This protocol is an encrypted version of RTMP. RTMPE is faster than SSL, does not require certificate management, and is enabled in the server’s Adaptor.xml file. If you specify RTMPE without explicitly specifying a port, the Flash Player scans ports just like it does with RTMP, in the following order: 1935 (RTMPE), 443 (RTMPE), 80 (RTMPE), and 80 (RTMPTE).

RTMPTE
This protocol is RTMPE with an encrypted tunneling connection. The default port is 80.

HTTP (Hypertext Transfer Protocol)

Flash Media Server 3.5 includes Apache HTTP Server. If you install and enable Apache, you can deliver the client SWF file, container HTML page, and additional assets over HTTP.

Additionally, you can write client-side ActionScript that causes Apache to serve media assets over HTTP progressive download if RTMP streaming fails. For example, if a client attempts to stream a video over RTMP and fails, the server attempts to tunnel RTMP over HTTP. If that attempt fails, the server delivers the video over HTTP.

Streaming media

Media (which can contain audio, video, and data) is sent between a client and Flash Media Server in real time and displayed as it arrives. This type of data transmission is called streaming. The media streamed between a client and Flash Media Server is called a stream. Streams use a publish-and-subscribe model; subscribe means play. Either a client or a server can publish a stream; only a client can play a stream.

For example, a producer could use Adobe Flash Media Live Encoder to capture and encode live audio and video from a keynote speech and publish it to the server. Users could view the speech in a Flash Player, AIR, or Flash Lite client that subscribes to the stream.

In another scenario, a user on a social media website could publish a live stream in a video chat application; in this case, Flash Player would capture the video from the user’s webcam. Other users on the social media site could view the stream live, or, if the developer added this functionality, play the recorded stream at a later time.

Note: Flash Media Interactive Server and Flash Media Development Server can record live streams for playback at a later time.

A server can publish a stream to clients or to other servers. For example, you might want to pull XML data into a server-side script to create a playlist and publish it as a stream to clients. A server would publish a stream to another server to scale live broadcasting applications to support more clients.

Supported codecs

Flash Media Server doesn’t encode or decode audio and video information. Flash Media Server streams media that has already been encoded.

To encode media that has already been captured (in other words, media that is not live), use any codec that supports the version of Flash Player or AIR that you want to target.

To capture, encode, and stream live video, you can either use Flash Media Live Encoder or use ActionScript to build your own Flash Player or AIR client. Flash Media Live Encoder 2.5 and later encodes video in the On2 VP6 codec or the H.264 codec. Flash Player and AIR encode live video with the Sorenson Spark codec and encode live audio with a proprietary Nellymoser codec.

The following table lists the supported codecs and their earliest required SWF file format and Flash Player versions:

Codec

SWF file format version (earliest supported publish version)

Flash Player version (earliest version required for playback)

Sorenson Spark

6

6, Flash Lite 3

On2 VP6

8

8, Flash Lite 3

H.264 (MPEG-4 Part 10)

9

9 Update 3, AIR

MP3

6

6, Flash Lite 3

AAC (MPEG-4 Part 3)

9

9 Update 3, AIR

Speex (audio)

10

10

Nellymoser

6

6, Flash Lite 3

Note: AIR is a cross-operating system runtime that contains Flash Player 9 Update 3 or later. Flash Player and AIR support an alpha channel in the On2 VP6 codec only.

Flash Player Update 3 and later supports playback of the following subsets of the MPEG-4 file format standards:

MPEG-4 standard

Flash Player 9 Update 3/AIR support

ISO/IEC 14496-3 (Audio AAC)

AAC Main; AAC LC; SBR

ISO/IEC 14496-10 (Video AVC)

Base (BP); Main (MP); High (HiP). All levels are supported.

ISO/IEC 14496-12 (Container)

1 Audio track; 1 Video track

3GPP TS 26.245 (Timed text format)

Full support

Supported file formats

All editions of Flash Media Server stream the following file formats:

FLV format
All versions of Flash Media Server (1, 2, and 3 and later) support playback and recording of the FLV file format. The FLV file format supports the following codecs: On2 VP6, Sorenson Spark, and MP3.

F4V format (MPEG-4 compatible)
Flash Media Server versions 3 and later support playback of all Flash Media Server-supported audio and video codecs within MPEG-4 Part 14 container formats. File types suported by the MPEG-4 format include F4V, MP4, M4A, MOV, MP4V, 3GP, and 3G2.
Important: If a file contains portions of audio and video whose codecs are unsupported by Flash Media Server, those parts of the stream do not play.

Flash Media Interactive Server 3.5 introduces support for recording in MPEG-4 format. Live video and audio streams containing any codecs supported by Flash Media Server can be recorded on the server into the F4V format.

Note: Files recorded in MPEG-4 format cannot be played back by earlier versions of Flash Media Server.

Use the following table to see which file formats and Flash Player versions the codecs support:

Codec or Data type

File format

Flash Player support

Usual codec pairing

Sorenson Spark

FLV

6, 7, 8, 9, 10

Nellymoser/MP3

On2 VP6

FLV

8, 9, 10; Flash Lite 3

Nellymoser/MP3

H.264*

MPEG-4: MP4, M4V, F4V, 3GPP

9,0,115,0; 10

AAC+/MP3

Nellymoser

FLV

6, 7, 8, 9, 10

Spark/On2

MP3

MP3

6, 7, 8, 9, 10; Flash Lite 3

Spark/On2

AAC+ / HE-AAC / AAC v1 / AAC v2

MPEG-4: MP4, M4V, F4V, 3GPP

9,0,115,0; 10

H.264

SPEEX

FLV

10

Spark/On2

AMF 0

FLV, MPEG-4: MP4, F4V

6, 7, 8, 9, 10; Flash Lite 3

Spark/On2/H.264

AMF 3

FLV, MPEG-4: MP4, F4V

8, 9, 10

Spark/On2/H.264

Note: H.264 playback in Flash Player supports most profiles including Base, Main, and HiP. The F4V format is a subset of MPEG-4 ISO 14496-10 and AAC+ (ISO 14496-3).

Supported metadata formats

You can now deliver Adobe Extensible Metatdata Platform (XMP) metadata embedded video streaming through Flash Media Server to Flash Player. XMP is a labeling technology that allows you to embed data about a file into the file itself. XMP metadata is a system that communicates critical media information from the point where the media is created to the point where media is viewed. With XMP, applications and publishing systems can capture, share, and leverage metadata. In Flash Media Server, all the metadata embedded within a media file is accurately delivered. In addition, speech-to-text metadata embedded within files and encoded from Adobe Media Encoder CS4 can be delivered. For detailed information about XMP, see www.adobe.com/go/learn_fms_xmp_en.

Data model

Flash Media Server applications use a simple, yet powerful, distributed data model based on shared objects. Both client-side ActionScript and Server-Side ActionScript have a SharedObject class that lets developers share data between clients connected to a server.

There are two types of shared objects: local and remote. Local shared objects are stored on the client computer and remote shared objects are stored on the server. Both local and remote shared objects can be either temporary or persistent.

Local shared objects are like cookies: they save data to a user’s computer for offline access, or for saving preferences. Local shared objects are a feature of Flash Player and do not require Flash Media Server.

Remote shared objects are managed and stored by the server. Developers can use remote shared objects for messaging, data synchronization, and storing data. Clients connect to a remote shared object and receive updates whenever a change is made to that shared object. Messages can be sent to all clients connected to a remote shared object.

Note: Remote shared objects are not supported by Flash Media Streaming Server.

For more information, see Adobe Flash Media Server Developer Guide.

Invoking remote methods

Flash Media Interactive Server and Flash Media Development Server support two-way, asynchronous, remote method invocation. Clients can invoke methods defined on the server, and the server can invoke methods on clients connected to the server. In client-side script, call the NetConnection.call() method to invoke a method defined on a server-side Client object. In a server-side script, call the Client.call() method to invoke a method defined on the client-side NetConnection object. You can also call NetConnection.call() in a server-side script to invoke a method on a remote server.

For more information, see Adobe ActionScript 2.0 Language Reference for Adobe Flash Media Server and Adobe ActionScript 3.0 Language and Components Reference.

Connecting to external sources

In addition to the communication models that streams and shared objects provide, Flash Media Interactive Server and Flash Media Development Server can interact with external data sources, such as web services and relational databases, or with other Flash Media Server applications. For example, Server-Side ActionScript can be written to connect to a web service (use the WebService class) or to a ColdFusion® application to retrieve a list of names and phone numbers. The results of the query can then be placed in a shared object.

For more information, see Adobe Flash Media Server Developer Guide and Adobe ActionScript 2.0 Language Reference for Adobe Flash Media Server.

Note: Flash Player, AIR, and Flash Lite clients can use any supported client-side ActionScript API to interact with external sources as well; Flash Media Server doesn’t limit this functionality. For more information, see Flash Player, AIR, and Flash Lite documentation.