Cost Optimization Strategies for CloudFront in Video Streaming Setup

0

I've been utilizing CloudFront alongside MediaLive and S3 for video streaming, and I've noticed monthly charges hovering around $600. I'm eager to explore cost optimization strategies and would love to gather insights from the community. Here's a breakdown of my setup:

Configuration Overview: CloudFront for content delivery. MediaLive for live video processing. S3 for storage and origin.

Monthly Charges Breakdown: CloudFront costs constituting a significant portion. Download bandwidth consumed in GigaBytes (US) - 400$ Download bandwidth consumed in GigaBytes (Europe) - 200$

are there any Strategies for optimizing CloudFront costs in a video streaming context. Specific configurations or features within CloudFront, MediaLive, or S3 that can contribute to cost reduction.

Any best practices or lessons learned from similar video streaming setups.

4 Answers
3
Accepted Answer

Confirming that your workflow is AWS MediaLive, sending video renditions (HLS?) to Amazon S3, where Amazon CloudFront is used to offer access to and distribution of those streams. The quickest way to reduce costs would be to use Quality-Variable-Bit-Rate (QVBR) encoding, by MediaLive, for each of the renditions being created. QVBR will reduce the average size of video files and segments by 25-40%, compared to Constant-Bit-Rate (CBR) encoding. That translates into S3 storage cost savings and reduction in CloudFront egress costs.

QVBR encoding can be selected in the Rate Control setting for each output from MediaLive. See the following links for more on QVBR

https://aws.amazon.com/media/tech/quality-defined-variable-bitrate-qvbr/ https://docs.aws.amazon.com/medialive/latest/ug/video-encode-ratecontrol.html

AWS
Mike-ME
answered 2 months ago
profile picture
EXPERT
reviewed a month ago
  • Thank you so much for the response.

    While I do need to investigate a bit, I feel this approach will really help us reduce significant costs.

1

Here are some strategies to optimize costs for your CloudFront and S3 video streaming setup:

Leverage CloudFront Price Classes to serve content only from regions where your users are located. This can eliminate unnecessary data transfer costs.

Commit to higher monthly usage volumes (10TB+) through CloudFront's discounted pricing programs. Contact your AWS account team for more details.

Compress video files before uploading to S3 to reduce file sizes and subsequent data transfer costs. Use codecs that support adaptive bitrate streaming.

Configure Cache-Control and Expires HTTP headers on your video objects to leverage CloudFront caching as much as possible.

Monitor CloudFront and S3 usage reports in Cost Explorer to identify optimization opportunities. Track requests, data transfer and storage usage.

Consider alternative video delivery methods like MediaPackage or Elemental Live if your needs require more advanced capabilities. Their pricing may be more suitable for large-scale deployments.

Refer to the AWS Well-Architected Framework and follow best practices for cost optimization across your video streaming architecture.

profile picture
EXPERT
answered 2 months ago
  • Thank you for the response.

    • our users are in USA and Europe (Ireland), so will need to keep both of those regions. We already have pricing classes for cloudfront enabled.
    • we already have discounted pricing program enabled.
    • Need to look at doing compression before uploading to S3.
    • I am not sure if there is much impact of this. (We did try it earlier)
    • No point in looking at Cloudfront and S3 usage in Cost explorer since most costs are around bandwidth consumed.
    • we are already using Elemental Live for video delivery and using Cloudfront + S3 along with it.
1

Without knowing your S3 video format and data rate or the Media Live encode resolution and data rate it is hard to say. One obvious consideration is to tap down on the Media Live encode rate. Not knowing the end users expectation however 3.5 Mbs of 720P with 30 fsp you will see a reduction, I assume, in encode and distribution costs. Share more about your encode data rate, frame rate and we can discuss further.

profile picture
answered 2 months ago
  • Thanks for the response.

    Mostly costs are around cloudfront distribution. Need to check for media live encode resolution.

1

The above answers cover most of what you are asking.... but you should also look at the following:

In your explanation of your architecture and costs nothing is being said about how you are securing your CloudFront distributions against abuse or streaming requests from unwanted clients. You should look at implement WAF rules to only allow client requests that are deemed to be humans streaming your content and not allow bots or other traffic to abuse your CloudFront streaming endpoint.

Look at your CloudFront Reports & Analytics to understand where your traffic is coming from, cache hits/cache misses, etc

Look at CloudFront Security Savings bundle https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/savings-bundle.html

AWS
Nuno_Q
answered 2 months ago
  • Thank you for your response.

    Yes, we are planning to add WAF soon. yes, have looked at Cloudfront Reports and Analytics before but will surely look at it again. as mentioned earlier, we do have the cloudfront discount pricing enabled so I don't think we can add security savings bundle but will check this as well.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions