AWS Logo
Menu

A practical guide to Just-in-time VOD Cost analysis

We'll revisit Just-in-time VOD delivery approach, and develop a simple, cloud-native cost model tailored for moderate operations, managing tens of thousands of hours of video content.

cedric hu
Amazon Employee
Published Oct 21, 2024
Video is already over 80% of the internet traffic. As the cost of compute and storage continues to decrease each year, video content is becoming more accessible for businesses of all sizes. However, Video on Demand (VOD) remains a relatively complex challenge, often accompanied by significant costs, both in terms of engineering and operations.
Before the cloud era, some VOD technology providers promoted just-in-time Packaging (JITP) as a cost-effective solution, especially for “long tail” videos, or those that are infrequently watched. This conceptual model is meaningful, as it presents a classic trade-off between storage and compute costs. This type of analysis still influences many engineers when designing VOD architectures, much of these analyses are now outdated—such as references to storage prices ranging from $1,000 to $3,000 per terabyte.
In this blog, we’ll revisit this topic and develop a simple, cloud-native cost model tailored for moderate operations, managing tens of thousands of hours of video content.

Components of a Typical VOD Architecture

A standard VOD system has three primary components:
  1. Storage: This is where video content is stored, typically in services like AWS S3.
  2. Content Delivery Network (CDN): Used for video caching and delivery, such as AWS CloudFront.
  3. Transcoder: Converts source videos into various formats for playback across different devices. AWS Elemental MediaConvert is common solutions for this, even though you may build on own on EC2. It is fairly CPU/GPU intensive. The transcoder transforms the original video into multiple formats, resolutions, and bitrates—such as 1080p, 720p, or 480p—to accommodate different devices, network speeds, and screen sizes.

Pre-Coded vs. Just-in-Time VOD

When videos are “hot” (i.e., popular sports game or TV shows), it makes sense to use a pre-coded approach, where the transcoder generates around 10–20 variations of the original video upon publication, often requiring five times more storage than the original file, which is worthwhile when you know many people are going to play those formats anyway.
For less frequently watched (“cold”) videos, Just-in-Time Packaging (JITP) can help reduce storage costs by only transcoding the video when a specific format is requested by the end user. This eliminates the need to store multiple variations of the same video upfront.
Large video repositories, such as those operated by platforms like Netflix and YouTube, often contain both hot and cold videos. For this reason, many companies adopt a hybrid approach, using pre-coding for popular content and JITP for long-tail videos. The key question is: What is the break-even point to justify the cost of JITP in a cloud-native environment?

Cost Model Using AWS Pricing

Let’s build a simple cost model using AWS’s publicly available pricing. We’ll assume a 1-hour video in 1080p HD resolution, encoded with H.264.
  • Pre-coded approach: A 1-hour video generates video segments around 3.5 GB in size, which can be stored in S3 Glacier Instant Retrieval. The monthly storage cost for this is $0.014 (at $0.004 per GB per month).
  • JITP approach: Each time the video is transcoded, it costs $0.90 (at $0.015 per minute of video). Additionally, we assume only 30% of the video is watched by users.
VOD architecture on AWS
VOD architecture on AWS

Breakdown of Costs

1 hour HD video size, AVC Codec (GB)3.0
AWS MediaConvert price for HD Video (per minute)$0.015
Portion of video being watched30%
Actual transcode cost$0.27
S3 StandardS3 Standard-Infrequent AccessS3 Glacier Instant Retrieval
Price/GB * month$0.023$0.0125$0.004
Cost of monthly storage$0.069$0.038$0.012
Transcode to Storage cost ratio3.97.222.5

Transcode-to-Storage Cost Ratio

The ratio of transcode costs to storage costs varies depending on the storage tier you choose. For S3 Glacier Instant Retrieval, the transcode-to-storage cost ratio is approximately 22.5 months, meaning that you would only achieve cost savings with JITP if a video is watched less than once every 22.5 months; For S3 Standard tier, however, the number is significantly shorten to 3.9 months.
Now, let’s extend the exercise a bit further to two other popular encodings with different compression efficiency (usually the higher the compression ratio is, the more complex the transcoder process is), we got similar pattern.
Break-even point (months per view) for various VOD codec
Break-even point (months per view) for various VOD codec
From the chart above, it becomes obvious that you would rarely need to do JITP---this is particularly true, if video files can be stored in S3 GIR. Of course, we know that is not always true. The choice of S3 bucket storage class itself also depends on the access pattern (https://aws.amazon.com/s3/storage-classes/). In the following chart, we consider 3 typical storage classes for videos of various access pattern. It shows the TCO (Total cost of ownership) in 10 years, for a one hour HD VOD on AVC format. JITP would almost always cost much more than Pre-coded VOD. For reference, it also includes the CloudFront delivery cost, which is a significant part of the TCO for hotter videos.
VOD TCO in 10 years
VOD TCO in 10 years

Conclusion: The Relevance of JITP in the Cloud Era

Due to the availability of highly efficient cloud storage solutions like AWS S3 Glacier Instant Retrieval, many older analyses advocating for JITP are outdated. In most cases, a pre-coded VOD approach is more cost-effective unless the videos are accessed only once every two years.
If you find the above analysis useful, and want to build your own VOD solutions on AWS, the following two resources could be helpful for most of moderate VOD operation:
For large-scale video operations in million hours level, you might want to look into more comprehensive analysis, e.g. this academic paper: Cost-Efficient Dynamically Scalable Video Transcoding.
 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

Comments