13 September 2011
This article assumes you are new to using Flash Media Server 4.5 and are interested in how to stream media files from Flash Media Server.
This article is the first in a series of beginning-level tutorials that walk you through the process of learning how to use Adobe Flash Media Server 4.5—without a lot of "techie talk." For many of us, Flash Media Server (also referred to colloquially as FMS) is rather mysterious and may be overwhelming. We can see its benefits—and there are many—but actually using it and creating applications that "hook" into it can be baffling at first glance because of the sheer number of things it does. It is our intention that once you have absorbed these tutorials, you will be able to read some of the more advanced articles on streaming video in the Adobe Developer Connection and understand what they are all about.
Here are all of the articles in the series (links will become active as the articles are published):
This particular tutorial starts at the beginning of the process. You have downloaded Flash Media Server and you are prepared to launch the installer. Before reaching for the mouse, read the next section for an overview of how Flash Media Server works.
As Kevin Towes, senior product manager, mentions in his overview article, Introducing Flash Media Server 4.5, you can deliver video in more ways and to more devices than ever before. For example, you can now target the full range of Apple iOS devices (that means iPhone and iPad) in addition to devices running Adobe Flash Player—whether it's a phone in someone's pocket or the HDTV in their living room. If personal engagement is a priority for you, peer-to-peer (P2P) connectivity across servers is now built into FMS, so you can create multiplayer games and real-time collaborative applications. If security is your concern, FMS provides you with protected HTTP Dynamic Streaming and HTTP Live Streaming. These features and many others will be explored in subsequent articles in this series. For now let's step back and take a much broader view of the process.
Though the major news about Flash Media Server 4.5 revolves around its HTTP Dynamic Streaming and HTTP Live Streaming features, we are going to start where most people new to FMS start—with the RTMP protocol.
As the documentation supplied with the installer clearly explains, Flash Media Server is a hub through which media such as video and audio files are streamed. When you need to access them, the video player (SWF file or Adobe AIR application) makes a call to the server using the Real Time Messaging Protocol (called an RTMP address), and the server locates the media file and sends it to the SWF. The really great thing about this is that "play really does mean play." The video or audio files start to play as soon as they arrive in the browser running Adobe Flash Player—or through an AIR based desktop or mobile app. There is no waiting for some of the content to load and—best of all—nothing is downloaded to the browser's cache at all, so the file is secure.
RTMP is a proprietary (though open specification) protocol that uses TCP (transmission control protocol) for the transmission of data packets between Flash Player and Flash Media Server. The real advantage of this method compared to other delivery mechanisms is that RTMP is designed to deliver video (FLV, MP4, F4V, M4V, F4M, F4F, 3GPP, RAW, and MOV) and audio (MP3, AAC, SPEEX, G.711, and Nellymoser) files to a SWF file whether it's embedded in a web page, on a mobile device, or even in an Adobe AIR application sitting on the user's desktop.
The thing is, the media being hauled into the SWF file does not sit on your web server. It sits in a folder on the server running Flash Media Server, which could be one that you or your company owns or one that is managed by an ISP or a Flash Video Streaming Service (FVSS). For the purposes of this article, Flash Media Server is sitting on your own computer.
The development version you are about to install is not much different than the full installation of Flash Media Enterprise Server, which is the top-level edition of the product. Although it has all the features of the commercial edition, think of it instead as a testing server. Just as you would test a Flash file locally before uploading it to a web server, you can use the installed version of FMS on your computer to test a movie that will eventually be streamed.
Note: If you think that you or your company may invest in a commercial version of this product, the handy Help Me Choose chart will help you decide which edition fits your needs best.
Having gotten these preliminaries out of the way, let's get started with installing the server on a PC or, if you have a Mac with a Microsoft Windows partition, on your Windows 7 partition. If you worked with previous versions of Flash Media Server, keep in mind that Flash Media Server 4.5 has changed quite a bit from the last version. The biggest change is that FMS will install only on a 64-bit version of Windows. If you don’t meet this requirement, you will need to remove your 32-bit Windows version and replace it with the 64-bit version of the OS. You can grab a copy of the free Flash Media Development Server installer on the product's requirements page.
Note: A Linux version is also available. Review the system requirements on the main product requirements page linked to above.
Before you install Flash Media Server 4.5, Adobe suggests that you first back up your applications and/or configuration files before uninstalling any earlier version of FMS you may have. The installation process has changed in some ways from earlier versions.
To install Flash Media Server 4.5, follow these steps:
It's a really good idea to enter a username and password that you will remember because you'll be prompted to enter this information every time you start the Flash Media Administration Console. We used the usual "admin"—if you forget that, you're in serious trouble—and a nine-character password that we regularly use for other purposes.
Since this is a testing server, not a "high-risk" situation like a PayPal account, you may wish to send yourself an e-mail message containing the username and password. That way, you can easily find a stored record of the information. (Of course, if you were working on a production server, you would want to protect this password.)
Those of you who are new to Flash Media Server will find the start screen an indispensible resource; grizzled veterans tend to greet it with a resounding, "It's about time!" Regardless of your skill level, if your FMS 4.5 installation went smoothly and the server is running, this is the first screen you will see after clicking the Finish button.
Adobe is the first to admit that learning Flash Media Server is a daunting task due to the product's sheer complexity. The start screen brilliantly addresses this by helping you find the resources you need to begin using the product and getting support.
The Tools column on the left contains links to a variety of tools, such as the FLVCheck Tool, which help you do your job more effectively. The middle Sample Applications and White Papers column links to a variety of examples and publications designed to grow your skill set.
The third column is broken into two areas. The top section, Getting Started, includes links to a variety of articles and samples from the Adobe Developer Connection to help you get started right away. Think of the second section, Getting Support, as a local Rolodex for Flash Media Server. Use these resources to find a local expert for any Adobe product, learn about training opportunities, and locate consultants for your projects.
The Administration Console helps you manage the server. Because there are so many different features, I'm not going to dive into it. Instead, assume you have just bought a new car and the neighbors are visiting to check it out. What do you do? Open the hood (or bonnet, depending on where you live) and start pointing stuff out. Let's show the neighbors what you have.
The first thing that strikes most people new to Flash Media Server is that the Administration Console is not an application. Even though you install the software into the same directory where you keep Adobe Flash Professional CS5.5 and other Adobe products, you won't see a product icon. The Administration Console is an HTML document containing the SWF file that is the actual console. This makes sense because you are dealing with a server, not a stand-alone application.
To open the Administration Console, either locate it on the Start menu or click the All Programs button on your Start menu and navigate to Adobe > Flash Media Server 4.5 > Adobe Flash Media Administration Console (see Figure 14).
Alternatively, navigate to C:\Program Files\Adobe\Flash Media Server 4.5\tools\ and double-click the Flash Media Administration Console link (see Figure 15). Be sure to double-click the HTML file shown (fms_adminConsole.htm not fms_adminConsole.swf) to launch the Administration Console. The SWF is already embedded within the HTML document.
When you open the Administration Console, you are prompted to enter the username and password you created when you installed FMS 4.5. After you enter your credentials, the console's login interface appears (see Figure 16). You will notice that the server is given a name. You need to enter an address (use localhost) and your password and username. If you are unsure, check with those responsible. If everything is fine, click the Login button.
The next screen that appears is the actual Administration Console (see Figure 17). Notice the green light on the right side of the Task Bar. This is a visual indication that your server is humming along quite nicely. The Help button (question mark) is linked to the Flash Media Server online documentation. Clicking the folder next to the question mark doesn't allow you to upload files, as you might think. Instead, this button links directly to a number of FMS resources, ranging from this very tutorial series to various forums where you can post questions to the FMS developer community.
Use the menu at the top of the console to set how often the SWF running the Administration Console updates itself. The choices range from one second to one minute; you can even pause the server's refresh rate. What you cannot do, however, is enter your own value. If you want to force a refresh, or if you're simply impatient, click the Refresh link in the upper-right corner. Clicking the Logoff link logs you off of the Admistration Console and leaves the server quietly running in the background.
Notice the three buttons across the top of the console. The one that is currently selected, View Applications, displays the applications that are currently associated with FMS. These "applications" are actually called "instances" (we discuss instances in Part 2) but if you click the New Instance button in the lower left, a list of the applications/instances will appear, which allow you to load one simply by selecting it. Let's hold off on that for now. Instead, click the Manage Users button.
Clicking the Manage Users button reveals the screen shown in Figure 18. It allows you to add users, remove users, and even change your password or their passwords. Why would you want to add users if this is a local installation? You may be sharing this computer with others in your workgroup or perhaps this installation is actually located on a server. Just keep in mind that the development server allows only 10 simultaneous connections at any one time so this really is just a testing server.
To change a password, select a username and click the Reset Password button to open the Resetting Password dialog box (see Figure 19). Enter the new password twice and click the Reset Password button to make the change. If you change your mind, click Cancel to close the dialog box.
Click the Manage Servers button to open the Manage Servers panel (see Figure 20). This area lets you see what is happening behind the scenes. The Details tab graphically displays the performance of any application that may be playing, as well as its bandwidth and CPU usage. The Connections tab indicates how many clients—SWFs and other servers—are connected, and conveys some information about the servers' performance and status. The Applications tab lists how many apps are currently running and their performance. Because you are using a development version, the information in the License tab is irrelevant. Even so, there is a link at the bottom of the panel that you can click to upgrade to Flash Media Interactive Server. The Server Log tab displays a log of the recent server activity. If you'd like to clear it at any time, click the Clear Log button.
This panel includes an important feature: verification that the server is actually "localhost." Here's how. In the left sidebar, click the middle button at the top of the Servers panel—the one with the "AB"—to edit server log information. After clicking it, the server information is displayed (see Figure 21). In the Server field, enter localhost. If you want to change your username and password, this is the area of the Administration Console to do it. The reason you enter "localhost" is because you are setting the RTMP address used to test your applications. Make any necessary changes and then click the Save button.
At this stage of the game, you are good to go. Quit the browser to close the Administration Console.
After completing these instructions, you have successfully installed Flash Media Server 4.5, opened the hood, and showed your neighbors what this new vehicle can do. You've also reviewed a tremendously helpful resource: the start screen.
The next few articles in this series will help you slide into the driver's seat, fire the engine up, and take Flash Media Server out for a spin around the block. In Part 2, you'll learn how to use Flash Media Server 4.5 to stream a video into a Flash video player using the video on demand service, as well as how to develop simple video applications with ActionScript 3.
Tutorials & Samples