Category Archives: streaming

Creating an on demand version of your Wowza recording for iOS and browser viewing

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:

How to mount an S3 bucket on your EC2 Wowza instance

AWS StorageThere 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

Inexpensive, commercial-free live streams with Wowza and EC2

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:

  1. 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.
  2. 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.
  3. 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.
  4. Start streaming from FMLE or your other streaming software to the Wowza server.
  5. 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!

JW Player, Amazon Cloudfront, and playlists

[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:

  1. 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
    http://s3.amazonaws.com/bucketname/videos/video1.flv
  2. Get the JW Player and upload the files to your S3 bucket.  I put them in a folder called “player”.
  3. 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.
  4. 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
    http://s3.amazonaws.com/bucketname/player/cloudtest.html

    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!