---
title: What Is a Codec? Video and Audio Codecs Explained
description: Learn what is a codec, how video codec and audio codecs compress media, with codecs explained simply.
image: https://blog.blazingcdn.com/hubfs/Gemini-Blog/image-Oct-07-2026-07-30-22-8193-AM.jpeg
---

[![BlazingCDN](https://blog.blazingcdn.com/hubfs/Logo/blog-logo-w.png)](https://blog.blazingcdn.com?hsLang=en-us)

[📘Learn ▾](https://blog.blazingcdn.com/cdn-learn?hsLang=en-us)

[CDN Fundamentals](https://blog.blazingcdn.com/cdn-fundamentals?hsLang=en-us) [By Content Type](https://blog.blazingcdn.com/by-content-type?hsLang=en-us) [Advanced Concepts](https://blog.blazingcdn.com/advanced-concepts?hsLang=en-us) [Glossary](https://blog.blazingcdn.com/glossary?hsLang=en-us)

[⚡ Web Performance](https://blog.blazingcdn.com/web-performance?hsLang=en-us)

[🎬Video & Streaming ▾](https://blog.blazingcdn.com/video-streaming-cdn?hsLang=en-us)

[🔴 Live Streaming](https://blog.blazingcdn.com/live-streaming?hsLang=en-us) [📺 VOD & OTT](https://blog.blazingcdn.com/vod-ott?hsLang=en-us) [💰 Bandwidth & Costs](https://blog.blazingcdn.com/bandwidth-costs?hsLang=en-us)

[🏭 Other Industries ▾](https://blog.blazingcdn.com/cdn-industry-insights?hsLang=en-us)

[📺 Media & Broadcasting](https://blog.blazingcdn.com/media-broadcasting?hsLang=en-us) [💾 Software & SaaS](https://blog.blazingcdn.com/software-saas?hsLang=en-us) [🏗️ DevOps & Cloud Infra](https://blog.blazingcdn.com/devops-cloud-infra?hsLang=en-us) [📚 AdTech & Advertising](https://blog.blazingcdn.com/adtech-advertising?hsLang=en-us) [🎮 Gaming & Esports](https://blog.blazingcdn.com/gaming-esports?hsLang=en-us) [📱 Mobile Apps & Developers](https://blog.blazingcdn.com/mobile-apps-developers?hsLang=en-us) [🤖 AI & Machine Learning](https://blog.blazingcdn.com/ai-machine-learning?hsLang=en-us) [🏛️ Enterprise & Corporate](https://blog.blazingcdn.com/enterprise-corporate?hsLang=en-us) [📚 E-Learning & EdTech](https://blog.blazingcdn.com/e-learning-edtech?hsLang=en-us) [🏟️ Sports & Live Events](https://blog.blazingcdn.com/sports-live-events?hsLang=en-us)

[💰 Pricing & Costs ▾](https://blog.blazingcdn.com/cdn-pricing-and-cdn-costs?hsLang=en-us)

[Provider Pricing](https://blog.blazingcdn.com/provider-pricing?hsLang=en-us) [Cost Optimization](https://blog.blazingcdn.com/cost-optimization?hsLang=en-us) [Decision Support](https://blog.blazingcdn.com/decision-support?hsLang=en-us)

[⚡Compare ▾](https://blog.blazingcdn.com/cdn-comparison?hsLang=en-us)

[Provider Comparisons](https://blog.blazingcdn.com/provider-comparisons?hsLang=en-us) [Strategy Comparisons](https://blog.blazingcdn.com/strategy-comparisons?hsLang=en-us) [Ratings & Benchmarks](https://blog.blazingcdn.com/cdn-ratings-and-benchmarks?hsLang=en-us)

[📊 Benchmarks](https://blog.blazingcdn.com/cdn-ratings-and-benchmarks?hsLang=en-us)

[🔒 Security ▾](https://blog.blazingcdn.com/cdn-security?hsLang=en-us)

[Attack Protection](https://blog.blazingcdn.com/attack-protection?hsLang=en-us) [Encryption & Access](https://blog.blazingcdn.com/encryption-access?hsLang=en-us) [Video & DRM Security](https://blog.blazingcdn.com/video-drm-security?hsLang=en-us)

[📁 Case Studies](https://blog.blazingcdn.com/case-studies?hsLang=en-us) [🔌 Integrations](https://blog.blazingcdn.com/integrations?hsLang=en-us) [🛠️ Tools](https://blog.blazingcdn.com/cdn-tools?hsLang=en-us)

[Get Started](https://blazingcdn.com/sign-up-contact-form/)

[Learn](https://blog.blazingcdn.com/en-us/tag/learn) [Video - Video & Streaming](https://blog.blazingcdn.com/en-us/tag/video-video-streaming) [Learn - CDN Fundamentals](https://blog.blazingcdn.com/en-us/tag/learn-cdn-fundamentals)

# What Is a Codec? Video and Audio Codecs Explained

 BlazingCDN  Oct 7, 2026, 9:32:17 AM

![](https://blog.blazingcdn.com/hubfs/Gemini-Blog/image-Oct-07-2026-07-30-22-8193-AM.jpeg)

A codec (short for coder-decoder) is an algorithm, plus the software or hardware that implements it, that compresses raw video or audio into a compact bitstream and decompresses it for playback. That is the whole answer to what is a codec: raw 1080p60 video runs about 1.5 Gb/s, and H.264 delivers it at roughly 5 Mb/s, about 300 times smaller.

As of 2026, H.264 (standardized in 2003) is still the most widely decodable video codec, while AV1 (released by the Alliance for Open Media in 2018) typically needs about 50 percent less bitrate than H.264 for the same visual quality. On the audio side, AAC remains the default for HLS delivery, and Opus (RFC 6716, 2012) dominates real-time voice and WebRTC.

## **How a video codec encodes and decodes a frame**

A video codec removes redundancy in four stages: prediction, transform, quantization and entropy coding. Only quantization discards information, which is why it is the main knob behind the quality and bitrate trade-off. The decoder runs the same stages in reverse and rebuilds an approximation of each frame.

- **Prediction.** Intra prediction guesses a block from its neighbors in the same frame. Inter prediction copies a block from a reference frame and shifts it by a motion vector. Only the residual (the difference) moves on.
- **Transform.** The residual is converted to frequency coefficients with an integer approximation of the discrete cosine transform, which packs most of the energy into a few values.
- **Quantization.** Coefficients are divided and rounded. A higher quantization parameter (QP) means fewer bits and more artifacts.
- **Entropy coding.** CABAC in H.264 and HEVC, or a multi-symbol arithmetic coder in AV1, squeezes the remaining symbols losslessly.

Frames come in three types. I-frames (keyframes) decode on their own, P-frames reference earlier frames, and B-frames reference both directions, so decode order differs from display order. The group of pictures (GOP) runs from one keyframe to the next, and for adaptive streaming it must align with segment boundaries: a 2-second segment at 30 fps needs a keyframe every 60 frames or players cannot switch renditions cleanly. Rate control (constant rate factor, capped VBR or CBR) decides how the bit budget is spread across frames.

Audio codecs follow the same logic in a different domain. AAC and Opus run a modified discrete cosine transform on short windows and use a psychoacoustic model to spend bits only where the ear can hear the difference.

## **Where a video codec sits in the streaming stack**

The codec lives at the very start and the very end of the delivery path. A typical pipeline runs: capture, encode into an ABR ladder, package into fragmented MP4 or MPEG-TS segments, publish HLS or DASH manifests, cache on a CDN, then demux and decode on the device, usually in a hardware decoder block.

Everything in the middle is codec-agnostic. The CDN serves bytes and never inspects the bitstream, but the codec decides how many bytes there are, so encoder choices show up one to one in delivered terabytes. BlazingCDN, for example, does not transcode; it delivers the HLS, LL-HLS or DASH segments your encoder already produced, and the [**CDN cost calculator for video egress**](https://blazingcdn.com/cdn-cost-calculator/) shows what each codec's bitrate savings are worth in delivered TB.

## **Video and audio codecs explained: H.264 vs HEVC vs AV1 vs AAC vs Opus**

The right codec is the one your audience's devices can decode in hardware at the lowest bitrate for acceptable quality. Bitrate figures below are typical 2026 ranges for a 1080p top rung or stereo audio, and real numbers vary by content complexity and encoder settings.

| Codec | Type and year | Typical bitrate | Licensing | Decode coverage |
| --- | --- | --- | --- | --- |
| H.264 (AVC) | Video, 2003 | 4–6 Mb/s | Patent pool | Near universal hardware decode |
| HEVC (H.265) | Video, 2013 | 2.5–3.5 Mb/s | Several patent pools | Most phones and TVs; uneven in browsers |
| AV1 | Video, 2018 | 2–2.5 Mb/s | Royalty-free | Hardware on newer devices; software elsewhere |
| AAC (LC and HE) | Audio, 1997 | 128 kb/s LC; 48–64 kb/s HE | Licensed | Universal; default for HLS |
| Opus | Audio, 2012 | 6–510 kb/s range; 96–128 kb/s music | Royalty-free | All major browsers; mandatory in WebRTC |

Newer codecs cut bitrate by up to half, but only hardware decode coverage tells you how much of your audience can actually receive them.

### What codec choice does to egress: a worked calculation

Take one million viewing hours on the 1080p top rung. At 5 Mb/s, one hour is 5 × 3,600 = 18,000 megabits, or 2.25 GB, so H.264 delivers about 2,250 TB. HEVC at 3 Mb/s delivers about 1,350 TB, and AV1 at 2.5 Mb/s about 1,125 TB (our estimates from the typical bitrates above).

The catch is coverage. If 40 percent of viewing happens on devices that decode AV1 in hardware, the blended saving is 0.4 × 1,125 = 450 TB, not 1,125 TB, and you now store and package two ladders. AV1 also encodes several times slower than H.264 at comparable presets, so the compute pays off on titles with heavy viewing and often does not on the long tail. A practical rule: encode AV1 for the head of the catalog, keep H.264 for everything, and revisit the cutoff as device share moves.

## **Codec vs. container, profile and protocol**

**Codec vs. container:** the codec compresses the media, the container wraps it. MP4, fragmented MP4, MPEG-TS, WebM and MKV hold one or more codec streams plus timing and metadata. An MP4 file can carry H.264, HEVC or AV1 video, so a file extension says nothing reliable about the codec inside.

**Codec vs. profile and level:** profiles define which coding tools a stream may use (H.264 Baseline, Main, High; HEVC Main 10), and levels cap resolution, frame rate and bitrate. A device that supports HEVC may still reject a 10-bit stream if it only decodes the Main profile.

**Codec vs. streaming protocol:** HLS and DASH describe how segments are listed and fetched over HTTP; they do not compress anything. The same AV1 segments can be referenced from both an HLS playlist and a DASH manifest when packaged as CMAF.

## **Reading codec strings in HLS and DASH manifests**

Players decide whether they can play a rendition before downloading it by reading the CODECS attribute in the HLS multivariant playlist or the codecs attribute in a DASH Representation, both using the RFC 6381 syntax. These strings are the quickest way to audit what your packager actually emits.

- **avc1.640028**: H.264 High profile, level 4.0, enough for 1080p30.
- **hvc1.2.4.L123.B0**: HEVC Main 10, level 4.1, with the hvc1 sample entry that Apple devices expect.
- **av01.0.08M.08**: AV1 Main profile, level 4.0, Main tier, 8-bit.
- **mp4a.40.2**: AAC-LC. **mp4a.40.5** signals HE-AAC.
- **opus**: Opus audio, common in DASH and WebM, rarely in HLS.

A mismatched string (a level that is too low, or hev1 instead of hvc1 for Safari) causes playback failures that look like network errors in client analytics, so check it before blaming the delivery path.

## **Common misconceptions about audio codecs and video codecs**

- **"A newer codec always looks better."** At high bitrates, H.264, HEVC and AV1 converge in perceived quality. The gains are largest at low bitrates and high resolutions.
- **"AV1 is free, so it is cheaper."** Royalty-free licensing removes patent fees, not encode compute, storage of a second ladder or battery drain from software decode on older phones.
- **"Opus should replace AAC everywhere."** Opus is more efficient at low bitrates, but HLS ecosystems and many TVs still expect AAC, so AAC remains the safe default for VOD and live HLS.
- **"The CDN can fix a heavy bitrate."** HTTP compression such as gzip or Brotli does nothing to already compressed media segments. Only the encoder reduces those bytes.

## **FAQ: what is a codec and how to pick one for streaming**

### What is the difference between a codec and a file format?

A codec compresses and decompresses the media, while a file format, or container, packages the compressed streams with timing and metadata. MP4 and MKV are containers that can hold H.264, HEVC, AV1, AAC or Opus. Two MP4 files can therefore require completely different decoders, which is why players read the codec string rather than the extension.

### Which video codec is best for streaming in 2026?

For maximum reach, H.264 remains the baseline video codec for streaming in 2026 because nearly every device decodes it in hardware. Add HEVC for Apple devices and TVs, and AV1 for newer hardware where bandwidth savings matter most. Most large services ship two or three codec ladders and let the player pick from the manifest codec strings.

### Is AAC or Opus better for audio streaming?

For HLS video-on-demand and live streaming, AAC is the safer audio codec because Apple's ecosystem and most TVs expect it. Opus delivers better quality at low bitrates and very low latency, which is why WebRTC requires it. Opus is a strong default for browser-based and real-time audio, while AAC wins on device compatibility.

### Does a better codec reduce CDN bandwidth costs?

Yes, a more efficient codec reduces delivered bytes almost one to one, so AV1 at roughly half the bitrate of H.264 roughly halves egress for viewers who receive it. The real saving depends on the share of viewing on devices that decode the newer codec, and on extra encode compute and storage for a second rendition ladder.

## **Audit your codec ladder and price the bandwidth difference**

This week, pull the CODECS attributes from your production manifests and join your player logs on decoder capability. Compute the share of viewing hours that could receive HEVC or AV1 in hardware, then multiply that share by the bitrate gap on your top two rungs. That single number tells you whether a second encode ladder pays for its compute and storage, or whether tightening H.264 rate control is the better use of a sprint.

If you deliver pre-encoded HLS, LL-HLS or DASH segments at volume, the [**BlazingCDN HLS streaming CDN**](https://blazingcdn.com/streaming-cdn/) page describes how those segments are served, with a 14-day testing period on real production traffic.

Share: [f](https://www.facebook.com/sharer/sharer.php?u=https://blog.blazingcdn.com/en-us/what-is-a-codec-video-and-audio-codecs-explained) [in](https://www.linkedin.com/sharing/share-offsite/?url=https://blog.blazingcdn.com/en-us/what-is-a-codec-video-and-audio-codecs-explained) [𝕏](https://twitter.com/intent/tweet?url=https://blog.blazingcdn.com/en-us/what-is-a-codec-video-and-audio-codecs-explained&text=) [✉](mailto:?subject=%3Cspan%20id="hs_cos_wrapper_name"%20class="hs_cos_wrapper%20hs_cos_wrapper_meta_field%20hs_cos_wrapper_type_text"%20style=""%20data-hs-cos-general-type="meta_field"%20data-hs-cos-type="text"%20%3EWhat%20Is%20a%20Codec?%20Video%20and%20Audio%20Codecs%20Explained%3C/span%3E&body=https://blog.blazingcdn.com/en-us/what-is-a-codec-video-and-audio-codecs-explained)

![BlazingCDN](https://blog.blazingcdn.com/hs-fs/hubfs/Logo/blog-logo-w.png?height=24&name=blog-logo-w.png)

*Heavy traffic.*  
Light bill.

The CDN for video and large traffic

Their monthly bill vs ours

- 20 TBFastly $2,087**$92.50**
- 50 TBCDN77 $990**$215**
- 200 TBCloudFront $11,965**$765**

Published list prices, Aug 2026

[Calculate your cost](https://blazingcdn.com/cdn-cost-calculator/?utm_source=blog&utm_medium=sidebar&utm_campaign=blog_sidebar&utm_content=compare_calc)

## Related posts

[![](https://blog.blazingcdn.com/hubfs/Gemini-Blog/image-Oct-07-2026-07-01-07-5337-AM.jpeg)](https://blog.blazingcdn.com/en-us/apple-cdn-infrastructure-icloud-apple-tv-scale-globally?hsLang=en-us)

Learn

### [Apple CDN Explained: How iCloud, App Store and Apple TV Deliver](https://blog.blazingcdn.com/en-us/apple-cdn-infrastructure-icloud-apple-tv-scale-globally?hsLang=en-us)

The Apple CDN is a layered stack rather than one network. It combines Apple's own edge caches, many embedded inside ISP ...

Oct 7, 2026, 9:03:52 AM [Read more](https://blog.blazingcdn.com/en-us/apple-cdn-infrastructure-icloud-apple-tv-scale-globally?hsLang=en-us)

[![](https://blog.blazingcdn.com/hubfs/Gemini-Blog/image-Oct-06-2026-07-30-20-2950-AM.jpeg)](https://blog.blazingcdn.com/en-us/what-is-video-compression-how-codecs-shrink-video?hsLang=en-us)

Learn

### [What Is Video Compression? How Codecs Shrink Video](https://blog.blazingcdn.com/en-us/what-is-video-compression-how-codecs-shrink-video?hsLang=en-us)

Video compression is the process of encoding moving images into far fewer bits by removing spatial redundancy inside ...

Oct 6, 2026, 9:32:08 AM [Read more](https://blog.blazingcdn.com/en-us/what-is-video-compression-how-codecs-shrink-video?hsLang=en-us)

[![BlazingCDN](https://blog.blazingcdn.com/hubfs/Logo/blog-logo-w.png)](https://blog.blazingcdn.com?hsLang=en-us)

[📘 Learn](https://blog.blazingcdn.com/cdn-learn?hsLang=en-us) [📊 Benchmarks](https://blog.blazingcdn.com/cdn-ratings-and-benchmarks?hsLang=en-us) [🎬 Video & Streaming](https://blog.blazingcdn.com/video-streaming-cdn?hsLang=en-us) [🏭 Industries](https://blog.blazingcdn.com/cdn-industry-insights?hsLang=en-us) [💰 Pricing & Costs](https://blog.blazingcdn.com/cdn-pricing-and-cdn-costs?hsLang=en-us) [⚡ Compare](https://blog.blazingcdn.com/cdn-comparison?hsLang=en-us) [🔒 Security](https://blog.blazingcdn.com/cdn-security?hsLang=en-us) [🛠️ Tools](https://blog.blazingcdn.com/cdn-tools?hsLang=en-us) [✍️ Publish with us](https://blog.blazingcdn.com/publish-with-us?hsLang=en-us)

in f 𝕏 ✉

 Copyright © BlazingCDN |. All rights reserved.

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blazingcdn.com/#organization",
  "@type" : "Organization",
  "description" : "High-volume CDN for video, live streaming, OTT/IPTV, software, games, SaaS and large-file delivery.",
  "logo" : {
    "@id" : "https://blazingcdn.com/#logo",
    "@type" : "ImageObject",
    "height" : 560,
    "url" : "https://blazingcdn.com/wp-content/uploads/2024/08/logo-560-560.png",
    "width" : 560
  },
  "name" : "BlazingCDN",
  "sameAs" : [ "https://www.linkedin.com/company/68261278", "https://x.com/BlazingCdn", "https://twitter.com/BlazingCdn", "https://www.facebook.com/BlazingCDN", "https://www.reddit.com/r/BlazingCDN/" ],
  "url" : "https://blazingcdn.com/"
}
```

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blog.blazingcdn.com/#website",
  "@type" : "WebSite",
  "inLanguage" : "en-US",
  "name" : "BlazingCDN Blog",
  "publisher" : {
    "@id" : "https://blazingcdn.com/#organization"
  },
  "url" : "https://blog.blazingcdn.com/"
}
```

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blog.blazingcdn.com/en-us/what-is-a-codec-video-and-audio-codecs-explained#article",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "BlazingCDN"
  },
  "dateModified" : "2026-10-07T07:32:17Z",
  "datePublished" : "2026-10-07T07:32:17Z",
  "description" : "Learn what is a codec, how video codec and audio codecs compress media, with codecs explained simply.",
  "headline" : "What Is a Codec? Video and Audio Codecs Explained",
  "image" : "https://143144902.fs1.hubspotusercontent-eu1.net/hubfs/143144902/Gemini-Blog/image-Oct-07-2026-07-30-22-8193-AM.jpeg",
  "inLanguage" : "en-us",
  "isPartOf" : {
    "@id" : "https://blog.blazingcdn.com/#website"
  },
  "mainEntityOfPage" : {
    "@id" : "https://blog.blazingcdn.com/en-us/what-is-a-codec-video-and-audio-codecs-explained",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@id" : "https://blazingcdn.com/#organization"
  },
  "wordCount" : 1735
}
```

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blog.blazingcdn.com/en-us/what-is-a-codec-video-and-audio-codecs-explained#breadcrumb",
  "@type" : "BreadcrumbList",
  "itemListElement" : [ {
    "@type" : "ListItem",
    "item" : "https://blog.blazingcdn.com/en-us",
    "name" : "Blog",
    "position" : 1
  }, {
    "@type" : "ListItem",
    "item" : "https://blog.blazingcdn.com/en-us/what-is-a-codec-video-and-audio-codecs-explained",
    "name" : "What Is a Codec? Video and Audio Codecs Explained",
    "position" : 2
  } ]
}
```

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blog.blazingcdn.com/en-us/what-is-a-codec-video-and-audio-codecs-explained#faq",
  "@type" : "FAQPage",
  "mainEntity" : [ {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "A codec compresses and decompresses the media, while a file format, or container, packages the compressed streams with timing and metadata. MP4 and MKV are containers that can hold H.264, HEVC, AV1, AAC or Opus. Two MP4 files can therefore require completely different decoders, which is why players read the codec string rather than the extension."
    },
    "name" : "What is the difference between a codec and a file format?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "For maximum reach, H.264 remains the baseline video codec for streaming in 2026 because nearly every device decodes it in hardware. Add HEVC for Apple devices and TVs, and AV1 for newer hardware where bandwidth savings matter most. Most large services ship two or three codec ladders and let the player pick from the manifest codec strings."
    },
    "name" : "Which video codec is best for streaming in 2026?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "For HLS video-on-demand and live streaming, AAC is the safer audio codec because Apple's ecosystem and most TVs expect it. Opus delivers better quality at low bitrates and very low latency, which is why WebRTC requires it. Opus is a strong default for browser-based and real-time audio, while AAC wins on device compatibility."
    },
    "name" : "Is AAC or Opus better for audio streaming?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Yes, a more efficient codec reduces delivered bytes almost one to one, so AV1 at roughly half the bitrate of H.264 roughly halves egress for viewers who receive it. The real saving depends on the share of viewing on devices that decode the newer codec, and on extra encode compute and storage for a second rendition ladder."
    },
    "name" : "Does a better codec reduce CDN bandwidth costs?"
  } ]
}
```