Skip to content

bolauae1 video streaming performance issues on AWS Amplify Deployment

0

Subject: bolauae1 video streaming performance issues on AWS Amplify Deployment

Hi team,

I'm working to troubleshoot a performance issue with a new mobile application deployment. The reference build I'm analyzing is located at the source below, which contains the video assets in question.

https://sites.google.com/view/bolauae1-apk-fullvideo/home

Project Context

The application, "bolauae1," is designed for video content delivery. We are attempting to host the backend components and stream videos entirely on AWS for scalability, but we're hitting a significant performance bottleneck.

Current Architecture

  • Frontend: Hosted on AWS Amplify, connected to our Git repository.
  • Video Storage: All video files are stored in an S3 bucket.
  • Distribution: An Amazon CloudFront distribution is set up with the S3 bucket as its origin.

Observed Behavior

We are facing several critical issues that are impacting user experience:

  • When streaming video content, there is significant buffering and stuttering, particularly on mobile network connections.
  • CloudWatch logs are not showing any specific errors, but latency appears to be unusually high.
  • The primary suspicion is a misconfiguration in either the CloudFront settings or how Amplify is handling the streaming requests, as direct access to the S3 assets is faster.
  • We've encountered issues where video tags in our React app do not load correctly on Amplify, showing a 206 partial content status without playback.

Question

Has anyone in the community faced similar video streaming challenges with an Amplify-hosted frontend? We are looking for advice on best practices for this scenario. Specifically, are there recommended CloudFront cache policies or other settings we might be overlooking that are essential for optimizing on-demand video streaming for an application like this?

asked a year ago48.2K views

3 Answers
0

The video streaming issues you're experiencing with your Amplify-hosted application are likely related to how your content is being served rather than Amplify itself. Here are some recommendations to address the performance issues:

  1. Content Headers Configuration: The 206 partial content status without playback suggests a potential issue with content headers. Ensure your S3 objects have the correct headers:
  • Set Content-Type to "video/mp4" (assuming MP4 format)
  • Set Content-Disposition to "inline" or don't set it at all
  • These headers can be modified using the AWS CLI or through the S3 console
  1. CloudFront Optimization:
  • Create specific cache behaviors for video content
  • Ensure appropriate HTTP methods (GET, HEAD) are allowed
  • Set an appropriate viewer protocol policy (e.g., Redirect HTTP to HTTPS)
  • Configure proper origin settings if you're using Origin Access Identity (OAI) or Origin Access Control (OAC)
  1. S3 Bucket Policy: Verify that your CloudFront distribution has proper permissions to access the S3 bucket. If using OAI/OAC, ensure the bucket policy grants the necessary access.

  2. Cache Behavior Settings: For video content, consider:

  • Increasing the TTL (Time to Live) values for better caching
  • Enabling compression for applicable content types
  • Configuring proper origin request policies
  1. Video Streaming Optimization:
  • Consider implementing adaptive bitrate streaming (HLS) for better performance across different network conditions
  • Use AWS Elemental MediaLive for transcoding content into adaptive bitrate streams if needed

The buffering and stuttering on mobile networks suggest that your current setup might not be optimized for varying bandwidth conditions. Implementing adaptive bitrate streaming would help address this by serving appropriate quality levels based on the viewer's connection speed.

If direct S3 access is faster than through CloudFront, this indicates a potential misconfiguration in your CloudFront distribution that needs to be addressed.
Sources
Video Streaming from S3 Object Standard storage class wont load via html5 video tag, but Glacier IR will. | AWS re:Post
Cloudfront CDN is not working with Videos | AWS re:Post
Architecture details - Live Streaming on AWS with Amazon S3
CloudFront: The resource you requested does not exist Origins S3 | AWS re:Post
Architecture overview - Live Streaming on AWS with Amazon S3

answered a year ago

0

Try to run this solution to see if there any performance difference: https://aws.amazon.com/solutions/implementations/video-on-demand-on-aws/

AWS

answered a year ago

0

Hey,

Hope you're keeping well.

For smooth video streaming from S3 via CloudFront, make sure your CloudFront distribution is configured to support range requests, as video players rely on 206 Partial Content for seeking. Enable caching for media file types, set appropriate Cache-Control headers on the S3 objects, and consider using signed URLs if you need access control without adding latency. If your videos are large, transcode them to adaptive bitrate HLS or DASH using AWS Elemental MediaConvert and deliver via CloudFront, which greatly improves mobile performance on variable networks.

Thanks and regards,
Taz

answered a year ago

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.