Wowza

Streaming on Amazon’s “SuperQuad”

1

I posted recently about using Amazon EC2′s cluster compute instances for big streaming projects. That post got me a call from a client in Texas who was planning to stream a big tennis tournament in Dallas and needed a server backend that could handle it, without going through the hassle and expense of setting up a CDN account for a single event. Of course, since everything is bigger in Texas, they wanted to stream to a large audience. They also wanted to be able to send a single high-definition stream for each of the two tournament courts, and then transcode down to a few different bandwidth-friendly bitrates. This called for not only big network horsepower, but big CPU horsepower as well.

I fired up the superquad (cc1.4xlarge), installed Wowza and the subscription license on it (Wowza pre-built AMIs do not exist for this instance type), and tuned it. I then created the transcoder profiles to create a 480p, 360p, 240p, and 160p stream, and we tested. Note that when installing Wowza yourself on an EC2 image, you don’t have access to the EC2-specific variables and classes out of the box. You’ll need to add the EC2 jar file that can be found on one of Amazon’s prebuilt AMIs. In this case, that wasn’t a factor, as I simply hardcoded the server’s public DNS name into any place that needed it.

Once the tournament started, we were seeing big audience numbers, with bitrates on the box well in excess of 1Gbps. On day two, audiences started complaining about spotty stream performance, and some were running 15 minutes behind live.

After jumping into the logs, it became apparent that this 8-core/16-thread monster was starved for CPU resources! Wowza recommends that a transcoder system not exceed 50-55% CPU. We then reduced the number of transcode streams to two (480p and 360p). In the process, I discovered that a misformatted search/replace had altered the configuration to transcode all the streams to 1280×720, at extremely low bitrates. No wonder the poor thing was dying. Once we got everything fixed, a full audience with both courts going was clocking in around 40% CPU. At no time in the process did Java heap memory exceed 3GB (in the tuning, I allowed it up to 8GB, the max recommended by Wowza). Wowza seems to be exceedingly efficient with its memory usage. If you need to run heavier transcoding loads, you may want to look at what I call the “super-duper-octopus” (cc1.8xlarge), which is about double what this one is.

CPU Usage - Note 2/7 when we were having trouble

Early Thursday, I checked the AWS usage stats for the month, and my jaw dropped. In three days of streaming, we’d clocked over five TERABYTES of data transfer. I expect I’ll bump into the next bandwidth tier (or come very close) by the end of the week. That’s what happens when you average around 1Gbps for the better part of 12 hours a day!

Network Usage (Bytes/Minute.. What the heck, Amazon?)

As for server usage, this instance type runs about the price of two extra-large instances (each capable of about 450Mbps), and doesn’t even break a sweat at those transfer rates. Had I parked this service on a VPS at another hosting provider, I would have blown through the monthly data cap by mid-Tuesday, and likely not had access to a 10GB pipe on the server.  Meanwhile, when you start cranking terabytes of data, that cost per gigabyte is a major factor. When you crank out 10TB of data, every penny per gigabyte adds $100 to the bandwidth tab.

Although a large portion of the audience for this event was in Europe (at one point, 60% of the audience was coming from Lithuania!), the cluster instances are currently only available in the us-east (Virginia) region. If performance for European users had gotten problematic, I could have set up a repeater in Amazon’s datacenter in Ireland. As it was, there were no complaints.

So that’s how a superquad works for large streaming events. If you want some help setting one up, or just want to rent mine for your event, drop me a line.

Go big, or go home!

7

I’m currently working on setting up Wowza on an EC2 “Cluster Compute Quadruple Extra Large” instance (or as I’ve heard it called, the “super-duper-quadruple”, which sounds like something I’d get at Five Guys). There’s no pre-built AMI for this one, so you have to use a stock Linux image (I use the standard Amazon one) and install Wowza with a subscription license, and do the tuning yourself. But the payoff is this: for $1.30 an hour, you get a streaming server capable of delivering 10Gbps of data.  On a 750Kbps stream, that’s over 13,000 concurrent clients. This for about the same cost as nine or ten m1.small instances which can deliver an aggregate of about 1.5Gbps. On a reserved instance, you can get this down to just under 75 cents an hour.

In addition to Ludicrous Speed on the network I/O, this instance comes with 8 multithreaded Xeon 5570 cores (at 2.97GHz), 23 GB of RAM, and 1.7TB of local storage. (a quick speed test downloaded a half-gigabyte file in about four seconds, limited by the gigabit interface at the remote server). This is roughly equivalent to a moderately configured Dell R710. There’s also a GPU-enabled version of this that adds a pair of nVidia Tesla GPU cores.

If that’s not enough, you can go bigger, with 16 cores, 60GB of memory, and 3.5TB, Recently, someone clustered just over a thousand of these instances into the 42nd largest supercomputer in the world.

