sonic
sonic

Reputation: 1430

AWS cloundfront video speed loading

I have s3 bucket and cloundfront connected to it. I use afterglow player to load html5 videos from cloundfront on my website. The file has 60mb in mp4 format. It lags few seconds after few seconds. What should I do ? Im not really specialist in AWS, there are no encoders connected.

Server-side encryption None

Upvotes: 2

Views: 2543

Answers (3)

oleracea
oleracea

Reputation: 25

The truth is there Will be user's videos as well, So without transcoding on aws it Will be hard.

If you run ffmpeg via a layer in a aws lambda function, then you can do transcoding without ever leaving aws. I hope this helps.

Upvotes: 0

James Dean
James Dean

Reputation: 4461

Serving a MP4 file directly from S3 can be a problem, typically a browser will first make a GET request to know the Content-Length and then makes a lot of partial GET range requests (with 206 response) to fetch and play the MP4 file. This is a typical case of serving an MP4 file from S3.

I would suggest use Dash/HLS player, free players are available and you don't need transcoder if you can use ffmpeg.

Upvotes: 0

mostafazh
mostafazh

Reputation: 4207

Given that you are already using Cloudfront, which is getting the content as close as possible to your users. I'd suggest one of the following:

  1. Create less resolutions of the same video file, which would be quick to load on slow internet connections.
  2. Add those resolutions to the player so users can pick which resolution to stream.

OR

  1. Create a Dynamic Adaptive Streaming over HTTP (DASH) version of the file, like: "Auto Resolution" in Youtube.com by using Amazon Elastic Transcoder to create such a file and save it on AWS S3.
  2. Point AWS Cloudfront to the Amazon Elastic Transcoder destination S3 Bucket to server that file to your users.
  3. Change afterglow with a HTML5 Video player that supports DASH (e.g. mediaelement.js and others).

    This is a very helpful guide: Step by step on stream DASH on S3

Upvotes: 3

Related Questions