Tutorials: on-demand and live streaming

Note:

By default, the EBS volumes attached with the AMS instance are not marked for deletion. However, the data on the primary drive where the operating system and AMS are installed is not accessible. This is because the data cannot be mounted to a different instance. Adobe recommends that you copy the required content from the primary drive to a different EBS volume. You can mount this volume to a different AMS instance. In contrast, the data on the secondary drive can be mounted to any other instance.  

On-demand streaming

Flash Player 10.1, AIR 2

Adobe Media Server on Amazon Web Services has a built-in vod application that streams video on demand content to video players running in Flash Player and AIR. These tutorials use video players built with the Open Source Media Framework (OSMF). OSMF simplifies the development of video players for the Flash Platform.

The tutorial uses a video player called Strobe Media Playback. Host Strobe Media Playback on your own web server.

On-demand streaming with Strobe Media Playback

AMS 5.0.7 onwards, Strobe Media Player is bundled with the installer. You can either use the bundled SMP or download as described in this topic. The following video demonstrates how to use the bundled SMP.

From an expert:

From an expert:
Know everything about the Strobe Media Player that is bundled with AMS.
Richa Agarwal

  1. Log in to AWS Management Console and do one of the following:

  2. In the AWS Management Console, select the running instance and copy the Public DNS from the details pane.

  3. Do one of the following to copy an FLV or F4V/MPEG-4 file to the instance:

    • (Windows) See Connect to an instance and copy files from a Windows computer to use WinSCP to connect to the instance.

      In the left pane of WinSCP, browse to a video file on your local computer. In the right pane, browse to the /mnt/applications/vod/media directory on the remote instance. Drag the file from the left pane to the right pane.

    WinSCP graphical user interface. Local files are in the left pane. Files on the Adobe Media Server instance are in the right pane.

    • (Linux) Open an SSH client installed on your computer and use the scp command to copy a file to the instance:

      scp -i keypair.pem sample.mp4 amsadmin@public-dns:/mnt/applications/vod/media

      For example, if the filename of the video is sample.mp4, the command is:

      scp -i amsdocs.pem sample.mp4 amsadmin@ec2-184-72-148-15.compute-1.amazonaws.com:/mnt/applications/vod/media

      Note: Use the Key Pair file you downloaded when you created the instance.

      Note: Adobe Media Server and Apache HTTP Server run as amsuser:amsgroup. You may need to modify the uploaded content to allow access to it.

       

  4. Open the file strobe_root_folder/10.1/StrobeMediaPlayback.html in a text or HTML editor.

  5. Locate the following URL:

    "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"

    Replace the URL with the URL of the file you copied to the instance and save the file. Use the following syntax:

    "rtmp://public-dns/vod/mp4:filename.mp4"

    File format

    URL

    FLV

    rtmp://public-dns/vod/filename

    F4V

    rtmp://public-dns/vod/mp4:filename.f4v

    rtmp://public-dns/vod/mp4:subdirectory/filename.f4v

    MP4

    rtmp://public-dns/vod/mp4:filename.mp4

    rtmp://public-dns/vod/mp4:subdirectory/filename.mp4

  6. Open the StrobeMediaPlayback.html file in a browser and click Play.

    The file streams from Adobe Media Server on Amazon Web Services to the local version of Strobe Media Playback.

  7. You can also serve Strobe Media Playback and its supporting files from the Apache web server installed with Adobe Media Server on Amazon Web Services. Copy the Strobe Media Playback files to the following directory:

    /mnt/webroot

    For example, create a folder /mnt/webroot/strobe. Copy the following files from the strobe_root_folder/10.1 folder to the /mnt/webroot/strobe folder:

    StrobeMediaPlayback.html, SampleMediaPlayback.swf, the images folder, the scripts folder, and the playlists folder.

    Load the following URL into a browser and click play:

    http://public-dns/strobe/StrobeMediaPlayback.html

  8. When you terminate the instance, the data is deleted. To keep the recorded stream, copy it to a storage volume (S3 or EBS). For information about transferring files, see Managing content.

Live streaming

