Saving on Encoding and Delivery: Dynamic Packaging

This is the third in a five-part series on how to cut your encoding and streaming costs. The first article was on Adjusting Encoding Configurations to Increase Capacity, while the second was on Deploying Capped CRF Encoded videos.

You can dramatically reduce net encoding and storage costs by implementing dynamic packaging for your live or VOD video. This article defines dynamic packaging, explores its benefits, and outlines some implementation options. 

The image above is from Bitmovin’s Video Developer Report 2017, which incorporates 380 survey submissions from over 50 countries. The graph reflects the reality that if you’re distributing video with DRM, you likely need to support at least two ABR formats, HLS and DASH. If you’re supporting older gaming platforms, you may also need to support Smooth Streaming.

If this reflects your reality, the most cost-effective way to support these multiple formats is via dynamic packaging, also called just-in-time packaging. In this article, I’ll describe what dynamic packaging is, how it works, and how it can reduce your overall streaming expense. I’ll also address how quickly the Common Media Application Format (CMAF) will obsolete dynamic packaging (not soon) and instances where dynamic packaging may be contraindicated.

About Dynamic Packaging

The traditional way to serve multiple ABR formats was to encode and package each format separately, then upload all files to the origin servers for delivery. Worst case, if you are encoding with some cloud vendors, each encode would be a completely separate charge, though many vendors now change less for outputting multiple ABR formats. Since you’re storing multiple ABR versions of each video in the cloud, each additional format that you support boosts your storage cost by 100%.

Dynamic packaging works for live and VOD video and is shown in Figure 2 from Microsoft Azure documentation. You create the content in two phases. You encode once, uploading the content to a streaming endpoint. From there, a server on the endpoint detects the playback capabilities of the client and dynamically produces the necessary ABR format. Since the server is merely changing the container format of the file (also called transmuxing) and perhaps adding DRM, this is a very fast and lightweight operation with low latency.

Figure 2. Dynamic packaging at work at Microsoft Azure.

Because you’re only encoding the content once, you save on encoding costs, and because there’s only one version of the file at the origin server, you save on storage costs. Balanced against this is the cost of the server component.

Obviously, if you pay Microsoft Azure to package for you, the cost is bundled into the service. However, if you license the Wowza Streaming Engine or Nimble Streamer to package for you, you have to incorporate the cost of both the server and the cloud machine that you’ll run it on. To calculate whether dynamic packaging will save you money, identify the encoding and storage savings and offset that against the cost of the server.


Savings can be significant. During the transition year, dynamic packaging reduced the encoding costs of the library transcode and ongoing encodes by close to $90,000 and cut storage costs by around $34,000. Add back the $20,000 or so it would cost to run Wowza Streaming Engine, and total savings exceeded $100,000.


Savings can be significant. For example, I worked with a client who was converting a large existing library to ABR streaming, and producing significant hours of new videos. During the transition year, dynamic packaging reduced the encoding costs of the library transcode and ongoing encodes by close to $90,000 and cut storage costs by around $34,000. Add back the $20,000 or so it would cost to run Wowza Streaming Engine, and total savings exceeded $100,000.

Getting Dynamic Packaging

In addition to the vendors already identified, you can access dynamic packaging from multiple vendors with at least one open source alternatives. For example, AWS Elemental Technologies offers a software solution, AWS Elemental Delta, and an SaaS solution, AWS Elemental MediaPackage. Harmonic offers ProMedia Package, while Brightcove deploys Dynamic Delivery on their Video Cloud platform. The NGINX Plus server can dynamically package live video into HLS, DASH, and RTMP format, and convert VOD files in MP4 format to HLS (but apparently not to DASH in real time). The bottom line is that you’ll have multiple options for dynamic packaging, whether you’re seeking to buy it, license it, or access it as part of a SaaS.

Figure 3. Brightcove deploys dynamic delivery in their Video Cloud platform.

What About CMAF

