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.
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.
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:
FMS URL: rtmp://[Your Elastic IP]/live
This configures the FMLE program to direct the encoded video stream to our EC2 Wowza Server.
Change your audio for streaming to Roku:
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.
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.
- What video resolution is your video team using (NTSC, HD)?
- Are you 4:3 or widescreen 16:9?
- What frame rate are you running at? (29.97 or 30 or ?)
- 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:
Frame Rate: (Set to match your video)
Input Size: (Set to match your video)
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:
Here is an excerpt from the Roku Developer Video Encoding doc:
Bit Rate and Output Size
Finally 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.
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:
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)
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.
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.