Live Streaming with Wowza and Instant Roku Channel

Wowza is a media server that provides live and on-demand video streams for web sites, Roku players, and other streaming devices. This walk-through is intended to provide a quick introduction to live streaming using Wowza and Instant Roku Channel. It will cover setting up Wowza Media Server on Amazon EC2 ("Elastic Compute Cloud") to provide a live single-bitrate stream to be displayed within a Roku channel. Adobe Flash Media Live Encoder will be used to encode and transmit the stream to Wowza. Advanced details such as multi-bitrate streams and transcoding will not be covered.

Wowza EC2 Roku Diagram

Prerequisites:

  • An Instant Roku Channel account with a private channel installed on a Roku player for testing. (See this tutorial if you don't have a private test channel installed yet.)
  • An Amazon AWS account.
  • A capture device such as a video camera or webcam installed on a Mac or Windows-based encoding workstation or laptop. Video and audio signals are both required for input to the encoder.

Cost:

  • Instant Roku Channel account: Free
  • Adobe Flash Media Live Encoder: Free
    (Wirecast can be used instead of Adobe Flash Media Live Encoder)
  • Wowza DevPay License: $5.00 per month plus $0.15 per hour (typical) while running
  • MainConcept AAC Encoder Plug-in: $180 (one-time purchase, Windows only, not needed for Mac)
  • HLS streamed out from Amazon to Roku players: $0.12 per Gigabyte
  • Flash streamed in to Amazon Wowza instance: $0.05 per Gigabyte

Adobe Flash Media Live Encoder (FMLE)

  1. Browse to www.adobe.com/go/fme.
  2. Download Flash Media Live Encoder (Mac or Windows) to your encoding workstation or laptop. FMLE is free, but you may be required to register your email address before downloading it.
  3. Install FMLE and test with your video capture device.
  4. Do not click Start or Connect yet. We will complete the connection to the Flash Media Server and start the encoder at a later step.
  5. Be sure to review Adobe's EULA for any streaming restrictions.

Wowza Configuration File

Instant Roku Channel provides a customized Wowza configuration file named ircwowza.zip that is specifically tuned for use with Roku players. This file will be used when launching the Amazon EC2 Wowza server instance. The ircwowza.zip configuration file is a compressed archive that contains several different files and directories that are expanded and copied into the Wowza server as part of the EC2 launch process. If no configuration file is provided when launching the EC2 instance, the Wowza server will use a built-in default configuration.

What's inside the ircwowza.zip file?

The ircwowza.zip configuration file from Instant Roku Channel has the following differences from the built-in default Wowza configuration:

  • Only the "live" and "vod" applications are present, all other applications have been removed.
  • PublishMethod in Application.xml is changed from "none" to "digest".
  • Application.xml also has the following additions:
    <Root>
      <Application>
        <LiveStreamPacketizer>
          <Properties>
            <Property>
              <Name>cupertinoChunkDurationTarget</Name>
              <Value>10000</Value>
              <Type>Integer</Type>
            </Property>
            <Property>
              <Name>cupertinoMaxChunkCount</Name>
              <Value>16</Value>
              <Type>Integer</Type>
            </Property>
            <Property>
              <Name>cupertinoPlaylistChunkCount</Name>
              <Value>8</Value>
              <Type>Integer</Type>
            </Property>
            <Property>
              <Name>cupertinoRepeaterChunkCount</Name>
              <Value>8</Value>
              <Type>Integer</Type>
            </Property>
          </Properties>
        </LiveStreamPacketizer>
        <Modules>
          <Module>
            <Name>ModuleRTMPAuthenticate</Name>
            <Description>ModuleRTMPAuthenticate</Description>
            <Class>com.wowza.wms.security.ModuleRTMPAuthenticate</Class>
          </Module>
        </Modules>
      </Application>
    </Root>

Download the customized Wowza configuration file from this link: ircwowza.zip. Save the file on your laptop or workstation so that it can be used in the next section when the EC2 Wowza instance is launched.

The zip file does not need to be unzipped or unarchived because the Wowza instance requires that the configuration information be provided to it as a zip file.

Amazon EC2 Wowza Instance

The following steps will configure and launch an Amazon EC2 instance of the Wowza Media Server. Some of the configuration settings (Wowza License and AWS Security Group) will be saved within your AWS account so that the next time you launch a Wowza instance several of the steps can be skipped.

  1. Browse to http://www.wowza.com/ec2. and follow the directions to purchase a DevPay License. Sometimes this is also referred to as an Embedded License.

    The price of the Wowza DevPay License will be $5.00 per month, but your initial charge may be less than $5.00 due to monthly prorating.

    Important: DO NOT purchase a Regular Wowza License unless you have finished testing and are ready to use Wowza full-time in a production environment. You will also need to install the Regular Wowza License key into the Wowza server instance which is not covered in this introductory guide. This walk-through only covers the use of Wowza DevPay License.

  2. After you have purchased the Wowza DevPay License, browse to http://www.wowza.com/forums/content.php?23 and locate the DevPay licensing AMI ID for the US-East location. This is an identifier for an "Amazon Machine Instance" that will be needed to start the correct Wowza version on EC2. An AMI in a different location may also be used, but the hourly costs may be higher. AMIs for Amazon's US-East location are generally the least expensive.

    Be sure to choose an AMI ID from the DevPay licensing table and not the LicKey table. The DevPay AMIs may also be referred to as "Embedded License" AMIs. The LicKey AMIs are the "Regular Wowza License" AMIs and will not be covered in this walk-through.

  3. Record the AMI ID (for example ami-3e79db57), you will need it in a later step.
  4. Log into your Amazon AWS account and enter the EC2 section.
  5. Click the Security Groups link from the left-side Navigation panel.
  6. Click the Create Security Group button near the top of the page.

    Provide a Name and Description, for example "Wowza" and "Wowza Security Group", then click Yes, Create

  7. Under the Inbound tab near the bottom of the page, enter 80 into the Port Range box, then click the Add Rule button.

    This rule will allow Roku players to connect to the Wowza server to download the live stream.

  8. Again, under the Inbound tab near the bottom of the page, enter 1935 into the Port Range box, then click the Add Rule button.

    This rule will allow your encoding workstation or laptop to connect to the Wowza server to upload the live stream.

  9. Click the Apply Rule Changes button to save the two new rules.
  10. Click the AMIs link from the left-side Navigation panel.
  11. Paste the AMI ID that you saved earlier into the search box in the center of the page.
  12. Change Viewing from Owned By Me to All Images.
  13. After a minute or two the Wowza AMI that corresponds to the AMI ID you provided will be displayed. Right click anywhere on the row containing the new Wowza AMI information and select Launch Instance.
  14. The Request Instances Wizard is displayed.

    Verify that the Instance Type is set to small.

    Click the Continue button.

  15. The Advanced Instance Options panel is displayed.

    Under User Data select as file.

    Click the Browse button to locate and select the ircwowza.zip file that you previously downloaded.

    Click the Continue button.

  16. The Storage Device Configuration panel is displayed

    Click the Continue button.

  17. The Key - Value panel is displayed.

    Directly beneath Value, enter a name for the instance, for example "Wowza".

    Click the Continue button.

  18. The Create Key Pair panel is displayed.

    Select Proceed without a Key Pair

    Click the Continue button.

  19. The Configure Firewall panel is displayed.

    Select the Security Group that you just created.

    Click the Continue button.

  20. The Review panel is displayed.

    Click the Launch button.

  21. Click the Close button.
  22. Click the Instances link from the left-side Navigation panel.
  23. Record the Instance ID (for example i-1234abcd) for the newly launched Wowza instance, this will be used as a password in a later step.
  24. Record the Public DNS value (for example ec2-10-20-30-40.compute-1.amazonaws.com) for the newly launched Wowza instance, this will be used to connect to the Wowza instance in a later step.

  25. After the AWS Instances page shows that the new Wowza instance is running, you can verify that the Wowza server is operating correctly by using this Test page.

    On the Test page change the contents of the Server box to:

        rtmp://address/vod

    substituting the Public DNS value previously saved in place of address.

    Click the Play button. If the Wowza instance is running an animated video will play. The animated video is stored within the Wowza instance. It is not a live stream, but it verifies that the Wowza instance is functional.

  26. Important: Because your Wowza server instance is now running, your Amazon AWS account is being billed for $0.15 every hour, whether or not you are streaming anything. Make sure that you terminate the Wowza instance (right click, select Terminate) when you are done with this walk-through in order to avoid unnecessary charges to your AWS account. Your AWS account will continue to be billed $5.00 per month for the Wowza license.

    You can view or cancel your Wowza license by logging in to your AWS Account Page and clicking View Paid AMI Activity in the Amazon Elastic Computer Cloud section.

MainConcept AAC Encoder

In order to be compatible with Roku players the live stream must have it's audio encoded as AAC instead of the encoder default of MP3. If you installed Flash Media Live Encoder (FMLE) on a Mac encoding workstation or laptop then you already have an AAC encoder available as part of the Mac OS, and AAC is available as an FMLE Audio Format option. If you installed FMLE on a Windows encoding workstation or laptop then you will need to purchase an AAC plug-in for FMLE because Windows does not include a built-in AAC encoder.

Windows-based systems without the AAC encoder plug-in installed will only have MP3 available as an Audio Format option. The cost for the encoder plug-in that adds the Audio Format AAC option is $180. Without AAC encoding live streams may not play at all on Roku2 players and earlier Roku players may have long buffering times and no audio.

Skip the following steps if you are using a Mac-based encoding workstation or laptop.

  1. Browse to www.mainconcept.com and click on the APPS & PLUG-INS button.
  2. Locate and click on the AAC ENCODER button.
  3. Click the BUY NOW button to purchase the AAC Encoder plug-in.
  4. Follow the on-screen directions to complete payment and download the plug-in.
  5. After payment is complete you will be provided with a registration code. The code will be used during the plug-in installation process to activate it. Without the registration code the AAC Encoder plug-in will only function for 30 seconds.
  6. Click on the AAC Encoder installation executable and follow the on-screen instructions, replacing the default DEMO registration code with the code that was just purchased.
  7. After the AAC Encoder installation is complete, restart Flash Media Live Encoder and verify that AAC is available as an Audio Format option.

Flash Media Live Encoder

As shown in the diagram at the top of this page, the encoder will be used to convert video and audio signals from a camera or webcam into a Flash stream suitable to be sent to the Wowza EC2 instance.

  1. Start up Adobe Flash Media Live Encoder on your workstation or laptop.
  2. Configure the video input:

    • Make sure that the Video checkbox is checked.
    • Device: Usually a camera or webcam
    • Format: H264
    • Frame Rate: 29.97
    • Input Size: Image input size, varies depending on camera or webcam driver
    • Bit Rate: Channel bandwidth, try not to exceed the upstream Internet bandwidth
  3. Configure the audio input:

    • Make sure that the Audio checkbox is checked.
    • Device: Usually the microphone built into the camera or webcam
    • Format: AAC
    • Channels: Stereo
    • Sample Rate: 44100
    • Bit Rate: 96
    • Volume: Reduce to avoid feedback if testing with the camera and Roku player in the same room
  4. Configure the Flash Media Server connection:

    • Make sure that the Stream to Flash Media Server checkbox is checked.
    • Enter the FMS URL as rtmp://address/live, substituting the Public DNS value previously saved in place of address.
    • Enter irc as the name of the Stream. This can be changed to something else later, and is used to distinguish between multiple streams being provided by the same Wowza instance.
    • Click the Connect button.

    • If a Wowza instance is found the Connect to FMS panel is displayed.

      If the Connect to FMS panel is not displayed, check that the Public DNS value is correct, and re-verify that the Wowza instance is running.

      Enter wowza as the Username.

      Enter the previously saved Wowza Instance ID as the password.

      Click OK.

    • Click the large green Start button.

The encoder is now streaming live video to the Wowza server instance.

Edit the Roku Channel

Add a live stream program to the test Roku channel:

  1. Log into your Instant Roku Channel account.
  2. From the menu along the left side of the page, select Channels.
  3. Select a channel to add the live program to, or create a new channel.
  4. From the menu along the left side of the page, select Content.
  5. Right-click on any folder in the content tree in the upper-left window and add a New Video or Audio item.
  6. In the lower window, locate the Live Program Parameter and change it to True.
  7. In the lower window, locate the Stream 1 - URL Program Parameter and change it to

        http://address/live/irc/playlist.m3u8

    substituting the Public DNS value previously saved in place of address.

  8. In the lower window, locate the Stream 1 - Bitrate Program Parameter and change it to a value that is slightly less than the Total bandwidth required to stream as shown in the encoder. This value is specified in Kilobits per Seconds (Kbps) and will typically be in the range of 200 to 5000.
  9. In the lower window, locate the StreamFormat Program Parameter and change it to hls.
  10. Change both the Title and ShortDescriptionLine1 parameters to "Live Stream Test"

Finally!

The live stream is ready to play. Re-start the test channel on a Roku player and select the Live Stream Test program.

Important:

Because your Wowza server instance is now running, your Amazon AWS account is being billed for $0.15 every hour, whether or not you are streaming anything. Make sure that you terminate the Wowza instance when you are done with this walk-through in order to avoid unnecessary charges to your AWS account. Your AWS account will continue to be billed $5.00 per month for the Wowza license.

To terminate the EC2 Wowza instance:

  1. Enter the EC2 section of your Amazon AWS account.
  2. Click the Instances link from the left-side Navigation panel.
  3. Locate and right-click anywhere on row containing the Wowza instance details and select Terminate
  4. Click the Yes, Terminate button.

You can cancel the $5.00 per month Wowza DevPay License by logging in to your AWS Account Page and clicking View Paid AMI Activity in the Amazon Elastic Computer Cloud section.

- o -


Please see this brief tutorial for more information about how to build a Roku channel using Instant Roku Channel.

Questions and comments about this Roku developer walk-through can be forwarded to .

Instant Roku Channel is a cloud-based tool for Roku developers and content providers that shortens development time and eases maintenance after deployment.



Private Channel Code: IRC
Check out Instant Roku Channel by adding our demonstration channel to your Roku player.

Need help with your Roku?

We are unable to provide technical support for your Roku player or address problems with channels not created using Instant Roku Channel.

Please visit www.roku.com for assistance.



Instant Roku Channel is not affiliated with nor endorsed by Roku Inc.