Flash Player 10.1, AIR 2

Adobe Media Server on Amazon Web Services has a built-in live application that streams live content to video players running in Flash Player and AIR. These tutorials use video players built with the Open Source Media Framework (OSMF). OSMF simplifies the development of video players for the Flash Platform.

The tutorial uses a video player called Strobe Media Playback. Host Strobe Media Playback on your own web server.

Live streaming with Strobe Media Playback

  1. Log in to AWS Management Console and do one of the following:

  2. In the AWS Management Console, select the running instance and copy the Public DNS from the details pane.

  3. Open Flash Media Live Encoder and enter the following:

    • For AMS URL, enter:

      rtmp://public-dns/live

      Substitute the Public DNS value you copied from the AWS Management Console.

    • For Stream, enter:

      livestream

    • Click Start to publish a stream to the live application on the instance.

    Flash Media Live Encoder.

  4. Download Strobe Media Playback from http://blogs.adobe.com/osmf/ and unzip it.

  5. Open the file strobe_root_folder/10.1/StrobeMediaPlayback.html in a text or HTML editor.

  6. Locate the following URL:

    "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"

    Replace the URL with the URL of the file you copied to the instance and save the file. Use the following syntax:

    "rtmp://public-dns/live/streamname"
  7. Open the StrobeMediaPlayback.html file in a browser and click Play.

    The file streams from the Adobe Media Server on Amazon Web Services to the local version of Strobe Media Playback.

  8. You can also serve Strobe Media Playback and its supporting files from the Apache web server installed with Adobe Media Server on Amazon Web Services. Copy the Strobe Media Playback files to the following directory:

    /mnt/webroot

    For example, create a folder /mnt/webroot/strobe. Copy the following files from the strobe_root_folder/10.1 folder to the /mnt/webroot/strobe folder:

    StrobeMediaPlayback.html, SampleMediaPlayback.swf, the images folder, the scripts folder, and the playlists folder.

    Load the following URL into a browser and click play:

    http://public-dns/strobe/StrobeMediaPlayback.html

Live streaming with DVR

Flash Player 10.1, AIR 2

To add DVR functionality to a live stream, do the following:

  1. Download the DVRCast application from www.adobe.com/go/ams_toolsand unzip it.

    Note:

    The DVRCast application was developed for Adobe Media Server 5, but it supports Adobe Media Server on Amazon Web Services as well.

  2. Copy the DVRCast application to the following location on the instance:

    /mnt/applications/dvrcast_origin

    Use the instructions at Connect to an instance and copy files from a Windows computer or Connect to an instance and copy files from a Linux/UNIX computer.

  3. Open Flash Media Live Encoder and enter the following:

    • For AMS URL, enter:

      rtmp://public-dns/dvrcast_origin

      Use the Public DNS value of the instance from the AWS Management Console.

    • For Stream, enter:

      livestream

    • Click Start to publish a stream to the dvrcast_origin application on the instance.

  4. Go to the Strobe Media Playback page at http://sourceforge.net/projects/smp.adobe/files/and do the following:

    1. For Video Source, enter:

      rtmp://public-dns/dvrcast_origin/livestream

      For example, if the Public DNS of the instance is ec2-184-72-148-15.compute-1.amazonaws.com, the Video Source is:

      rtmp://ec2-184-72-148-15.compute-1.amazonaws.com/dvrcast_origin/livestream

    2. Click the Advanced tab and select Stream Type: DVR.

    3. Click Preview to update the Embed Code.

    4. Click the Play button to play the video from your Adobe Media Server on Amazon Web Services instance.

    You can select other options in the Strobe Media Playback page. After you change an option, click Preview to update the embed code.

    To embed Strobe Media Playback in your own web page, copy the Preview Embed Code, and paste it into your HTML page.

  5. When you terminate the instance, the data is deleted. To keep the recorded stream, copy it to a storage volume (EBS or S3). The stream is recorded to /mnt/applications/dvrcast_origin/streams/_definst_/. For information about transferring files, see Managing content.

Live HTTP Dynamic Streaming

Flash Player 10.1, AIR 2

Note:

