Tutorial

Tutorial: On-demand HTTP Dynamic Streaming

Requirements

To complete this tutorial, download the following software:

On-demand HTTP Dynamic Streaming requires Apache 2.2. Apache 2.2 is included with Flash Media Server 3.5 and later. Download one of the following:

On-demand HTTP Dynamic Streaming requires the following software tools. These tools are included with Flash Media Server 4.0 and later. If you’re using Apache 2.2 without Flash Media Server or with Flash Media Server 3.5, download the tools:

Follow these steps to create your first end-to-end, on-demand, multi-bitrate HTTP Dynamic Streaming application:

  1. Do one of the following to install Apache:

    • Install Flash Media Server 4.0 or later.

      This version of the server includes Apache and the HTTP Origin Module. On Windows, it includes the Microsoft Visual C++ 2005 Redistributable Package and the Microsoft Visual C++ 2008 Redistributable Package. On Linux, it includes the Linux libraries.

    • Install Flash Media Server 3.5.

      This version of the server includes Apache. This version does not include the HTTP Dynamic Streaming Origin Module, the Visual C++ runtime packages, or the Linux libraries.

    • Install Apache HTTP Server version 2.2.

      This version of Apache doesn’t include the HTTP Origin Module, the Visual C++ runtime packages, or the Linux libraries.

  2. If you’re using Apache with Flash Media Server, Configure Apache and Flash Media Server to run on the same computer.

  3. If you’re not using Flash Media Server 4.0, do the following:

    1. On Windows, download and install Microsoft Visual C++ 2005 Redistributable Package and Microsoft Visual C++ 2008 Redistributable Package.

      On Linux, download and install the following libraries: OpenSSL, Expat, and Netscape Portable Runtime (NSPR).

    2. Install the HTTP Origin Module.

      On Windows, copy the following files to the Apache \modules folder: mod_f4fhttp.so, adbe_F4V.dll, and libexpat.dll.

      On Linux, copy the following files to the Apache \modules folder: mod_f4fhttp.so, and libF4V.so file.

    3. Create a “vod” folder in the Apache DocumentRoot folder. The vod folder will hold the packaged media files.

      On Windows, the default location is C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\vod.

      On Linux, the default location is /usr/local/apache/htdocs/vod.

    4. To configure the HTTP Origin Module, do the following:

      1. Open the Apache \conf\httpd.conf file in a text editor.

      2. Locate the LoadModule section and add the following line:

        LoadModule f4fhttp_module modules/mod_f4fhttp.so
        Note: If there isn’t a LoadModule section, add the line anywhere in the file.
      3. Locate the <Location> section and add the following:

        <Location /vod> 
            HttpStreamingEnabled true 
            HttpStreamingContentPath "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\vod" 
        </Location>
        Note: Set the HttpStreamingContentPath directive to the full path of the “vod” folder you created in step 2c.
      4. Save and close the file.

      5. Restart Apache HTTP Server.

  4. To package files, complete the task Package multi-bitrate files and return to this tutorial.

  5. Copy the packaged files to the “vod” folder you created in step 3c.

    On Flash Media Server, the “vod” folder is in the following locations:

    • On Windows, C:\Program Files\Adobe\Flash Media Server 4.0\webroot\vod.

    • On Linux, /opt/adobe/fms/webroot/vod.

  6. To play the media in OSMF Player, do the following:

    1. Copy the OSMF Player files (including the \scripts, \images, and \assets folders and their files) to the DocumentRoot folder. This folder is the parent of the “vod” folder.

      Note: If the DocumentRoot folder already contains an “images” folder, copy the files in the OSMF Player \images folder to the DocumentRoot\images folder.
    2. Open a web browser and enter the address of the OSMF Player.

      This tutorial uses http://localhost/OSMFPlayer.html.

      Note: OSMF Player requires Flash Player 10.1.
    3. Click the Eject button and enter http://localhost/vod/sample1_1500kbps.f4m.

    4. Click Play.

    5. To test multi-bitrate streaming, click the Q button to turn on manual switching. Click Q- and Q+ to shift down and up.

Understanding the on-demand tutorial

To play a video in OSMF Player, request an F4M file, also called a manifest file. The request syntax for on-demand streaming is:

http://<server-name>/<location-tag-alias>/<manifest-file-name>.f4m
Note: The syntax is the same for all on-demand use cases.

The following table explains the variables in the request syntax:

Variable

Description

<server-name>

The domain name or IP address of the computer hosting Flash Media Server. In this tutorial, OSMF Player and Flash Media Server are on the same computer, so the value is localhost.

<location-tag-alias>

This value is configured in a Location directive in the Apache /conf/httpd.conf file. The default value for on-demand http streaming in the Apache HTTP Server that installs with Flash Media Server is vod.

<manifest-file-name>

The name of the manifest (.f4m) file created by the File Packager.