• How to bring your Wowza Streaming Engine license to CloudFront live HTTP streaming

    This article explains how to use Wowza Streaming Engine™ live server software with Amazon CloudFront for live HTTP-based streaming. You can use Wowza Streaming Engine software to create live HTTP-based streaming sessions for global delivery using CloudFront and the following HTTP-based streaming protocols:

    • Apple HTTP Live Streaming (HLS)

    • Adobe HTTP Dynamic Streaming (HDS)

    • Microsoft Smooth Streaming

    • MPEG-DASH

    When a user streams a video using one of the above protocols, the video is broken into smaller chunks that are cached in the CloudFront network for improved performance and scalability.

    This article explains how to integrate Amazon CloudFront with Wowza Streaming Engine running on an Amazon EC2 instance. For more information about how to manage and secure your Amazon EC2 instance, refer to the Amazon EC2 documentation. For more information about Wowza Streaming Engine options not covered in this tutorial, see the Wowza documentation.

    Contents


    Create an Amazon Web Services account
    Create an Amazon EC2 key pair
    Get a license for Wowza Streaming Engine software
    Create an AWS CloudFormation stack for live streaming
    Sign in to Wowza Streaming Engine Manager
    Set up an encoder to publish a live stream
    Play the live stream in a web application
    Delete the AWS CloudFormation stack for live streaming
    More resources

    Create an Amazon Web Services account

    If you already have an AWS account, skip to Create an Amazon EC2 key pair. If you don't already have an AWS account, open http://aws.amazon.com/, click Create a Free Account, and then follow the online instructions.

    Note: Part of the sign-up procedure involves receiving a phone call and entering a PIN using your phone's keypad.

    Create an Amazon EC2 key pair


    If you already have an Amazon EC2 key pair for the Amazon EC2 region in which you want to configure live streaming, skip to Get a license for Wowza Streaming Engine software. If you don't have a key pair in that region, follow the steps in this section.

    Note: A key pair is a security credential, similar to a password, and is specific to an AWS region. You must specify a key pair when you create an AWS CloudFormation stack for live streaming (described later in this article). After live streaming is configured, you use the key pair to securely connect to your Amazon EC2 instance.
    To create an Amazon EC2 key pair

    1. Sign in to the Amazon EC2 console using your AWS account credentials.

    2. In the region selector, click the region in which you want to create the key pair.

      You must create the key pair in the same region where you'll create your AWS CloudFormation stack for live streaming later in this process. You should create the key pair and the stack for live streaming in the region that's closest to the location from which the live stream will be published.

    3. In the left navigation pane, click Key Pairs.

    4. In the key pairs pane, click Create Key Pair.

    5. In the Create Key Pair dialog box, enter a name for the key pair, and make note of the name. You'll need it later when you create an AWS CloudFormation live-streaming stack.

    6. Click Create, and, when prompted, save the .pem file to a safe place on your computer. Note that you won't be able to re-download this file.

    7. Close the Create Key Pair dialog box.

    Get a license for Wowza Streaming Engine software


    You need a license for Wowza Streaming Engine software to use Wowza Streaming Engine live streaming on Amazon CloudFront. You have the following options to get license:

    • Buy a license from Wowza™ for Wowza Streaming Engine software. Go to the Wowza Streaming Engine Pricing page on the Wowza website, and buy the Wowza Streaming Engine license that works best for you.

    • Buy a license by using your AWS account. This happens automatically if you click an applicable link in the next section.

    Create an AWS CloudFormation stack for live streaming


    This section provides links to AWS CloudFormation templates for creating a stack that launches the AWS resources required by live streaming, including an Amazon EC2 instance.

    To create an AWS CloudFormation stack for live streaming

    1. Start the wizard that creates an AWS CloudFormation stack by clicking an applicable link in the following table. Be sure to click a link for the Amazon EC2 region where you want AWS CloudFormation to launch an Amazon EC2 instance.

      Note: The links below launch Wowza Streaming Engine 4.5.0 AMIs with pre-built Amazon EC2 instances that deliver live HTTP streams over the Amazon CloudFront distribution network into the AWS Management Console. See the Wowza Streaming Engine 4.5.0 Release Notes.

      If you're not already signed in to the AWS Management Console, sign in when prompted. The wizard starts, and the selected URL automatically appears under Specify an Amazon S3 template URL.

    2. (Optional) In the Create a New Stack wizard, you can change the stack name to something appropriate for your live-streaming event. The stack name must not contain spaces and must be unique within your AWS account.

      Note: Do NOT change the template options or the address in Specify an Amazon S3 template URL.
    3. Click Next, and then adjust the following Parameters settings on the next page of the wizard:

      • In ApplicationName, enter a short name (without spaces) for your Wowza Streaming Engine application, or keep the default name.

      • In InstanceType, select an instance type, which determines the pricing for your Wowza Streaming Engine instance. For more information about Amazon EC2 instance types, see Available Instance Types. For information about pricing, see Amazon EC2 Pricing.

      • In KeyPair, enter the name of an Amazon EC2 key pair for the region in which you want to create the live streaming stack. The key pair must be associated with the account that you're currently logged on with. If you created a key pair when you performed the procedure in Create an Amazon EC2 key pair, enter that key pair name here.

      • In StartupPackageURL, enter a URL that points to a startup package for configuring Wowza Streaming Engine to your needs, or keep the default.

      • In StreamName, enter a short name (without spaces) for your live stream, or keep the default.

      • In WowzaLicenseKey, enter your license key for the Wowza Streaming Engine software. If you have license keys for the Transcoder, nDVR, or DRM features, you can include them by separating the key values with a pipe (|) character.

        Important: If you clicked a link for an AWS CloudFormation template that charges your AWS account for a Wowza Streaming Engine license, the license is already embedded in the software and the WowzaLicenseKey setting isn't available.
    4. Click Next, and then adjust the following optional settings on the Options page of the wizard:

      • (Optional) Add the key-value pairs for any tags you plan to use. For more information about using tags, see Adding Tags to Your AWS CloudFormation Stack.

      • (Optional) To configure SNS notification, to specify how long you're willing to wait for the stack to be created, to choose whether to roll back changes if stack creation fails, and to enter a stack policy, click Advanced, and adjust settings as desired.

    5. Click Next, and then review the settings for the stack. When you're satisfied, click Create.

    AWS CloudFormation may take several minutes to create the stack. To track stack creation progress, select the stack, and then click the Events tab. If AWS CloudFormation can't create the stack, the Events tab lists error messages.

    When your stack is ready, in the list of stacks, the status for the stack changes to CREATE_COMPLETE.

    When your stack is created, click the Outputs tab to see the stack creation outputs. You'll use these values when you set up an encoder later in the process.

    Important: You begin to incur hourly charges for an Amazon EC2 instance when you create the AWS CloudFormation stack that deploys that instance. Charges continue to accrue until you delete the AWS CloudFormation stack, regardless of whether you use the Amazon EC2 instance to stream live video. When your live event is over, delete the stack that you created for live streaming. This deletes the AWS resources that were created for your live-streaming event, and stops AWS charges for the resources. For more information, see Delete the AWS CloudFormation stack for live streaming.

    Sign in to Wowza Streaming Engine Manager


    After AWS CloudFormation creates the stack, perform the following steps to sign in to Wowza Streaming Engine Manager on the Amazon EC2 instance that you provisioned through AWS CloudFormation:

    1. Sign in to the AWS CloudFormation Management Console using your AWS account credentials.

    2. In the region selector, click the region in which you created the AWS CloudFormation stack.

    3. In the list of stacks, select the stack that you created in Create an AWS CloudFormation stack for live streaming.

    4. On the Outputs tab, get the value of the WowzaServerLoginInfo key, which you'll use for login credentials in the next step.

    5. Click the URL in the WowzaEngineManagerURL key, for example, http://ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com:8088/enginemanager. When you're prompted for login credentials, use the WowzaServerLoginInfo key value from the previous step.

      Important: This URL uses port 8088 to connect to the Amazon EC2 instance that's running Wowza Streaming Engine Manager. Depending on your firewall settings, you might not be able to connect to the Amazon EC2 instance. If you have trouble, contact your network administrator.

    Set up an encoder to publish a live stream


    You need to encode a live stream captured by an encoding device before you send it to Wowza Streaming Engine. The Wowza Streaming Engine software supports integrated publishing for many popular encoders and cameras to simplify live streaming workflows. You can create live application connection settings in Wowza Streaming Engine Manager to enable Wowza GoCoder™ (Wowza's encoding app for Apple iOS and Android mobile devices) and other supported encoders and cameras to publish a stream automatically. For more information about how to configure the integrated publishing options, see Specific Encoding Technologies on our website.

    You can also encode the live stream using other encoders and cameras that support H.264 encoding. The steps for publishing a stream from your encoder or camera to Wowza Streaming Engine vary with your choice of device. For more information, see How to connect a live source to Wowza Streaming Engine on our website or review the documentation for your device.

    For streams that you intend to deliver to iOS-based devices (Apple HLS) be sure to use the following encoding settings:

    • Video:
      • Apple iPhone, iPod, and iPod touch - H.264 Baseline Profile Level 3.0. Don't use B-frames when targeting iPhone and iPod devices.
      • Apple iPad - H.264 Main Profile Level 3.1

    • Audio: AAC-LC up to 48 kHz, stereo audio

    For streams that you intend to deliver to Microsoft Silverlight players (Smooth Streams), your encoding must have both audio and video and the keyframe frequency must be between 1 and 4 seconds (we recommend a keyframe frequency of two seconds).

    Set up Wowza Gocoder

    To configure Wowza GoCoder to publish a live stream, do the following:

    1. Go to the Wowza tutorial How to connect the Wowza GoCoder encoding app to Wowza Streaming Engine.

    2. Follow the procedure in the Connecting the Wowza GoCoder encoding app section of the tutorial.

    3. Change other values as applicable.

    Note: Wowza GoCoder is available for purchase from the Apple App Store or the Google Play store.

    Set up an RTMP encoder

    RTMP encoders typically use the following settings:

    • Publish URL: - This is the value of the AWS CloudFormation PublishRTMPURL key, for example, rtmp://ec2-xx-xx-xxx-xxx.compute-1.amazonaws.com/livecf.

    • Stream Name: - This is the value of the AWS CloudFormation PublishStreamName key, for example, myStream.

    • Login Credentials: - If you're prompted for login credentials, use the values from the AWS CloudFormation WowzaServerLoginInfo key, for example, username=wowza, password=i-1234a567.

    Play the live stream in a web application


    Wowza Media Systems provides online example player webpages that you can use to play a live stream from your Wowza Streaming Engine distribution. These players can help you verify that your streaming stack is set up correctly. You can use the same streaming manifest URLs for other players that support the streaming protocol you want to use.

    Perform the applicable procedure below to get embed code that you can include in your webpage for the live stream:

    Note: Wait at least 30 seconds after you perform the applicable procedure in Set up an encoder to publish a live stream before following the steps below to play the stream.
    To play your live HDS stream on Adobe Flash Player via CloudFront
    To play your live HLS stream on an Apple or other device via CloudFront
    To play your Live Smooth Stream via CloudFront
    To play your Live DASH Stream via CloudFront

    To play your live HDS stream on Adobe Flash Player via CloudFront


    1. Open the AWS CloudFormation Management Console.

    2. Select the stack for live HTTP streaming.

    3. In the AWS CloudFormation console, click the Outputs tab.

    4. Copy the value of the PlaybackHDSURL key, for example, http://d111111abcdef8.cloudfront.net/livecf/myStream/manifest.f4m.

    5. Go to the Flash HTTP Player example webpage, paste the URL that you copied in the previous step into the URL field, and then click Start.

    To play your live HLS stream on an Apple or other device via CloudFront


    1. Open the AWS CloudFormation Management Console.

    2. Select the stack for live HTTP streaming.

    3. In the AWS CloudFormation console, click the Outputs tab.

    4. Copy the value of the PlaybackHLSURL key, for example, http://d111111abcdef8.cloudfront.net/livecf/myStream/playlist.m3u8.

    5. Using one of the following applications, go to the iOS and OS X example webpage, paste the URL that you copied in the previous step into the Stream field, and then click Connect:

      • Safari web browser on a computer running OS X Snow Leopard (version 10.6) or later

      • QuickTime Player 10.x or later on a computer running OS X Snow Leopard (version 10.6) or later

      • Safari web browser on an Apple iOS device

    To play your Live Smooth Stream via CloudFront


    1. Open the AWS CloudFormation Management Console.

    2. Select the stack for live HTTP streaming.

    3. In the AWS CloudFormation console, click the Outputs tab.

    4. Copy the value of the PlaybackSmoothURL key, for example, http://d111111abcdef8.cloudfront.net/livecf/myStream/Manifest.

    5. Go to the Silverlight Player example webpage, paste the URL that you copied in the previous step into the Stream field, and then click Connect.

    To play your Live DASH stream via CloudFront


    1. Open the AWS CloudFormation Management Console.

    2. Select the stack for live HTTP streaming.

    3. In the AWS CloudFormation console, click the Outputs tab.

    4. Copy the value of the PlaybackDASHURL key, for example, http://d111111abcdef8.cloudfront.net/livecf/myStream/manifest.mpd.

    5. Go to the MPEG-DASH Player example webpage, paste the URL that you copied in the previous step into the Stream field, and then click Start.

      Note: Open the MPEG-DASH Player example webpage in a browser that supports the MediaSource API, such as Google Chrome.

    Delete the AWS CloudFormation stack for live streaming


    When your live event is over, use the following procedure to delete the stack that you created for live streaming. This deletes the AWS resources that were created for your live-streaming event and stops the on-demand charges for the resources.

    1. Open the AWS CloudFormation Management Console.

    2. In the upper-right corner, click the region in which you created your stack.

    3. Select the stack, and then click Actions > Delete Stack.

    4. Click Yes, Delete to confirm.

    5. To track the stack deletion progress, select the stack, and then click the Events tab.

    More resources


    The following resources might assist you as you work to integrate your Wowza media server software with Amazon CloudFront.

    Wowza Documentation

    Our website includes articles, documentation, and pricing information for delivering live streams with Wowza Streaming Engine software and Amazon Web Services:


    Amazon Web Services Documentation

    The following resources include user guides and reference works for Amazon Web Services:


    Originally Published: 09-10-2013.
    Updated: For Wowza Streaming Engine 4.5.0 on 08-04-2015.

    If you're having problems or want to discuss this article, post in our forum.