As of right now, these monster instances are only available in the us-east-1 zone.

 

 

New Wowza 3 Startup Packages

0

Wowza has just updated its repository of startup packages to include pacakges specific to version 3. Get them here:

http://wowzamediasystems.s3.amazonaws.com/packagelist.html

Stupid CSS Tricks: Wowza Load Graphs

0

I’ve been experimenting with ways to generate load graphs for Wowza. The best way for doing bar graphs on a webpage is to go all crazy with CSS. It’s really well suited to doing this. Here’s a PHP script that will query a Wowza origin server for its repeaters, and then polls the repeaters for their load stats. This also provides buttons for launching/terminating repeaters, and visually representing them as a rack full of servers:

(more…)

Wowza Architecture Diagrams

0

I’ve posted a couple of diagrams of Wowza’s architecture relating to repeaters and load balancing.

There’s also some additional information in the Wowza Media Server 3 Overview.

 

Wowza Media Server V3 for Amazon EC2

0

Wowza V3 pre-built AMIs are now available – The devpay licensing remains, as does the pricing. The new AMI listing can be found at the Wowza V3 for EC2 page. Wowza has also added pre-built AMIs for subscription licenses, which are priced at standard instance rates. The caveat is that on devpay, the premium add-on modules won’t be available – if all you’re doing is what you were doing on V2, that won’t change anything for you.

The license key instances can also be used as a basis for your own custom images. License key can either be manually changed or included in your startup packages.

Wowza V3 Costs for churches

4

In my previous post, I mentioned that Wowza’s licensing is changing for EC2-based instances. Naturally, this is going to have an effect on how much it costs. I’m going to break down the numbers for a typical church scenario.

The assumptions I’m going to make are based on usage patterns for Resurrection Online:

  • 1 full-time server
  • 2 services on Sunday, approx. 2 hours each,
  • 2 repeaters per service
  • 1000GB traffic/month
  • US-East zone

Under the current V2 scenario with DevPay, you have the following costs:

  • Full-time instance: 720 hours @ 0.15/hr : $108
  • Repeaters: 32 hours @ 0.15/hr : $4.80
  • Traffic: 1000GB @ $0.15/GB: $150.00
  • Wowza AMI Access: $5

Total: $267.80/month

Under V3, it looks like this:

  • Full-time instance: 720 hours @ $0.085/hr : $61.20
  • Monthly Wowza License: $55
  • Monthly nDVR Add-On License: $20
  • Repeaters: 32 hours @ $0.085/hr: $2.72
  • Daily Wowza License @ $5/day/repeater: $40
  • Daily nDVR License @ $2/day/repeater: $16
  • Traffic: 1000GB @ $0.12/GB: $120.00

Total: $278.92 ($314.92 with nDVR)

Pretty close… But because V3 is no longer tied to DevPay, you have the freedom of using reserved instances. I’ll assume you won’t do a reserved instance for the repeaters.

  • Full-time instance: 720 hours @ $0.03/hr : $21.60
  • Monthly Wowza License: $55
  • Monthly nDVR License: $20
  • Repeaters: 32 hours @ $0.085/hr: $2.72
  • Daily Wowza License @ $5/day/repeater: $40
  • Daily nDVR License @ $2/day/repeater: $16
  • nDVR License:
  • Traffic: 1000GB @ $0.12/GB: $120.00

Subtotal: $239.32 ($273.92 with nDVR)

  • Reserved instance fee – 1 year: $227.50 ($18.96/month) : $ 258.28
  • Reserved instance fee – 3 years : $350 ($9.72/month) : $249.04

Additional repeaters will set you back about $6/day extra ($8 with nDVR)

Summary:

  • V2: 267.80/month
  • V3: 278.92/month
  • V3 (1 year reserved): 258.28/month
  • V3 (3 year reserved): 249.04/month
  • nDVR on V3 will add $36/month

As you can see, the economics of this have been turned on their ear – now, instead of multiple small servers being the most cost-effective method of doing repeaters, it now makes sense to spin up one or two considerably larger instances for a couple of hours. If each small costs you $5.16  for two hours, and gains you 150Mbps, it looks a lot better to supersize your instance for about 9 bucks for two hours and get several gigabits out of it. When the folks at Wowza get done benchmarking the EC2 instances with V3, I’ll post another entry.

 

Hot off the presses: Wowza Media Server Version 3

0

** UPDATED INFORMATION : 6 November 2011 **

