Using an HTML5 Video Player to Increase Your Streaming Capacity by a Factor of 50X

Adding p2p CDN to HTML5 video player

There’s more than one way to deliver video. Peer-to-peer CDN, or p2p CDN, is an exciting new option, and Kaltura partner Peer5 offers a convenient new solution.
By Hadar Weiss
Recently, there has been a lot of discussion around (1) the death of Flash and (2) the benefits of adopting an HTML5 video player.
What is often lost (or underemphasized) in these conversations is how the transition to an HTML5 player also increases the content delivery options that are available to a broadcaster. Since the invention of the Content Delivery Network (CDN) in the late 1990’s, there has effectively been “one architecture to rule them all” – i.e., an HTTP edge server based architecture. In this system, one installs servers with big hard drives in as many data centers as possible, connects them all together with IP transit links and, voila, you have a CDN. Regardless of how the other pieces in the video stack have changed (e.g., the player, digital rights management, streaming protocols, ad insertion, etc), at the end of the day you’re still delivering video segments from edge servers to viewers.
Well, times have finally changed and HTML5 video gives the streaming industry the opportunity to finally end the hegemony of the edge server. To be fair, alternative content delivery architectures, such as peer-to-peer (p2p) delivery, have been around for years. Even Travis Kalanick (yes, of Uber fame) had a p2p CDN startup many years ago called Red Swoosh which he mentions in this very entertaining video about his pre-Uber failures.

What’s a p2p CDN?

Before explaining what a p2p CDN is, let’s first review how streaming video is delivered via the Internet as this is central to understanding how a p2p CDN works. While the video that plays across your computer screen (or the “connected” TV in your living room) may look continuous to you, it is actually comprised of individual discrete segments (or “chunks”) of video that are delivered into a temporary local storage area (a “buffer”). Your video player extracts these chunks from the buffer and stitches them together so you can see moving pictures. Everyone who is watching the same stream has the same underlying chunks in their buffer.
A p2p CDN asks the question: why should everyone connect to an edge server to fetch the same exact data that other viewers (or “peers”) have already downloaded, especially if that server is already overloaded or located on the other side of an ocean? The answer is that they shouldn’t and that there are likely peers who can deliver the necessary chunks much more quickly than the edge server could. So, a p2p CDN is simply a cloud service that orchestrates peers so that they can share chunks with each other. As more chunks are delivered by peers (a concept known as “peer efficiency”), one is able to achieve massive scalability gains while simultaneously improving the stream quality for each individual viewer, as illustrated in the table below where we assume viewers are receiving a 1 Mbps stream from a single origin server:

Peer Efficiency
(% Off-load)
Avg p2p Bitrate
Avg HTTP Bitrate
Scalability Increase
0 0.00 1.00 None
50 0.50 0.50 2X
90 0.90 0.10 10X
98 0.98 0.02 50X
99 0.99 0.01 100X
99.9 0.999 0.001 1000X

To summarize, if you’re able to off-load 50% of the content distribution to peers (50% peer efficiency), then your origin server is working 50% less than it was before and you can now service an audience that is twice (2X) as large without having to deploy additional hardware. If peer efficiency reaches 99%, then your server is doing 1% of the work it previously did and you can now service an audience that is 100X bigger (1 / 0.01 = 100). Because it is a logarithmic function, small gains in peer efficiency (e.g., from 99% to 99.9%) result in an order of magnitude improvement in scalability (100X to 1000X).

Why a p2p CDN?

Besides massive scalability, p2p CDNs also offer these advantages:

  • Ubiquitous Geographic Coverage: wherever you have a viewer, you also have a “server”
  • 100% Supply Elasticity: additional delivery capacity is available the instant you need it and it disappears the instant you no longer need it

At this point, the question that begs to be asked is: “If p2p CDNs are so great, then why haven’t they taken over?”
The answer is that before HTML5 the only way to manipulate video streams in a web browser was via some kind of plug-in (such as Flash) and this required end-users to install such plug-ins. Today, we all know that installing plug-ins is problematic for a variety of security and performance issues. Because HTML5 defines a standard way to add video to a web page (via the <video> element) and incorporates video into the Document Object Model (DOM), it enables the manipulation of video streams via Javascript across all browsers. Now that this is possible, alternative content delivery architectures, such as Javascript-based peer-to-peer delivery which doesn’t require any plug-ins can (1) be deployed in a matter of minutes and (2) leverage all of the security and performance enhancements that the major browser vendors have made over the years to their Javascript interpreters and other parts of the browser.

Adding p2p CDN to the Kaltura HTML5 Video Player

If you recently deployed the Kaltura HTML5 video player, then you are in a position to realize the promise of p2p CDNs thanks to a new integration with Peer5. Simply enable Peer5 in your Kaltura dashboard as follows:
How to add p2p CDN to Kaltura

And you’ll be able to leverage the world’s most scalable, geographically diverse and resilient CDN to help deliver your video streams. On average, broadcasters who employ Peer5:

  • deliver streams with 40% less buffering
  • increase average session durations by 30%
  • increase streaming capacity by up to 50X

And they are able to achieve these gains without modifying any of their existing CDN settings. It is literally that easy thanks to the beauty of HTML5 video.
Peer-to-peer CDNs are fundamentally changing the way video is delivered. Now it’s time to reap the benefits!
Hadar Weiss is a co-founder and the CEO of Peer5, the serverless CDN. Founded in 2012, Peer5’s mission is to leverage HTML5 to enable massively-scaled video streaming. Our novel peer-to-peer solution solves the peak demand problem by creating a network that actually gets stronger as viewership increases. This means that we perform our best at the exact moment when traditional CDNs struggle the most – making Peer5 the perfect complement to a broadcaster’s existing CDN infrastructure. More more information, please contact Hadar at

Discover more partners with great video products in the Kaltura Exchange!

Let's Get Going