Did you know you can do live streaming (including iOS and Android/BlackBerry mobile devices) for under $20/month?
Blane Young wrote a great article on Launching an Internet Campus On A Shoestring Budget. The most expensive component of that writeup was $75/month for a video streaming provider.
That got me thinking about how to do it for less.
Download this spreadsheet to estimate your monthly cost (edit the values in green). There’s also a read-only version online.
- There Are Definitely Pros and Cons
- How to Setup Amazon EC2 and Wowza Media Server
- Accessing Your Stream
- Final Words
- More Info
There Are Definitely Pros and Cons
Pros #1: It’s cheaper. Amazon EC2 only charges for what you actually use.
Most streaming media providers charge a fixed monthly rate for a certain amount of storage and bandwidth. For example, Light Cast Media’s Starter plan gives you 5 GB of storage and 100 GB of bandwidth.
If you only use 10 GB of bandwidth, you still pay $75/month whereas Amazon EC2 would only charge you for 10 GB (at a ridiculously cheap 15 cents a gig!).
So the 100 GB you’re getting from Light Cast Media would only cost you $15 with EC2/Wowza!
Pros #2: Lets you use any video player which supports live streaming.
Sexy is not a word I would use to describe video players from streaming media providers. By using EC2 and Wowza you’re free to choose whichever video player you’d like.
JW Player has more (and better looking) skins while Flowplayer gives you more control of what buttons show where.
Cons #1: More technical to setup and manage.
The good news is this post should make the initial setup easier. 😉
Cons #2: No built-in analytics.
Generally streaming media providers provide basic reporting of how many people watched the stream and from where.
Unfortunately, since we’re handing the streaming on our own, there’s no analytics baked in.
But! Both Flowplayer and JW Player provide ways to tie Google Analytics in. So with a bit more setup you can get usable reporting.
Another option would be using a real-time analytics service like Woopra.
Cons #3: It’s not a true content delivery network (CDN).
A CDN takes your live stream and distributes it across it’s network. Generally this is multiple places within the United States and a few overseas locations.
When a viewer connects to your stream they will be delivered the closest stream from within the CDN’s network. This ensures less delay and buffering problems with the video.
With the EC2/Wowza setup there’s only one server so you don’t get the benefits of a CDN.
However, at an entry level Internet Campus most of your users will be watching from near your broadcast location anyway. Since your visitors aren’t as globally scattered this is less of a problem.
Cons #4: Doesn’t support simulated live services.
Simulated live services means you’re not streaming live, but at a set time later on. Let’s say 9 PM EST the day after the service. In a simulated live service, if someone comes at 9:15 PM they would start watching 15 minutes into the service and not at the start.
Out of the box this is not possible. But it is doable with some code mojo.
Perhaps I’ll detail that in another post . . .
How to Setup Amazon EC2 and Wowza Media Server
Do the pros outweigh the cons? If so, let’s get on with how to set things up!
Create an Amazon EC2 Account
Be sure you have a credit card handy and create your Amazon EC2 account.
Activate Your Wowza Subscription
This is $5/month. When you active your subscription you will be charged a pro-rated amount for the first month.
There’s an ubercool Firefox add-on that makes creating/managing Amazon EC2 instances super easy. So if you don’t have Firefox already installed be sure you download and install it.
Install Elasticfox Add-on
Now download/install the Elasticfox add-on. If Firefox asks you to Open or Save the add-on, choose Open and select Firefox as the program to open with.
Create and Start a Wowza Media Server Instance
Once Firefox has restarted we’re going to use Elasticfox to create and start an Amazon EC2 instance with the Wowza Media Server pre-installed and configured.
1. Launch Elasticfox.
Be sure Firefox is running and go to
2. Give Elasticfox permissions to access your Amazon EC2 account.
The first time you run Elasticfox you’ll see this question. Click
Then enter your Account Name (whatever you want to call it) and the Access Key ID/Secret Access Key.
The Access Key ID and Secret Access Key can be found in your Amazon Web Services (AWS) account which you created when you signed up for Amazon EC2.
If you don’t see an Access Key ID listed, click “Create a new Access Key.”
Once you’ve filled this out, click
3. Close and restart Firefox/Elasticfox.
4. Choose the best location to stream from.
Within the Regions dropdown in Elasticfox, choose the region closest to your streaming location.
5. Launch a Wowza Streaming Server instance.
Visit the Wowza EC2 Support page and copy the AMI ID (32-bit option) from the region that corresponds to the one you selected above.
Now click the Images tab within Elasticfox and paste the AMI ID into the text box. This should filter out all images except one.
Right-click the matching image and click
Launch instance(s) of this AMI. On the screen that pops up, click
6. Make the server publicly accessible.
Click on the Security Groups tab in Elasticfox. In the Group Permissions section on the right click the green checkmark icon and mirror the settings in the image below.
7. Make sure things are up and running.
By now your instance should be running (it usually takes a few minutes).
Click on the Instances tab in Elasticfox and ensure the State column says running. Once it does, right-click the instance and select
Copy Public DNS Name to clipboard.
Open a new browser window and visit
PUBLIC_DNS_NAME with the one you just copied.
If everything is configured correctly you should see something similar to this.
Install Flash Media Live Encoder (FMLE)
Head on over to Adobe’s site and download the Flash Media Live Encoder. They make you create an account. Boo!
Configure FMLE and Start Streaming
1. Launch FMLE.
2. Setup a streaming profile.
Mirror the video and audio settings below. Keep in mind your video/audio device will be different depending on your capture card.
Under the video section, click the wrench icon next to H.264. Be sure Profile is set to Baseline and the Level is 3.0 or above. This ensures iOS streaming will work.
Copy the Public DNS Name again from Elasticfox.
In the FMS URL box, type in
PUBLIC_DNS_NAME with the one you just copied. And then specify a stream name (it can be anything, mine happens to be “stream”).
Uncheck “Save to File.”
Save Profile in FMLE and save this profile somewhere on your computer. If the settings get changed, you can go to
Open Profile and have the settings re-populated for you.
3. Start streaming!
Click the giant, green
Start button. 🙂
When you’re done with the service/stream, just click
Stop in FMLE and then right-click the instance in Elasticfox and choose
Terminate. No need to have the instance running when you’re not streaming. This saves you money!
Accessing Your Stream
Flowplayer/JW Player (or similar)
You will need the FMS URL and Stream Name found in FMLE. As an example, let’s test and make sure your stream is working properly.
Copy the following address.
FMS_URL with the values from FMLE.
Now visit that address in your browser. You should see your video playing back. If so, congratulations!
For mobile devices the address will be different (depending on the type of device). You will still need the
STREAM_NAME from FMLE, but instead of the
FMS_URL you will need the Public DNS Name from Elasticfox.
rtsp://PUBLIC_DNS_NAME:1935/live/STREAM_NAME (notice the URL starts with RTSP and not RTMP or HTTP).
I’ve heard rumors Android doesn’t support MP3 audio (only AAC). I’ve also heard direct links don’t work in Android. So you can’t type the RTSP link directly into the browser; you have to create a page with the link and click the link from the browser.
Can anyone confirm or deny these rumors?
Hopefully this guide gets you up and running.
If you have any questions, please give me a holler in the comments! Also, let me know your tweaks/suggestions, if you plan on (or are using) this in a production environment, etc.
Curious to know what the pros and cons are for you . . .