How Modern Video Streaming Actually Works

Tech

July 21, 2025 (1mo ago)

6 min read

Loading...

Lately, I’ve been working on a project that involved video streaming. The app was getting a lot of traffic, and I needed to figure out how to stream videos efficiently without making things slow or clunky. That got me deep into how video streaming actually works—and honestly, I learned a lot and I thought it would be a good idea to share my findings via this blog post.

If you’ve ever asked yourself why platforms like YouTube or Netflix feel so smooth, but playing a regular MP4 from a server sometimes feels… laggy—this post is for you.

In video streaming, you've probably heard terms like HLS, DASH, and RTMP thrown around. These are protocols that power the smooth video experiences we take for granted. Each has its own strengths and use cases, but today we'll focus on the most important ones.

HLS and DASH are widely used protocols for streaming videos over the internet.

But before we dive into these protocols, let's first start from very basics.

So you upload a 1 GB MP4 video to your S3 bucket, and it plays just fine. Maybe it takes a couple of seconds to start, but once it does - it plays smoothly. So why are these fancy terms like HLS and DASH are thrown around all the time when it comes to video streaming?

Let's break it down - step by step, without the jargon.

🧐 Wait, what's wrong with a normal MP4 video?

When you use an ordinary .mp4 video file and embed it in a webpage with HTML like this:

<video src="https://your-bucket.s3.amazonaws.com/video.mp4" controls></video>

Here’s what actually happens:

There are some issues like:

So yes - it works. But it doesn't adapt. And that's the problem.

Q) If I skip to the 50th minute of a 60-minute video, does the browser wait until 50 minutes worth of video has downloaded?

No, not necessarily.

In progressive download:

Range: bytes=300000000-400000000

This tells the server: “Hey, send me only from byte X to byte Y.”
BUT this only works properly if the MP4 is “streamable.”

🔍 What makes an MP4 “streamable”?

So if:

🤔 What if the user’s network is slow?

Here’s the catch:

Wouldn’t it be better if:

That’s exactly what HLS and DASH do.

Enter HLS and DASH

Both are protocols for adaptive streaming. That means they break your video into:

  1. Multiple resolutions/bitrates (e.g., 1080p, 720p, 480p)
  2. Tiny segments (e.g., 4-6 seconds each)
  3. A playlist/manifest file that tells the player where to find those segments

HLS (HTTP Live Streaming)

DASH (Dynamic Adaptive Streaming over HTTP)

How Does HLS/DASH Work?

Let’s say you have a 10-minute video.

Instead of uploading it as a single .mp4, you do this:

Original Video
├── 1080p: chunk1.ts, chunk2.ts, ...
├── 720p:  chunk1.ts, chunk2.ts, ...
├── 480p:  chunk1.ts, chunk2.ts, ...
└── playlist.m3u8 / manifest.mpd

When a user starts watching:

  1. The player downloads the playlist.
  2. It detects network speed.
  3. It starts streaming chunks from the best quality stream.
  4. If the network slows down, it switches to lower resolution.
  5. If the network improves, it switches up again.
  6. All of this happens seamlessly — every few seconds.

Core Difference: Progressive vs Adaptive Streaming

Feature Progressive Download (MP4) Adaptive Streaming (HLS/DASH)
Type Single file Multiple files (segments)
File Format Single .mp4 file Playlist (.m3u8 / .mpd) + segments
Quality Switching ❌ Fixed bitrate ✅ Auto-switches quality dynamically
Buffering Behavior Linear (starts from beginning) Chunk-based buffering (can jump ahead)
Seeking Byte-range seek (if moov at start) Segment-based seek
Server Load Simple HTTP file serving Requires playlist and segment logic

TL;DR

Basic MP4 works great for simple use cases—it's quick to implement and straightforward. But it doesn't scale well across varying networks and devices, which is crucial in today's diverse digital landscape.

If you're building something user-facing, adaptive streaming protocols like HLS or DASH can dramatically improve your users' experience. They make videos start faster, play smoother, and adapt intelligently to network conditions.


For my recent project, I implemented this using Cloudflare Stream, which handles all the heavy lifting—encoding, storage, and global delivery. You simply upload your video, get back a videoId along with HLS and DASH URLs, then embed them using Cloudflare's iframe or your own video player.

The future of video is adaptive, and your users will thank you for the smoother experience :)