How We Streamed a 500GB Video from AWS/GCS at VideoDubber.ai

Introduction
Streaming a 500GB large video has never been an easy task, keeping in mind physical smoothness, almost no buffering, or costs. These sorts of challenges were presented to us by the content creators, who wanted translation and dubbing for long-format videos while maintaining quality.
With deep study and testing in mind, we introduced an HLS extension with FFmpeg in Next.js and gave an enhanced experience to the end user by using Plyr.js. Such an implementation reduced volume loading times and bandwidth costs for the benefit of our users, providing seamless streaming.
In the blog, we will explain what this was all about, the pros that were attached to it, and show some code to implement HLS streaming for large video files on either AWS S3 or GCS.
Understanding HLS:
Why It Is Ideal for Large Videos What is HLS?
HLS, an acronym for HTTP Live Streaming, is an adaptive bitrate streaming protocol developed by Apple. It divides big video files into smaller .ts chunks and serves those chunks over an .m3u8 playlist file. This way, users can smoothly watch the videos without having to acquire them in their entirety-firstly making it very suitable for streaming a 500GB file.
Why HLS for 500GB Videos?
Adaptive Streaming:
HLS lowers the quality depending on internet availability. Efficient Bandwidth Use: Only video parts that are required at any one time get loaded. Scalability: It can bear heavy load without stressing the servers. Cross-Platform Support: It plays on browsers, iPhones, Androids, and smart TVs. Having HLS on VideoDubber.ai meant that we would be able to transcode and stream in real-time those mammoth translated videos with reduced latency and buffering for our customers.
The following goes into our choice of Plyr.js in short:
Why Plyr.js for Frontend Video Plan VideoDubber.ai offers a user-friendly seamless video presentation, and hence it is a vital part in the AI application for translation and dubbing of videos. In the course of our search for a media player, we evaluated a host of product options but decided on Plyr.js for the reasons listed below.
Lightweight and Fast Being a minimal JavaScript library, Plyr.js ensures that its quick video player loading is free of options that would burden the web app. A very important thing is keeping this speed graceful on parts of users with lower bandwidths.
Customizability Open customization is definitely Plyr.js' strong suit; almost to the extent that it has nothing left to offer. Customization can be done while still offering a clean user interface with modern elements. It allows us to customize the appearance and controls of the player according to our branding and user experience requirements.
Smooth Support for Captions and Subtitles Since VideoDubber.ai specializes in translated and dubbed videos, it has become mandatory to have a player supporting multiple subtitle tracks. Plyr.js really agitates in caption support where users have a pretty easy way of toggling to different subtitle languages.
Cross-Browser and Mobile Compatibility VideoDubber.ai is accessed by users using different devices and browsers. There is Plyr.js which is fully responsive and, thus, gives out an equally uninterrupted experience across all the important browsers on desktop and mobile.
Integration with HTML5, YouTube, and more Plyr.js supports a variety of media types, including HTML5 video, YouTube embeds, and even audio files. This versatility perfectly coincides with the needs of our platform, for we accept different media formats for translation and dubbing.
An API Friendly to Developers The interface of Plyr.js is clean with detailed documentation, thus allowing easy integration and extensibility for our development team as per their needs. Hence this helps us enrich the player without unnecessarily complicating it.
How We Set Up HLS Streaming from AWS/GCS Using FFmpeg & Next.js
To stream a 500GB video efficiently, we needed:
Transcoding with FFmpeg (converting raw video into HLS format)
Hosting on AWS S3 / GCS (storing HLS segments)
Delivering with Next.js & Plyr.js (playing the video)
Step 1: Convert the Video into HLS Using FFmpeg
FFmpeg is a powerful tool for processing videos. We used the following command to transcode a large 500GB video into HLS format:
ffmpeg -i input.mp4 \
-preset fast -g 48 -sc_threshold 0 \
-map v:0 -map a:0 \
-c:v libx264 -b:v 5000k -maxrate 5000k -bufsize 10000k \
-c:a aac -b:a 128k -ac 2 \
-f hls -hls_time 10 -hls_list_size 0 -hls_segment_filename "output_%03d.ts" output.m3u8
Explanation:
-hls_time 10
: Breaks video into 10-second segments.-hls_list_size 0
: Keeps all segments in the playlist.output_%03d.ts
: Saves video chunks sequentially.
This command generates:
output.m3u8
– The playlist file.output_001.ts, output_002.ts, ...
– The video chunks.
We then uploaded these files to AWS S3 / GCS for scalable delivery.
Step 2: Storing the HLS Segments on AWS/GCS
To host HLS files, we used AWS S3 with CloudFront and Google Cloud Storage (GCS) with Cloud CDN.
AWS S3 + CloudFront Setup
Upload the
.m3u8
and.ts
files to an S3 bucket.Configure the bucket for public read access.
Set up CloudFront as a CDN to speed up delivery.
Google Cloud Storage + Cloud CDN Setup
Upload files to a GCS bucket.
Enable Cloud CDN for caching.
Make files publicly accessible via signed URLs.
At VideoDubber.ai, using AWS and GCS reduced latency by 60%, making large video playback seamless for global users.
Step 3: Streaming the Video with Next.js & Plyr.js
Once the HLS files were stored, we built a Next.js video player using Plyr.js, a lightweight HTML5 video player.
Installing Plyr.js
First, install Plyr.js in your Next.js project:
npm install plyr react-plyr
Creating the Video Player Component
import React, { useEffect, useRef } from "react";
import Plyr from "plyr";
const VideoPlayer = ({ videoUrl }) => {
const videoRef = useRef(null);
useEffect(() => {
if (videoRef.current) {
new Plyr(videoRef.current);
}
}, []);
return (
<video ref={videoRef} controls crossOrigin="anonymous">
<source src={videoUrl} type="application/x-mpegURL" />
</video>
);
};
export default VideoPlayer;
Using the Component
import VideoPlayer from "../components/VideoPlayer";
const VideoPage = () => {
return (
<VideoPlayer videoUrl="https://your-cdn.com/path-to/output.m3u8" />
);
};
export default VideoPage;
This setup allowed adaptive streaming with buffer-free playback, even for 500GB videos!
Some Potential Benefits of This Strategy
✅ Bufferless Streaming: HLS has optimized the delivery of videos according to bandwidth.
✅ Cost Efficiency: Usage of AWS S3 and Cloudfront has caused about 50% reduction in overall hosting costs.
✅ Scalable: Our translated videos can now handle millions of simultaneous viewers.
✅ Mobile and Desktop Support: It works perfectly on all devices without requiring any extra plugins.
VideoDubber.ai has reaped benefits from the use of this HLS integration such as retaining users, increasing engagement levels, and improving quality in viewing the video.
How HLS Integration was Useful to Us:
✅ Quality Improved: Improved image quality through adaptive bit rate streaming even at slow connections.
✅ Improved User Retention: Users engaged toward life's seamless video playback.
✅ Cross-Device Compatibility: Cross-browser, mobile devices, and smart TVs.
Reduced Buffering Problems: Better viewing experiences due to video delivery optimization.
Cons and How We Handle Them at VideoDubber.ai:
❌ Latency: Slightly slower than other streaming protocols.
✔️ Our Fix: Optimize segment durations and low-latency HLS to address the downside.
❌ Extra server loads: Transcoding and segmenting require more processing power.
✔️ Our Fix: High-efficiency caching and scalable infrastructure share the burden.
❌ Setup Difficulties: Implementing HLS isn't easy because one must program the encoders and CDN the right way.
✔️ Our Fix: We provide the backend pipeline to automate encoding and delivery to provide a hassle-free experience for users.
Such challenges and bottlenecks are taken care of at VideoDubber.ai, thus providing the best video streaming experience possible for a creator or business and making the delivery of high-quality translated content smooth and easy. 🚀
FAQs
Is HLS streamed across all devices? Yes! HLS is compatible on browsers, iOS, Android, and smart TVs.
Is HLS bandwidth-saving? Yes. It saves about 60% in bandwidth by streaming the only needed parts of the video.
Best Storage for HLS files? The best options are AWS S3 + CloudFront and Google Cloud Storage + Cloud CDN.
Can I protect my videos against unauthorized access? Yes! It is possible by using signed URLs in AWS or Google Cloud to restrict access.
What are the ways to improve HLS? Utilization of CDN caching (CloudFront, Cloud CDN) The optimization of FFmpeg encoding settings. Incorporation of multiple bitrate streams to improve adaptability. VideoDubber.ai is Coming Soon by doing HLS streaming using FFmpeg, Next.js, and Plyr.js; it made the playback of 500GB video seamless and buffer-free.
🚀 Test it for your projects today!
Subscribe to my newsletter
Read articles from Jon Davis directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
