- Newest
- Most votes
- Most comments
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:
- 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
- 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)
-
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.
-
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
- 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
Try to run this solution to see if there any performance difference: https://aws.amazon.com/solutions/implementations/video-on-demand-on-aws/
answered a year ago
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
Relevant content
asked 3 years ago
asked 2 years ago
asked 5 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
