Complete Guide to Streaming Live Video to Roku (Part 2)


This is a continuation of Part 1, you can click here to go back to Part 1.

Install Flash Media Live Encoder

We now need to install the Flash Media Live Encoder (Version 3.2 at time of this post). Onto a computer that has a video capture card installed.  I have experience with Viewcast Osprey cards and can vouch for them, and on the higher end side BlackMagic cards.  FMLE will need a properly installed video capture card.  This means, the drivers need to be installed and in the case of cards with multiple input types, you need to verify that the input is correctly configured.  (IE: composite, component, svideo, SDI, etc.)

On to FMLE

Download the FMLE installer from: http://www.adobe.com/products/flashmediaserver/flashmediaencoder/  You will need to create a free account on Adobe’s website.  Once it’s downloaded, install it using the all the defaults.

image

Install Mainconcept AAC Encoder Plugin

Roku will only read H264 video with AAC audio.  so the we will need to enable FMLE to encode audio to AAC. By default, FMLE does not have this capability.  Point your browser to: http://www.mainconcept.com/products/apps-plug-ins/plug-ins-for-adobe/aac-encoder.html and purchase the AAC Encoder.  This is going to cost you $180.00, but it is worth it.  There is a demo version, but it is very painful because it times out quickly!  Just take the plunge and purchase the plugin.

Purchase, Download, Install, Register – This should be very straightforward.  Download the program and enter the registration code you receive via email.

image

Configure FMLE for Roku Streaming

Now for the fun part!  Let’s configure FMLE and send a stream to the cloud.  First, let’s start by firing up the FMLE 3.2 program.  You can find it in your start menu.  Once the program loads you will see the following… Obviously some things will be different based on the video capture card you are using:

image

Configure Output

imageLet’s start by configuring the output.  This is where you will point FMLE to your server instance we launched earlier.  You will want to configure the following options:

FMS URL: rtmp://[Your Elastic IP]/live
Stream: roku

This configures the FMLE program to direct the encoded video stream to our EC2 Wowza Server.

Configure Audio

Change your audio for streaming to Roku:

Format: AAC
Channels: Stereo
Sample Rate: Probably 44100 or 48000
Bit Rate: 128 Kbps
Volume: If you can control it, I would max it out, and then work with your sound team to adjust accordingly.

Configure Video

Video is a little more complicated to configure.  First you need to know some things.  Parts 1-3 you may need to get some advice from your video team / people.  They should know what these settings are.

  1. What video resolution is your video team using (NTSC, HD)?
  2. Are you 4:3 or widescreen 16:9?
  3. What frame rate are you running at? (29.97 or 30 or ?)
  4. How much bandwidth do you have?

We are going to assume that you are running a NTSC (Standard Definition) feed.  If you are 4:3, you input resolution will probably be 640×480, and if you are 16:9, it will probably read 720×480 (or 486).  At any case, you want to set your input to the identical video resolution of your video system.

Time for some settings:

Format: H.264
Frame Rate: (Set to match your video)
Input Size: (Set to match your video)

Now we need to configure some special stuff.  Click the wrench to the right of the format field. image

We need to modify the actual H.264 configuration for Roku. 

According to Roku’s spec, the Roku likes Main and High profile encoded h.264 videos.  So let’s modify to the following:

image

Here is an excerpt from the Roku Developer Video Encoding doc:

image

Bit Rate and Output Size

imageFinally we can setup the actual video output to the roku.  Here is where bandwidth gets really important.  You need to have consistent clean upload bandwidth.  Please note, cable modems may have 10 or 15 mbit of down bandwidth, but rarely have more than 1-5 Mbit of upload capability.  Please understand the nature of your bandwidth.

I would recommend that you set your output to the following:

For WideScreen NTSC Set your Size to 640 x 360 and UNCHECK the Maintain Aspect Ratio
For Normal (4:3: NTSC Set your Size to 640 x 480

The difference comes in the fact that widescreen video in NTSC is packed anamorphically into a frame.  The Roku will not understand that, so you must re-stretch the video before encoding it.  The true actual width of NTSC widescreen video is 854×480.  I have seen some weird artifacting above 640 wide, so you may play, but that’s what I use.

For bandwidth, I would recommend something pretty high… Between 800 and 1200 kbps.

Finally, you can experiment with De-interlace turned on and off.  NTSC Video will naturally be interlaced, which looks great on interlaced devices (TV), but will look ugly on a computer screen.  Since the final output of the Roku is a roku, you can probably just leave this off.

That’s it.. The last step is to press the big pretty image.

 

Remote Access to Encoder

I highly recommend you install and configure some flavor of VNC on your video encoder.  RDP does not work well for remote access to video encoders.  I have had much better success installing VNC, as VNC doesn’t make any changes to video configuration, the way RDP does.  I personally use the paid version from REALVNC: http://www.realvnc.com/  This version is fully supported on all IOS devices, windows, mac, etc…

Modify your App

To add the Live streaming capability to your Roku App, all you need to do is Define the HLS Stream in the XML Files.  I quickly covered this in:

http://chris.kehayias.com/2011/03/28/building-a-roku-app-for-your-church-part-3/

Now you need to plan your XML content.  Basically you need to copy what I have already given you.  There are basically two different types of content.  Live / Streamed or HTTP Pseudo-Streaming.  Startup.xml is used to define each of your main buttons.  If you want to define a Live Service (or Button), you can copy the elements from startup.xml and liveservice2.xml.  You will need to define the actual streaming URL, and also set the Stream Format to HLS.   (Note for Live Streaming or Streaming at all, you MUST use cupertino streaming…See Wowza for more details)

<streamFormat>hls</streamFormat>
<streamUrl>
http://streaming7.calvaryccm.com:1935/live/smil:roku.smil/playlist.m3u8</streamUrl>

It should be that easy.  If you get stuck, go back and review my series on building a Roku App.  You can even download a copy of our app that has the live stream already defined.

Don’t forget to Shut it Down!

This is probably one of the most important points in all of this!  Don’t forget the service is over to shut it down!  The quickest and easiest way (at this point) is to log back into EC2 and shutdown your server by right clicking and choosing terminate.

image

Remember that every second the Wowza server is running, you are paying for it.  Don’t worry, it’s not that expensive, but it can be if left running 24 hours a day. 

, , , ,

  1. #1 by brock on November 29, 2011 - 7:52 pm

    Where do you download the copy of app?

  2. #3 by Barry Murphy on July 7, 2012 - 11:06 pm

    Hi,

    I’ve got a set of webcams I’d like to stream live in roku, the webcams are RTSP (rtsp://120.136.2.253:554/live/ch00_0) but I also have a RTMP server (flussonic) which connects back to this RTSP so the stream can be re-distrubuted without putting load on the camera direcly. How can I get these into my roku?

    I’ve tried using
    rtsp://120.136.2.253:554/live/ch00_0

    And also the rtmp url with no luck. Would appreciate any help.

    Thanks
    Barry

    • #4 by Chris Kehayias on July 8, 2012 - 9:42 am

      You will need a software component that can translate RTSP / RTMP to HLS. The roku doesn’t read RTMP natively. Instead Wowza Server translates or CHUNKS the rtmp/rtsp stream into HLS chunks that then delivered to the ROKU. You don’t have to use Wowza, but your will need something to get your video into HLS.

  3. #5 by Trevor on July 12, 2012 - 1:29 pm

    Is there a way to terminate an EC2 server without deleting it? I hate that I have to start from scratch every time if I don’t want to pay while it’s idle.

    • #6 by Chris Kehayias on July 12, 2012 - 9:10 pm

      Yes, there are several articles to EBS back an EC2 instance. We don’t do that however. All of our Wowza instances are launched and built completely by scripts. This means that all our instances are always fresh and easily updated to newer versions of the Wowza on EC2.

  4. #7 by Vistronic on March 13, 2013 - 12:11 pm

    Thanks for posting this.
    What are the monthly bills with this?

    • #8 by Chris Kehayias on March 13, 2013 - 12:31 pm

      It will vary based on usage and bitrate. Most of what you pay for on Amazon is the bandwidth usage! The actual Wowza instance will cost between 15 and 86 cents per hour based on size and then bandwidth fees apply.

      I would guess it would cost between $100 -$500 per month based on usage. We are on the upper end of the price scale. We are streaming to over 1500 clients per week at over 1Mbit / second.

  5. #9 by Andrew on August 1, 2013 - 5:43 am

    Dear Sir / Madam,

    I am working on a project for our Church to stream our channel on cable TV to Roku.

    Is that possible using this DLNA (http://www.hdhomerun.com/dlna/) device through the method you used above?

    Thank you.

    • #10 by Chris Kehayias on August 1, 2013 - 8:10 am

      I quickly reviewed the device you posted about. I believe the best answer to be maybe. It would require several things to be in place. (1) you would want ensure there is no copyright problem. I know you probably own the content, but make sure there is no small print between you and the cable channel that could become a liability. (2) You would need something in the middle, like Wowza Server or some other media server that could grab the H264 stream from this device and then make it available to the Roku Unit.

      I bet it’s possible, but it would take some research and testing to be sure.

      • #11 by Andrew on August 1, 2013 - 8:16 am

        Hi, Thanks for your prompt reply. We are the content providers ourselves, so we definately do not have any copyright issues.

        My idea was as follows – Digital Set top box => DLNA => Amazon EC2 / Wowza => Roku Channel => Roku

        Unfortunately we didn’t find much literature and buying equipment just for testing and not working would be a waste of the beneficiaries money.

        How much will it cost us to stream 5MBPS for around 500 followers per hour using Amazon E2?

        Thanks.

(will not be published)