This tutorial assumes that you’ve completed the on-demand streaming tutorial and know how to launch an instance and connect to an instance.

Adobe Media Server on Amazon Web Services includes an application called livepkgr that packages published streams for delivery using HTTP Dynamic Streaming.

  1. Open Flash Media Live Encoder and enter the following:

    • In the Encoding Options panel, from the Preset pop-up menu, choose Multi Bitrate - 3 Streams (1500 Kbps) - H.264.

    • Click the wrench next to Format to open Advanced Encoder Settings. For Keyframe frequency, select 4 seconds.

      Note: The Preset changes to Custom when you select this setting.

    • For Bit Rate, choose 100, 200, and 350.

    • For AMS URL, enter:

      rtmp://public-dns/livepkgr

      Use the Public DNS value of the instance from the AWS Management Console.

    • For Stream, enter:

      livestream%i?adbe-live-event=liveevent

    • Deselect Save to File.

    • Click Start to publish a stream to the livepkgr application on the instance.

  2. Go to the Strobe Media Playback page at http://sourceforge.net/projects/smp.adobe/files/ and do the following:

    1. For Video Source, enter:

      http://public-dns/live/events/livepkgr/events/_definst_/liveevent.f4m

      For example, if the Public DNS of the instance is ec2-184-72-148-15.compute-1.amazonaws.com, the Video Source is:

      http://ec2-184-72-148-15.compute-1.amazonaws.com/live/events/livepkgr/events/_definst_/liveevent.f4m

    2. Are you using HTTP Streaming or Flash Access 2.0? Select Yes.

    3. Click Preview to update the Embed Code.

    4. Click the Play button to play the video from your Adobe Media Server on Amazon Web Services instance.

    You can select other options in the Strobe Media Playback page. After you change an option, click Preview to update the embed code.

    To embed Strobe Media Playback in your own web page, copy the Preview Embed Code, and paste it into your HTML page.

On-demand HTTP Dynamic Streaming

Flash Player 10.1, AIR 2

Note:

This tutorial assumes that you’ve completed the on-demand streaming tutorial and know how to launch an instance and connect to an instance.

To package an on-demand file for HTTP Dynamic Streaming, use the File Packager tool.

  1. Do the following to copy an FLV or F4V/MPEG-4 file from your local computer to the /webroot/vod directory on the Adobe Media Server instance:

    • Open an SSH client and issue the following command to copy a file to the instance:

      scp -i keypair.pem filename.xxx amsadmin@public-dns:/mnt/webroot/vod

      For example, the following command copies the file sample.f4v to an instance:

      scp -i amsdocs.pem sample.f4v amsadmin@ec2-184-72-148-15.compute-1.amazonaws.com:/mnt/webroot/vod

      Note: Use the Key Pair file you downloaded when you created the instance.

       

  2. Connect to the instance:

    ssh -i keypair.pem amsadmin@public-dns

  3. Change directories to the File Packager directory:

    cd /opt/adobe/ams/tools/f4fpackager

  4. Run the following command:

    export LD_LIBRARY_PATH=.

    Note:

    If you aren’t in the f4fpackager directory, specify the full path to the f4fpackager.

  5. Run the following command to package the sample.f4v file and copy the output files to the vod application’s media directory:

    ./f4fpackager --input-file=/mnt/webroot/vod/sample.f4v --output-path=/mnt/webroot/vod

    For more information, see Package content on Linux.

  6. Go to the Flash Media Player Setup page at http://sourceforge.net/projects/smp.adobe/files/ and do the following:

    1. For Video Source, enter:

      http://public-dns/vod/filename.f4m

      For example, if the video you packaged was sample.f4v, the Video Source is:

      http://ec2-184-72-148-15.compute-1.amazonaws.com/vod/sample.f4m

    2. Are you using HTTP Streaming or Flash Access 2.0? Select Yes.

    3. Click Preview to update the Embed Code.

    4. Click the Play button to play the video from your Adobe Media Server on Amazon Web Services instance.

  7. When you terminate the instance, the data is deleted. To keep the recorded stream, copy it to a storage volume (S3 or EBS). For information about transferring files, see Managing content.

