Streaming videos: how does it work? Encoding, ABR and CDN

How video streaming works, step by step: encoding with H.264, HEVC and AV1, HLS and MPEG-DASH, adaptive bitrate streaming, CDN delivery and DRM.

On this page

Almost everyone streams video every day, but few people know what happens between pressing play and seeing the first frame. In short: streaming video works by compressing a video into several quality versions, cutting those into small segments of a few seconds, and delivering them over the internet through a content delivery network (CDN). The video player on your device downloads the segments one by one and keeps choosing the quality that fits your connection. Below we explain each step and the technologies that are current today.

Step 1: Encoding, compressing the video

A raw video file is far too large to send over the internet. Encoding compresses it with a codec, a method that removes information the eye barely notices. The most important video codecs today are:

  • H.264 (AVC): the oldest of the three and still the most widely supported. It plays on virtually every device, which makes it the safe baseline.
  • H.265 (HEVC): up to about half the file size of H.264 at similar quality. It is widely used for 4K and HDR and is well supported on Apple devices, smart TVs and streaming devices.
  • AV1: an open, royalty-free codec that compresses even more efficiently. Large services such as YouTube and Netflix use it, and support is growing quickly in newer TVs, phones and computers that can decode it in hardware.

Because not every device supports every codec, streaming platforms usually combine them: a widely compatible version for all devices and a more efficient one for devices that can handle it. For audio, AAC is the common standard, sometimes supplemented with Dolby formats for surround sound.

During encoding the video is converted into a bitrate ladder: a set of versions from low resolution and bitrate (for a weak mobile connection) up to full HD or 4K (for a fast connection). Want to know more about the role of bitrate? Read Bitrate vs upload speed: streaming differences explained.

Step 2: Packaging, the streaming protocols HLS and MPEG-DASH

Next, every version is cut into short segments and described in a manifest, a small file that tells the player which qualities and segments exist. Two protocols dominate:

  • HLS (HTTP Live Streaming): developed by Apple and required for Safari, iPhone, iPad and Apple TV, but supported on almost all other platforms too.
  • MPEG-DASH: an open international standard, widely used on Android, in browsers such as Chrome and Edge, and on many smart TVs.

Thanks to CMAF, a common segment format, the same video segments can now be used for both HLS and DASH. That saves storage and simplifies delivery. Microsoft Smooth Streaming (MSS), which used to be important for Xbox, Internet Explorer and older smart TVs, is now considered legacy and is no longer needed for new platforms.

Step 3: Delivery through a CDN

If every viewer downloaded the video from one central server, that server would quickly become overloaded and viewers far away would wait longer. A content delivery network solves this by storing copies of the segments on servers in many locations. Each viewer receives the video from a nearby server, which keeps start times short and quality stable, even when many people watch at the same time.

Where those servers and your storage are located also matters for privacy and compliance. More and more European organisations choose infrastructure in Europe; read more in How AudiencePlayer uses Dutch and European cloud infrastructure for secure video hosting.

Step 4: The player and adaptive bitrate streaming

The video player on the viewer’s device makes it all come together. It reads the manifest, measures the available bandwidth and the capabilities of the device, and requests the best quality that will play smoothly. This is called adaptive bitrate streaming. On a fast home connection you get full HD or 4K; on a train with a weak signal the player switches to a lower quality instead of stopping to buffer, and switches back up as soon as the connection improves.

The player also handles subtitles, multiple audio tracks and features such as continue watching, and on mobile devices and TVs it uses the device’s own hardware for efficient playback.

Protecting your stream with DRM

Encoding and a CDN make video playable, but not secure. For paid or licensed content, streams are encrypted with Digital Rights Management (DRM). Three systems cover nearly all devices: Google Widevine (Chrome, Android, many smart TVs), Apple FairPlay (Safari and Apple devices) and Microsoft PlayReady (Edge, Windows and many smart TVs). Read more in DRM protection: prevent illegal downloads and screen capturing.

What about live streaming?

Live streaming follows the same steps, only in real time. The broadcaster sends a stream from an encoder or software such as OBS to the platform, usually via RTMP or SRT. The platform encodes it into a bitrate ladder on the fly and delivers it with HLS or DASH. With standard settings a live stream typically runs several seconds behind reality; low-latency variants of HLS and DASH can reduce that delay.

What should you upload?

Encoding starts from your source file, and most failed uploads come down to that file rather than to the streaming technology. On AudiencePlayer the output is H.264 for maximum device compatibility, and every video is converted to 25 frames per second so it plays on older TVs and Cast devices too. For a smooth result, deliver:

  • An MP4 with 8-bit H.264 video in 1920×1080, or 3840×2160 for 4K, with the Rec.709 colour setting. HDR and 10-bit video are not supported: they may look fine on a Mac but fail in Firefox and on iPhones.
  • Stereo AAC audio at 48 kHz, with the right three-letter language code on each audio track.
  • Only video and audio tracks. Professional export presets often add a timecode or data track, which makes transcoding fail.
  • Short, simple file names with letters, digits, hyphens and underscores, and no extra dots. If you re-upload after an error, give the file a new name such as “film-v2.mp4”.

Processing takes roughly as long as the video itself, so a one-hour film needs about an hour after the upload has finished. In the browser, an upload is only complete when the green check mark appears; for large libraries, bulk upload via FTP is more convenient.

Streaming with AudiencePlayer

With AudiencePlayer you don’t need to manage any of these steps yourself. You upload your videos, and the platform automatically converts them for every screen and connection, delivers them through a content delivery network and plays them with adaptive streaming up to 4K, including subtitles and multiple audio tracks. DRM, screen capture protection and geo-restriction keep your content secure, and you can choose between sovereign European infrastructure and globally scalable cloud. Read more about video on demand or contact us with your questions.

Frequently Asked Questions

What is the difference between HLS and MPEG-DASH?

Both are adaptive streaming protocols that deliver video in small segments over HTTP. HLS was developed by Apple and is required for Apple devices, while MPEG-DASH is an open standard widely used on Android and smart TVs. With CMAF, one set of segments can serve both.

Which video codec is best for streaming?

There is no single best codec. H.264 plays everywhere, HEVC is efficient and common for 4K and HDR, and AV1 compresses most efficiently on devices that support it. Most platforms combine a compatible codec with a more efficient one.

Why does the quality of a stream sometimes drop?

That is adaptive bitrate streaming at work. When your connection slows down, the player switches to a lower quality to avoid buffering, and switches back up when the connection improves.

What does a CDN do for video streaming?

A CDN stores copies of your video on servers in many locations, so every viewer streams from a nearby server. That gives faster start times, fewer interruptions and enough capacity when many people watch at once.

Why does my uploaded video fail to process?

Usually because of the source file. On AudiencePlayer the most common causes are 10-bit or HDR video, 5.1 surround audio and hidden timecode or data tracks added by export presets; re-export as 8-bit H.264 with stereo AAC and upload it under a new file name.

BOOK A DEMO

Ready to start your own video platform?

See a live platform demo — 30 minutes, no obligations.