After recording a live stream with Wowza, it was not as simple as I thought to make the recording available for on demand viewing in a way that works for browsers and iOS devices.Â I moved the recording to my S3 bucket and was trying to make it available via CloudFront.
After much trial and error, the solution had two parts:
1. Convert the file from flv to mp4.Â I used AVS Video Editor with custom file settings to get an H.264 file with “mp4 iso v.2”
2. Serve up the file with a jwplayer playlist that contains two sources: an rtmp source from a CloudFront streaming distribution for browsers, and an http source from a CloudFront download distribution for iOS devices.Â Here is some example code:
There are good instructions here about getting going with S3 on EC2.Â I just wanted to let people know that I found s3fs already installed on my Wowza EC2 instance, and in a different location than in that forum thread.
After creating the /etc/passwd-s3fs file, I mounted the bucket with the commands:
- sudo mkdir /mnt/bucket
- sudo /usr/local/bin/s3fs bucket-name /mnt/bucket
After streaming several live events with Livestream and Ustream, the advertisements that they embed have become increasingly intrusive.Â Ustream now inserts video ads into the middle of a webcast, which will result viewers missing parts of the show.
Someone suggested running Wowza Media Server on an Amazon EC2 instance.Â For occasional webcasts, combining the $5/day Wowza license with $0.26 per hour for EC2 and the free Adobe Flash Media Live Encoder (FMLE), and you have a very affordable and powerful system.Â And it’s not too hard to piece together.Â Here’s what you’ll need:
- An audio/video source, obviously.Â This can be as simple as a webcam.Â We already had an s-video switcher and a sound board at the venue, so we used the switcher to choose between a camera, DVD player, and computer (for graphics).Â We combined the s-video and aux outs from the sound board with a Canopus ADVC-110 analog to digital converter.Â That connected to the broadcasting laptop via firewire.
- To send the stream to the media server, you need some software.Â Adobe FMLE works well and is free, and it’s what we used.Â It doesn’t let you do titles or switch between video and graphics, but we did some of that with the s-video switcher.Â If you have $500, you can invest in Wirecast, which I’ve heard very good things about.Â I tried XSplit, but it didn’t like the Canopus device.
- Sign up for EC2 from Amazon Web Services (AWS) and spin up a Wowza instance.Â Amazon offers preconfigured Wowza servers that will do everything you need for simple webcasts.Â There are good instructions here.Â I did notice that I didn’t need to create the security group mentioned in the instructions — Amazon created one automatically for the Wowza server.
- Start streaming from FMLE or your other streaming software to the Wowza server.
- Embed the stream on your web site with a player like JW Player (free for noncommercial use). If you want viewers to be able to use iOS devices, make sure that you configure your stream according to the tips in this thread.Â Here is the code that we used on our web site to enable regular browsers in addition to iOS devices:
Loading the player ...
If you want the Wowza server to automatically record the stream, it’s not difficult to set up a new stream type called “live-record” on the server.Â Just point your streaming software to that, and you’ll have a file in the content directory of the server when you finish the webcast.Â Look here to get started.
I hope this helps someone get started with commercial-free live streaming!
[update: JW Player has some nice instructions on how to use the player with CloudFront.Â But it doesn’t clarify the interaction with playlists…]
I have some flv videos that I need to make available to our staff, and I don’t want to put them on a public site like YouTube.Â I’m new at hosting streaming videos, and didn’t realize that people won’t be able to skip around in the video unless the server supports RTMP streaming or you figure out “PHP fake streaming”.
Then I found that Amazon CloudFront supports RTMP.Â It’s pretty easy to set it up, until I started working with playlists.Â I wanted people to be able to choose between four different videos in a single player.Â It took quite a bit of experimentation to get the configuration parameters correct.Â Here are the steps:
- Sign up for Amazon Simple Storage Service (S3), create a “bucket”, and upload your flv videos.Â Set the permissions on the files to allow everyone to open/download.Â I also created a folder called “videos” to keep things organized.Â Let’s assume that we have “video1.flv” and “video2.flv” in the folder “videos”.Â These files can be accessed with links like
- Get the JW Player and upload the files to your S3 bucket.Â I put them in a folder called “player”.
- Sign up for Amazon Cloudfront from the AWS console and create a Distribution, Delivery Method = Streaming, that points to your S3 bucket.Â Your distribution will have a domain name like s1234567890123.cloudfront.net.
- At this point you can test everything by using the JW Player Setup Wizard.Â Change height and width in “Embed parameters” to match your video.Â Change file in “File properties” to “videos/video1.flv”.Â Change streamer in “External Communication” to “rtmp://s1234567890123.cloudfront.net/cfx/st” (note the added “cfx/st”.Â Now you should be able to click the Update/Preview link and try out your settings.Â The code can be copied into an html file (like “cloudtest.html”), the html uploaded into the player folder, and then you can browse to
for the next test.
The next step is to build a playlist file that will let people choose from several videos.Â The JW Player documentation here shows that you can choose from several XML feed formats.Â I threw a dart at the wall and chose ATOM.Â The only information that I wanted to include was the video title and the URL to the flv file.Â The trick is figuring out what pieces of the RTMP path, file path, and file name go in what places.
Here’s what worked for me.Â The folder and file name go into the playlist file, along with the “provider” type of rtmp:
The Amazon CloudFront RTMP path goes into the player configuration in your html file:
Note some other aspects of the html:Â the height needs to be increased to make room for the playlist.Â Also, the full path to the playlist needs to be specified.
Hopefully this will help you work through the process faster than I did!