Multicast streaming

Flash Player 10.1, AIR 2

Note:

Adobe Media Server on Amazon Web Services supports peer-assisted multicast streaming. It does not support IP multicast or fusion multicast.

Copy the multicast tools to the webroot folder

Adobe Media Server includes a Multicast Configurator tool and a Multicast Player. To access these tools from a web browser, move them to the webroot directory on the instance.

  1. The following directory contains the multicast tools:

    /opt/adobe/ams/tools/multicast/

    Move the multicast directory to the following location:

    /mnt/webroot/

    Using WinSCP to move the /multicast directory to the /mnt/webroot directory

Configure a multicast event

To multicast a live stream, use the Multicast Configurator to configure the streaming event. The Multicast Configurator generates a Publisher Stream Name that you’ll use to publish a stream from Flash Media Live Encoder. The Multicast Configurator also generates an F4M (Flash Manifest) file that you’ll use to play the stream in the Multicast Player.

to generate a stream name and a manifest file for the Multicast Player

  1. Open the following URL in a web browser:

    http://public-dns/multicast/configurator/configurator.html

    For example:

    http://ec2-174-129-151-131.compute-1.amazonaws.com/multicast/configurator/configurator.html

  2. Select Peer to Peer multicast.

    Adobe Media Server on Amazon Web Services does not support Fusion or IP Multicast.

  3. Enter the server name (or IP address) and the full path to the multicast application:

    rtmfp://public-dns/multicast

  4. Enter the name of the live stream. This tutorial uses livestream.

  5. Enter a publish password.

    The password ensures that only the multicast server can publish a multicast stream into the group. Other peers do not have the publish password and can only play the stream, not publish a stream.

  6. Enter a name for the group. This tutorial uses the default name, ams.multicast.example.

    You can leave Make Unique unchecked.

  7. Click Generate. The Multicast Configurator generates the following:

    • A name for the live stream. To publish a stream, you’ll click Copy and paste this value into the Flash Media Live Encoder Stream field.

    • An F4M file to use with the client multicast player. To view the F4M file, click View Manifest File.

  8. Click Save Manifest File and do the following:

    1. Save the manifest.f4m file to your local computer.

    2. Copy the manifest.f4m file from your local computer to the following location:

      /mnt/webroot/multicast/multicastplayer/

      Using WinSCP to copy the manifest.f4m file to the instance

Publish a stream from Flash Media Live Encoder

  1. Launch Flash Media Live Encoder 3.1 or later and do the following:

  2. From the Preset menu, select a single stream preset. The multicast solution does not support multi-bitrate (also called “adaptive” and “dynamic”) streaming.

  3. For AMS URL, enter the URL of the multicast service:

    rtmp://public-dns/multicast

    Note:

    Flash Media Live Encoder connects to Adobe Media Server over the RTMP protocol, not over the RTMFP protocol.

  4. Return to the Multicast Configurator and click Copy next to the Publisher Stream Name.

  5. In Flash Media Live Encoder, paste the Publisher Stream Name into the Stream text box.

  6. Click Start to connect to the multicast service and start streaming.

    Use Flash Media Live Encoder to capture and encode a live stream

Play a multicast stream

  1. Open the following URL in a web browser:

    http://public-dns/multicast/multicastplayer/multicastplayer.html

    The Adobe Flash Player Settings manager displays a Peer Assisted Networking dialog. Click Allow to allow the peer-to-peer connection.

    Flash Player opens a Peer Assisted Networking dialog before the Multicast Player starts streaming

    The Multicast Player plays the stream that Flash Media Live Encoder is publishing.

    Multicast Player

    Note:

    Multicast streaming requires Flash Player 10.1 and AIR 2.

For more information about the multicast service, see Using the multicast servicein Adobe Media Server Developer’s Guide. In the examples, remember that on Adobe Media Server on Amazon Web Services, the installation directories are different than on other editions of the server. For information about installation directories, see Managing the server. Also, substitute the Public DNS of the Adobe Media Server instance for localhost in the examples.