By way of background, when initiated, Apple HLS only supported files in the MPEG-2 transport stream format (.ts) while DASH supported fragmented MP4 files (fMP4). This prevented one set of files from being distributed to both DASH and HLS clients. In 2016, Apple started supporting fMP4 files compatible with the Common Media Application Format spec that Apple co-authored with Microsoft. CMAF uses the ISO Base Media File Format (ISOBMFF) container—with common encryption (CENC); support for H.264, HEVC, and other codecs; and WebVTT and IMSC-1 captioning. For compatibility, CMAF can be called by both HLS playlists (.m3u8 files) and DASH manifest files (.mpd files). For HLS delivery, CMAF will replace files currently packaged in the MPEG-2 container format.

The problem is that CMAF also enables two incompatible common encryption modes: cipher block chaining (CBC) for Apple’s FairPlay digital rights management technology (DRM), and counter mode (CTR) for PlayReady, Widevine, and other DRMs. Content encrypted with CBC can’t be decrypted by PlayReady- and Widevine-compatible clients, while content encrypted with CTR can’t be decrypted by FairPlay clients.

Since 2016, Google has added CBC support to Widevine while Microsoft has announced support for CBC in PlayReady 4.0. This means that one set of CMAF-formatted content encrypted using CBC should be able to play in all modern DASH and HLS players.


The problem is that there are many generations of Apple devices that aren’t compatible with CMAF and can’t play content that’s not in an MPEG-2 container. So, any service supporting legacy devices won’t be able to move to a totally CMAF-based solution for several years.


The problem is that there are many generations of Apple devices that aren’t compatible with CMAF and can’t play content that’s not in an MPEG-2 container. So, any service supporting legacy devices won’t be able to move to a totally CMAF-based solution for several years.

Where Dynamic Delivery is Contraindicated

There are a couple of scenarios where dynamic delivery is contraindicated. One is very large events. Specifically, though dynamic packaging works well for hundreds or even thousands of simultaneous users, Will Law, chief architect of media cloud engineering at Akamai, points out that when streaming gets to a truly massive scale, like tens of millions of connections, the extra work associated with dynamic packaging is magnified. According to Law, this reduces the throughput of Akamai’s edge servers, and the extra complexity associated with dynamic packaging increases the opportunity for workflow issues to arise.

The other potential problem are involves live streams with advertising insertion, where dynamic packaging has caused problems with at least one executive that I spoke with. Otherwise, if you’re still creating separate file stores for each video format for either live or VOD delivery, you should at least explore whether dynamic packaging can reduce your net encoding and storage charges.

Where to Go From Here

You’ve got the background, now it’s time to start exploring the class of alternatives that are right for you. If you’d like a little help with the direction of your analysis or the number crunching, contact me (Jan Ozer) at [email protected]. Otherwise, there are some links below to get you started.

Resources

How to Create a Live HLS Feed With HEVC, Streaming Media Europe, Spring 2018.

Review: Softvelum Nimble Streamer Is Flexible and Well-Featured, Streaming Media Europe, August 2017.

How to: Dynamic Packaging with Wowza Streaming Engine, Streaming Media Europe, Spring 2017.

About Jan Ozer

Avatar photo
I help companies train new technical hires in streaming media-related positions; I also help companies optimize their codec selections and encoding stacks and evaluate new encoders and codecs. I am a contributing editor to Streaming Media Magazine, writing about codecs and encoding tools. I have written multiple authoritative books on video encoding, including Video Encoding by the Numbers: Eliminate the Guesswork from your Streaming Video (https://amzn.to/3kV6R1j) and Learn to Produce Video with FFmpeg: In Thirty Minutes or Less (https://amzn.to/3ZJih7e). I have multiple courses relating to streaming media production, all available at https://bit.ly/slc_courses. I currently work as www.netint.com as a Senior Director in Marketing.

Check Also

Choosing the Best Preset for Live Transcoding

When choosing a preset for VOD transcoding, it almost always makes sense to use the …

There are no codec comparisons. There are only codec implementation comparisons.

I was reminded of this recently as I prepared for a talk on AV1 readiness …

How GPAC Technology is Shaping the Future of Streaming: Key Insights from Fred Dawson

In a recent interview available on YouTube, Jan Ozer sat down with Fred Dawson, an …

Leave a Reply

Your email address will not be published. Required fields are marked *