Media Flow Controller Configuration Tasks : Advanced Configurations : Installing and Using Flash Media Server (FMS) in Media Flow Controller

Installing and Using Flash Media Server (FMS) in Media Flow Controller
Media Flow Controller has the ability to work with Adobe Flash Media Server (FMS) to stream Flash videos over Real Time Messaging Protocol™ (RTMP).
FMS RTMP delivery service listens on Transmission Control Protocol (TCP) port 1935; the FMS administration service listens on TCP port 1111. RTMP is a proprietary protocol developed by Adobe Systems for streaming audio, video and data over the Internet, between a Flash player and a server.
Installing FMS on Media Flow Controller
To install FMS, you must first download the image; you can do this directly from Adobe (the “Development Server” version, available for free, is adequate for this procedure, but it is limited to 10 simultaneous streams). First download the image to a Web or FTP/SCP server to which you have access. Use these CLI commands at the (config) # prompt (must have admin privileges and enter enable and then configure terminal first):
application fms download <URL_of_FMS_image>
application fms install <name_of_FMS_image>
The download command downloads the image given in the URL (SCP, HTTP, or FTP) to the directory /nkn/adobe/downloads directory that is visible in the FMS shell. See the “Command Arguments Key” on page 161 for the scp URL format).
The install command shows files in the FMS download directory and, when the install image is given, interactively installs FMS.
Important! It is critical that a few of the installation questions are answered with the correct values; be sure to use these values as indicated in the following step procedure.
1.
Accept the license agreement and enter your FMS server serial number or leave blank and press Enter to install the FMS Development Server. The FMS Development Server is free, but limited to 10 simultaneous streams.
Do you agree with the license agreement? (y/n): y
Please enter your Flash Media Server 3.5 serial number.
You have not entered a serial number. Falling back to the Adobe Flash Media Development Server!
Would you like to try again? y/n: Default [n]: n
Adobe Flash Media Server 3.5 requires approximately 200MB of disk space.
2.
The installer will install Adobe Flash Media Server 3.5 in the following directory. Default [/opt/adobe/fms]: /nkn/adobe/fms
3.
WARNING: The installer has detected a previous installation.
Do you want the installer to overwrite the previous installation with this installation or quit this installer? (y/q) Default [y]: y
4.
The Adobe Flash Media Server communicates on the IANA-assigned port of 1935, which is the port most Flash applications expect, and can also communicate on port 80, both for tunneling Flash over HTTP, and for proxying HTTP to a webserver.
Please enter the Adobe Flash Media Server port(s), comma-separated Default [1935,80]: 1935
5.
Please enter the port to use for the Admin service. You can only specify one admin port. Default [1111]: 1111
6.
The administrative user name and password you provide here is required to use the Adobe Flash Media Server Management Console for administration, monitoring, and debugging.
Please enter the administrative username: admin
Please enter the administrative password:
Please do not enter a blank password.
Please enter the administrative password: *****
Confirm password: *****
7.
When the Adobe Flash Media Server service is started, the service can be run as a user other than "root". The server would change to this user when the server is started and has acquired its ports.
Please enter the user that the Adobe Flash Media Server service will run as Default user [nobody]: admin
8.
Please enter a valid user group for the "admin" user: Default group [admin]: admin
9.
Do you want to install apache? (y/n) Default [y]: n
10.
Do you want the Adobe Flash Media Server service to run as a daemon? (y/n) Default [y]: n
11.
Do you want to start the Adobe Flash Media Server after the installation is done? (y/n) Default [y]: n
----------- Install Action Summary -----------
WARNING: You have chosen to overwrite a previous installation.
Installation directory = /nkn/adobe/fms
Flash Media Server Port = 1935
Flash Media Admin Server Port = 1111
Administrative username = admin
Administrative password = (suppressed)
service owner = admin
service user = admin
service group = admin
12.
Proceed with the installation? (y/n/q): y
Modifying and Restarting the FMS Service
You must manually configure two FMS files. If any configuration changes are made to FMS, including installation, the FMS services need to be restarted.
1.
Modify the FMS server and adminserver files using vi. To do this, first log in to the FMS shell from the CLI config mode in Media Flow Controller:
application fms shell
2.
Locate the server and adminserver files and edit them as indicated; for this line:
if [ "X$USERID" != "Xroot" ]; then
Change to:
if [ "X$USERID" != "Xadmin" ]; then
Example:
test-vos # enable
test-vos # configure terminal
test-vos (config) # application fms shell
BusyBox v1.00 (2008.12.21-08:07+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
# ls
fms lib bin
# cd fms
# ls
documentation tcSrvMsg fmsadmin.pid
applications uninstallFMS modules
auto_fms_start_enabled fmsmgr tools
shmrd logo.gif dh1024.pem
fmsmaster.pid logs scriptlib
licenses conf fmscore
fmsmaster fmsadmin libasneu.so.1
server webroot readme.htm
License.htm samples dh512.pem
touch tmp adminserver
License.txt fmsedge
#
3.
Exit the FMS shell by typing exit; the window closes and you must open a new session to Media Flow Controller.
4.
service restart mod-rtmp-admin
service restart mod-rtmp-fms
Configuring the FMS Admin Console—First Time
The FMS Admin Console allows you to monitor and manage FMS activity, including the current FMS user sessions, streams, and performance. The Media Flow Controller Web-based Management Console lets you monitor only the delivery of the files configured under VOD (described below).
Note! Do not use your Media Flow Controller as a Web server for the FMS Admin Console.
To use the FMS Admin Console to monitor FMS activity, you need to copy three files under the FMS installation directory to the doc root of your origin-server; Juniper Networks recommends placing these files in a directory separate from your FMS video files directory.
1.
2.
You can locate the three files you need in the fms/webroot directory of the unpacked FMS Development Server tarball:
/fms_adminConsole.htm
/resources/AC_RunActiveContent.js
/swfs/fms_adminConsole.swf
Copy these three files to your doc root (/var/www/html) in a directory you create; for example fmsAdmin.
3.
http://<IP_address_of_origin-server>/fmsAdmin/fms_adminConsole.htm
4.
5.
The advantage to installing the FMS Admin Console before FMS configuration is complete is that, when FMS configuration on Media Flow Controller is complete, you can immediately check the installation via the FMS Admin Console. Otherwise, you must send appropriately defined traffic and verify FMS processing through the Media Flow Controller. You can do this either by looking at the logs and graphs in the Media Flow Controller Web-based Management Console or by using show counters at the CLI to observe FMS traffic.
Configuring FMS on Media Flow Controller for Video on Demand
To configure FMS for video on demand (VOD), log in to the FMS shell from the CLI config mode in Media Flow Controller:
application fms shell
The above CLI command takes you to the FMS installation directory and from there, all FMS configuration changes can be done. The configuration entails creating a Media Flow Controller FMS directory and namespace(s).
When an RTMP request comes to FMS, it scans the configuration file in the application directory /fms/applications to find the requested file. You configure Media Flow Controller namespace to correspond with the configuration of VOD_DIR (described below).
Important! The configuration in FMS must match your FMS Media Flow Controller namespace configuration.
FMS VOD Configuration
Assuming we are using the default FMS VOD application:
1.
Locate the Application.xml file in the /fms/applications/vod directory and replace ${VOD_DIR} with /nkn/mnt/fuse/fms in the the configuration for VirtualDirectory. The VirtualDirectory configuration part of Application.xml looks like this (before editing):
<VirtualDirectory>
<!-- Specifies application specific virtual directory mapping for recorded
<Streams>/;${VOD_COMMON_DIR}</Streams>
<Streams>/;${VOD_DIR}</Streams>
</VirtualDirectory>
Edit this as indicated, for this line:
<Streams>/;${VOD_DIR}</Streams>
Change to:
<Streams>/;/nkn/mnt/fuse/fms</Streams>
Example:
test-vos (config) # application fms shell
BusyBox v1.00 (2008.12.21-08:07+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
# ls
lib fms downloads bin
# cd fms
# ls
auto_fms_start_enabled logs readme.htm
fmsmgr License.txt tcSrvMsg
server dh1024.pem fmsadmin
fmsmaster.pid shmrd tmp
uninstallFMS modules logo.gif
webroot fmsedge applications
libasneu.so.1 tools samples
licenses fmscore documentation
conf License.htm adminserver
dh512.pem scriptlib
fmsmaster fmsadmin.pid
# cd applications
# ls
vod live
# cd vod
# ls
main.far media readme.txt
allowedHTMLdomains.txt Application.xml allowedSWFdomains.txt
#
2.
Exit the FMS shell by typing exit; the window closes and you must open a new session to Media Flow Controller.
Note! The directory configuration is /nkn/mnt/fuse PLUS the URI path /fms from the namespace configuration (below).
If the file requested by the client player for application VOD is sample.flv, then the request that comes to Media Flow Controller is /fms/sample.flv. Media Flow Controller matches the incoming request /fms/sample.flv to namespace fms_vod via the configured match uri of /fms.
Media Flow Controller Namespace Configuration for FMS VOD
The namespace and match uri must match the application configuration in FMS. For example, if you used /nkn/mnt/fuse/fms/vod above instead of /nkn/mnt/fuse/fms, then your corresponding namespace configuration would have to have a match uri of /fms/vod. Example assumes a configuration of /nkn/mnt/fuse/fms.
The video files and associated files such as SWFs, JavaScript, and HTML are stored in an HTTP or NFS origin server and the configured Media Flow Controller namespace points to that origin server.
The files also can be pre-ingested using FTP instead of fetching from origin on cache-miss.
It's also possible to cache only the video file in Media Flow Controller and for all other associated files, the player directly goes to the origin server.
test-vos (config) # namespace fms_vod
test-vos (config namespace fms_vod) # domain any
test-vos (config namespace fms_vod) # match uri /fms
test-vos (config namespace fms_vod) # origin-server http fms-origin.test.com
test-vos (config namespace fms_vod) # status active
test-vos (config namespace fms_vod) # exit
How to Configure Multiple Namespaces and URIs—Method 1
Have multiple applications such as vod, vod1, and vod2, in FMS and let them map to their corresponding namespaces as given below:
vod:
Application.xml: <Streams>/;/nkn/mnt/fuse/firstpath</Streams>
namespace match uri: /firstpath
Player1 requests file: application vod and file sample.flv
vod1:
Application.xml: <Streams>/;/nkn/mnt/fuse/secondpath</Streams>
name space match uri: /secondpath
Player2 requests file: application vod1 and file sample.flv
vod2:
Application.xml: <Streams>/;/nkn/mnt/fuse/thirdpath</Streams>
name space match uri: /thirdpath
Player3 requests file: application vod2 and file sample.flv
How to Configure Multiple Namespaces and URIs—Method 2
Have only one application and use the client player to provide different file paths that map to different namespaces.
vod:
Application.xml: <Streams>/;/nkn/mnt/fuse</Streams>
player1 requests file: firstpath/sample.flv
player2 requests file: secondpath/sample.flv
player3 requests file: thirdpath/sample.flv
Video Directories
Put your videos in the Apache webroot (var/www/html) in a directory named /fms (or whatever you used for the URI path configuration in the Application.xml file) of the origin server configured for your streaming namespace. Provide access to them on your Website. You can then open a browser and request a video via RTMP and observe FMS on Media Flow Controller either by looking at the logs and graphs in the Media Flow Controller Web-based Management Console or by using show counters at the CLI.
Applying the Adobe Full-Function FMS Server License
If you installed FMS on Media Flow Controller using the free FMS Development Server, and decide to upgrade to the full-function Adobe FMS Server, follow these steps.
1.
Download the license using application fms download command. For example:
test-vos (config) # application fms download scp://<user>@<hostname>/<path_to_file>/<license_file_name>.lic
2.
application fms shell
3.
cd downloads/
4.
cp <license_file_name>.lic ../fms/licenses/
5.
service restart mod-rtmp-fms
Note! You can install FMS on Media Flow Controller without the full-function FMS Server license, but the functionality is limited to 10 simultaneous streams.
Note! You can also obtain a special juniper-mfc-fms license that, when installed, automatically installs the full-function Adobe Flash server. For details, see “Requesting Technical Support” on page 32.

Report an Error
Media Flow Controller Administrator's Guide and CLI Command Reference
Copyright © 2010 Juniper Networks, Inc.