After many months of hard work, the team at Wowza put the finishing touches on the latest major release of Wowza Media Server. The new version adds a couple of key features in the form of licensed add-ons:

  • Network DVR:
    • Wowza nDVR AddOn (Beta release) is an innovative live stream cache that stores content in a normalized format accessible to Wowza Media Server 3 for any-screen HTTP playout. Compared to client-specific nDVR implementations, Wowza nDVR significantly reduces cost by minimizing network storage requirements and simplifying the delivery workflow for all screens. Wowza nDVR enables Wowza licensees to increase revenues and viewer engagement by delivering live linear streams as time-shifted services with features like live pause, rewind, and resume.
  • Live Transcoding:
    • Wowza Transcoder AddOn takes advantage of the same hardware as the server to transform incoming live streams from encoders, IP cameras, IPTV headends, and other live sources into multiple stream sets ‘done right’ for H.264-everywhere adaptive bitrate delivery. Adaptive bitrate streaming is supported for Flash RTMP and HTTP Dynamic Streaming, Apple HLS, and Silverlight Smooth Streaming. Wowza Transcoder also delivers non-adaptive streams over any transport protocol supported by Wowza Media Server 3, including RTMP, RTSP/RTP, MPEG-TS, and HTTP.
  • DRM Integration
    • Wowza DRM AddOn provides simultaneous secure key exchange with multiple DRM platforms such as Verimatrix VCAS and Microsoft PlayReady. Individual live or on-demand content is encrypted on-the-fly for HLS and Silverlight delivery to viewers on a wide range of devices including set-top boxes (STBs), connected TVs, smartphones and tablets. Wowza DRM AddOn can help users up-sell content for OTT premium services, and cross-sell content for multi-device distribution.

The other key feature is a change in the subscription license model, adding a daily license in addition to the monthly license. The subscription licenses are allowed to be used on Amazon’s EC2 cloud. The monthly subscription license has also seen a price reduction (there are also tiered price breaks on the monthly subscription). The subscription license is based on the number of instances you start during a given day or month. This is likely to be the new licensing model for EC2, moving away from Amazon’s DevPay model which required a monthly subscription as well as limiting instances to S3-backed images that couldn’t take advantage of Amazon’s reserved instances. By using a subscription license, you still get the scalability of the Amazon cloud, but the flexibility of using an instance type and OS that works for you. As of the release this week, there are no pre-built EC2 images for Wowza V3, but they’re coming soon. Wowza Media Server V3 Overview (PDF) Wowza Media Server V3 User’s Guide (PDF) Wowza Media Server V3 Pricing Wowza Media Server V3 Add-Ons

Grabbing thumbnails from Wowza

0

Here’s a quick and dirty way to grab a thumbnail from a Wowza application:

rtmpdump -v -B 0.01 -r rtmp://wowza.server/application/stream -o temp.flv
ffmpeg -i temp.flv -vframes 1 -s qvga /var/www/frame.jpg

There’s also a way to do it with a Wowza module, but it’s considerably more complex and not for the faint of Java.

Caveat: This likely won’t work if you have hotlink denial turned on on your stream.

 

Browser-aware player code, revisited

0

I posted a while back about selecting video players based on browsers… It was an ugly javascript hack, and since then LongTail has updated their excellent JWPlayer to support multiple methods. In order to create an embed that worked best for supporting both HTML5 and Flash players, I had to dig through the documentation a little bit, and combine a couple of different sections.

Here’s how to embed JWPlayer 5.7 to try flash first, with multiple bitrates, and then attempt HTML5 if Flash is not supported. This particular scenario is for iOS support.

<script type="text/javascript" src="jwplayer.js"></script>

<div id="container">Loading the player ...</div>

<script type="text/javascript">
        jwplayer("container").setup({
                height: 360,
                width: 480,
                image: "http://server.com/images/thumbnail.jpg",
                skin: "bekle.zip",
                modes: [
                        {
                        type: "flash",
                        src: "player.swf",
                        config: {
                                levels: [
                                        { bitrate: 250, file: "playlist-low", width: 320 },
                                        { bitrate: 500, file: "playlist-high", width: 480 }
                                        ],
                                streamer: "rtmp://streamer.com:1935/live",
                                provider: "rtmp"
                                }
                        },
                        {
                        type: "html5",
                        config: {
                                file: "http://streamer.com/live/ipad.smil/playlist.m3u8"
                                }
                        } ]
                }
        );
</script>

This still doesn’t support RTSP and other HTML5  fallbacks due to limitations in JWPlayer, so if you’re on a BlackBerry, you’ll still need to switch the player. The order that the “type” statements appear in the javascript determines the order in which they’ll be tried. Generally, you’ll want to try Flash first, otherwise browsers that support HTML5 but not Apple’s HTTP Live Streaming (which is pretty much all of them), will default to the HTML5 player, but be unable to get the stream. You can, however, provide multiple video sources with different codecs (for on-demand content) to support the different flavors of browsers, though.

Go to Top