Published on July 1, 2020 (over 3 years ago)

Why You Should Use a CDN for Video

Scott Kidder
By Scott Kidder8 min readVideo education

Video consumption is accelerating rapidly, and an increasing percentage of video is being delivered over the Internet. Video delivery already makes up the majority (60%) of traffic on the Internet. Quarantine measures introduced worldwide in spring 2020 have further amplified this trend.

Content Delivery Networks (CDNs) have been instrumental in making this possible.

LinkChallenges of Delivering Internet Video

This growth trend belies the difficulty of delivering Internet video at scale, which carries some unique challenges.

LinkChallenge 1: The Entire Video Pipeline is Sensitive to Latency

We’ve all experienced buffering or stalled playback while watching videos. High network latency - the time to transmit and receive data - leads to a poor experience for most applications, but can be disastrous for video, especially live video.

Some of the video delivery processes that affect latency are:

  • Video ingest pipeline (transmission of the source video to the encoder)
  • Video Encoding
  • Manifest generation
  • Network transmission of manifests & video segments to the player


The entire video playback experience can suffer if just one of these processes is performing poorly.

LinkChallenge 2: Costs Increase With Quality

Videos recorded at higher resolutions (1080p, 2k, 4k) typically demand higher bitrates. Data egress costs are usually metered by bytes sent. As video bitrates increase, so does the cost of delivery, particularly from the video origin.

The following chart shows YouTube's bitrate recommendations for video uploads by resolution:

The encoded video bitrates will certainly be less the source content bitrate, but this shows the rate at which bitrates can grow in relation to resolution. A 4k video can use up to 45x the bandwidth of a 360p video!

It's clear that pushing video resolutions to 4K, 8K, and beyond while controlling network and storage costs requires more than just better compression and codecs.

LinkChallenge 3: Global Audiences

If your video is being served from a data center in Virginia, USA, but the viewers are located in Melbourne, Australia, then they’ll likely experience higher latency and error-rates than viewers located in the USA. The following table shows network latencies reported by Verizon in May 2020:

Route

Latency (ms)

Australia to US

153.756

Hong Kong to US

142.494

North America to India

232.079

Intra-North America

30.369

LinkCDNs to the Rescue!

CDNs make it possible to send low-latency video around the world while simultaneously reducing costs. This almost sounds too good to be true!

In its most basic form, a CDN keeps a copy of data (“cache”) at its own Points-of-Presence (POPs) around the world, and content is served to users from nearby POPs whenever possible. A user will hit the closest POP (or at least what the network thinks is the closest). The CDN POP checks its cache before requesting the content from the origin (a "cache-miss").

Having a CDN POP between the viewer and your origin reduces latency (improved viewer experience), reduces the number of requests to your origin (lower compute costs), and the amount of data egressed from the origin (lower network egress costs).

LinkHow commonly are CDNs used in video delivery?

CDNs are popular for caching many types of content - HTML pages, images, videos, and more. But the phenomenal growth in the CDN market is being largely driven by the growth in video consumption:

“We predict that the global CDN market will reach US$14 billion in 2020, up more than 25 percent from 2019’s estimated US$11 billion. Further, the market will more than double to US$30 billion by 2025, a compound annual growth rate of more than 16 percent. ... This growth is being driven primarily by consumers’ ever-increasing hunger for streaming video over the internet,” (Deloitte Insights, Dec 2019)

As a high-volume video service, Netflix is heavily dependent on CDN architectures and went so far as to build their own CDN, named Netflix Open Connect. Netflix has installed its Open Connect hardware in ISP data-centers around the world with pre-warmed caches of its massive content library to further reduce their network egress costs and improve performance.

The parallel growth in online video consumption and CDN usage proves that a solid CDN integration is critical to the success of online video services.

LinkHow can I use a CDN for Video Delivery?

The ease of adding a CDN part of your video delivery pipeline depends on the complexity of your video origin.

Static-origin deployments were common until the last few years. Simply generate a half-dozen video encodings at various bitrates/resolutions, an HTTP Live Streaming (HLS) rendition manifest for each encoding, and an HLS master manifest to link them all. This also works for serving static encodings like MP4 files. Place the files in an S3 bucket and serve it from Amazon CloudFront or any other file-based CDN, and you're mostly done.

Dynamic-origin deployments are increasingly popular because of the additional capabilities they offer. Features of dynamic-origins can include:

  • Signed URLs for access-control
  • Dynamic CDN selection
  • Audience-adaptive rendition selection
  • Device-aware rendition selection
  • Just-in-Time (JIT) Transcoding of Video

With a dynamic-origin, video playback requests from individual users can be routed to different CDNs and include different encoding renditions depending on where the user is located, the device they're using, and the video content attributes. These decisions are typically made by the origin at the start of each playback. They are latency-sensitive and factor greatly into the time-to-first-frame and exit-before-video-start performance metrics.

Caching content at the CDN is much more challenging for dynamic-origins. For video delivered using HTTP Live Streaming (HLS), which is currently the most popular bandwidth-adaptive protocol, the caching of manifests can present a hurdle. The master-manifest is often not cacheable and must be served from the dynamic-origin, and can contain CDN-specific URLs for the set of encodings appropriate for the source content or device. Rendition manifests can often be cached on a CDN; however, for live content, the rendition manifests expire in mere seconds and must be retrieved again from the origin. The video segments, which make up the bulk of the bytes served, are highly cacheable and don't present much difficulty. This mixture of cacheable and non-cacheable resources greatly increases complexity.

So, it's fairly easy to add a CDN to a static-origin, but adding a CDN to a dynamic-origin with all of its additional capabilities is not for the faint of heart.

LinkCDN Support in Mux Video

If you're a user of Mux Video, then you're already using multiple CDNs. We've done the hard work for you!

The Mux Video service uses a dynamic origin to perform dynamic CDN selection, audience-adaptive rendition selection, Just-in-Time (JIT) video encoding, signed-URL generation and enforcement, and much more. All requests to the origin are sent over CDNs for optimal performance. We ensure that every customer, from the smallest to the largest, receives the benefits of a CDN without them having to individually negotiate terms with CDN providers.

Mux Video automatically selects the optimal CDN for every video view based on real-time network conditions. Mux ensures secure video delivery and is integrated with CDN systems to monitor delivery usage and performance. More details are available in our earlier blog post, "Multi-CDN support in Mux Video for improved performance and reliability".

CDNs are essential to a high-performance, cost-effective video platform, and Mux Video has made it effortless to deliver video over multiple top-tier CDNs. This is just one of the many reasons you should give Mux Video a try!

Written By

Scott Kidder

Scott Kidder – Sr. Engineering Manager

10 years of video experience. Previously solved hard problems at Brightcove.

Leave your wallet where it is

No credit card required to get started.