• 7

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Buffering when serving videos through AWS CloudFront

We are hosting videos in AWS S3 in HLS format (lots of .ts files, + playlists .m3u8).

We have configured AWS CloudFront with all Edge locations to serve those files.

We have 2 apps, iOS and Android, with a video player that plays the CloudFront URL. Android app is using Google’s Exoplayer, and iOS app is using AVPlayer. They both present the same issues.

The videos play smoothly from the same region as the source S3 bucket. We had some issues at the start but we fixed them by fixing the bitrate encoding.

However customers from remote countries complained about the buffering: average of 1 minute to initially load the video, then average of 12s of buffering every minute.

So we decided to add AWS CloudFront so that the files would be cached in the Edge locations, making the videos faster to load.

But the customers kept complaining, and we were aware that it would still take a while to load for the first user.

So we set up 2 non-AWS servers in other regions that automatically download the videos, in the aim to get them cached in those 2 regions, as soon as they are published.

But it doesn’t seem to help either.

I am wondering if AWS CloudFront is effective at all for video streaming via direct download, or if we are missing something.

How to make CloudFront work to get rid of video buffering? ?Or if CloudFront is not the solution (why?), what should we be looking at?

Side note: We set the TTL to 10 years, just in case… and we manage invalidation manually.

      • 2
    • It didn't actually cross our mind to contact them for this... We looked and we looked on the Internet but couldn't find anyone with the same sort of issue. Will do now!
      • 1
    • Right, we are on the basic plan so we don't have access to Technical Support. I will have to check if we can pay for that.
      • 1
    • Yes. The CloudFront logs will be more interesting, but also, you should be able to cross-coordinate cache misses and refresh-hits to S3 requests. Take the client IP from the S3 logs, do reverse lookups on them, and the hostname should reveal the CloudFront edge that actually did the fetch from S3 (which should line up with the CloudFront edge codes in the CF logs, but discrepancies may also be informative).

Trending Tags