What Is a Video Codec: Everything You Need to Know About It

What-Is-a-Video-Codec-and-Everything-You-Need-to-Know-About-It

During the 2020 pandemic, while most of the world went into lockdown, streaming services saw record numbers regarding new subscribers and hours watched. According to Nielsen research, streaming went up nearly 100%.

The surge in streaming forced all major streaming platforms to agree on limiting their video content to 480p to preserve internet bandwidth for other essential services. The downgrade in quality was noticeable for those of us with 4K TVs and 1080p monitors.

Why do we notice the difference in quality more on some devices than others? It all has to do with how our brains process images and the different ways that video codecs encode information. But what is a video codec? How does it work? Why should you know about it?

We’ll answer all of these questions – and more – in the article below.

Table of Contents

  • What is a Video Codec?
  • Why Is a Video Codec Important?
  • How Do Video Codecs Work?
  • What Is Video Encoding and Decoding?
  • Commonly Used Video Codecs
  • Video Codecs vs. Video Containers
  • Uncompressed RAW vs. Compressed Raw
  • Professional vs. Consumer Video Codecs
  • What Is the Best Video Codec for Streaming?
  • The Anatomy of Video Transcoding
  • The Lifecycles of a Video
  • Conclusion

What is a Video Codec?

What is a Video Codec
Video codec is software or hardware that compresses and decompresses digital video into a usable video file.

Let’s start with the most obvious question: what are video codecs in the first place? A codec is a device or computer program that can compress or decompress digital data streams and signals. In the case of video, codecs are used to encode and decode video files.

What is video codec all about? What does the phrase mean? The term “video codec” can refer to either the hardware device or the software program. The two most common types of codecs are lossy and lossless.

Lossless codecs don’t lose any information during the compression process, while lossy codecs use data reduction techniques that sacrifice some information to achieve a higher compression ratio. Lossy codecs are further divided into two categories: intra-frame and inter-frame.

Intra-frame codecs only compress the information within each frame. In contrast, inter-frame codecs take advantage of the fact that successive frames in a video are often similar to compress the data even further.

iPhone and Mac users couldn’t stream 4K YouTube videos until Apple added a VP9 decoder to its platforms. Until iOS 14 was released, Apple and Google feuded with each other about codecs. The feud cost millions upon millions of users many hours of their lives as they watched lower-quality videos because of the codec war.

Why Is a Video Codec Important?

Every time you binge-watch your favorite series on Netflix, make a Facetime call, or share a video on your Instagram Story, you’re streaming video. And streaming video uses a lot of data.

The average Netflix HD stream requires 3-5Mbps, while a 4K UHD stream can gobble up 25Mbps or more. That’s why codecs are so important. Without codecs, we would quickly run out of internet bandwidth and be stuck watching low-quality videos.

Video codecs are why people can stream more than 1.3 billion minutes of The Mandalorian in 4K in less than a month. All platforms, from Disney Plus to Telegram, employ several codecs to ensure their videos can be compressed and streamed without hogging all the bandwidth.

How Do Video Codecs Work?

Video codecs use a variety of techniques to compress video data. The most common method is to take advantage of the fact that successive frames in a video are often similar.

Other methods include reducing the resolution of the video, using predictive coding to encode only the difference between frames, and using transform coding to represent the video data more efficiently.

A raw video file is often huge and can take up a lot of space on your hard drive. Codecs are important because they allow you to compress the video file without losing quality.

The average YouTube video length is roughly 11.7 minutes, and the average bitrate is 3.5 Mbps. If you take a typical video file and compress it using the H.264 codec, you can reduce the file size by about 70%.

What Is Video Encoding and Decoding?

Video encoding is converting a video file into a format that can be streamed over the internet. The encoded file is smaller and takes up less space on your hard drive.

Video decoding is the process of converting an encoded video file back into its original form. That’s what happens when you hit play on a YouTube or Netflix video.

Your computer or mobile device decodes the video so you can watch it. The decoding process is essential because it allows you to watch videos without using up all your internet bandwidth.

Commonly Used Video Codecs

codec for video transcoding
The right Codecs, bitrate, resolution, and file size settings ensure your viewers the best possible quality allowed by their bandwidth and devices.

There are dozens of video codecs today, but some are more common than others. Let’s take a look at some of the most common codecs in use today:

MPEG–4

Developed by the Moving Picture Experts Group (MPEG), MPEG-4 is a popular video codec offering high compression rates while maintaining good image quality. It is used in various applications, including streaming video, video conferencing, and editing.

Pros:

  • MPEG-4 offers very high compression rates.
  • It can be used for both lossy and lossless compression.
  • The codec is widely used and supported by many devices and software applications.

Cons:

  • It can be computationally intensive, leading to real-time encoding/decoding issues.

H.264/AVC

What is open H.264 video codec? Also developed by the MPEG group, H.264 is a newer codec that offers even higher compression rates than MPEG-4 while maintaining good image quality. Video streaming, conferencing, and editing are some of the most common uses for H.264.

Pros:

  • A decade of development worked out most of the problems.
  • Great for streaming, and has a large user base.
  • Royalty payments are a known quantity.

Cons:

  • A bit outdated.
  • Not suitable for 4K content.

H.265/HEVC

The newest codec on this list, HEVC, was developed as a successor to H.264. It offers even higher compression rates than H.264, making it ideal for streaming 4K video and other data-intensive applications.

Pros:

Cons:

  • Not widely adopted yet.
  • 8K content isn’t all that popular.
  • Complex licensing system.

VP8 – VP9

Developed by Google, VP8, and VP9 are video codecs designed for use in web browsers. You can find VP8 and VP9 video codecs built into the HTML5 standard, making them widely compatible with web browsers and devices.

Pros:

  • Open source, great for programmers.
  • Ability to stream in 4K.
  • Compatible with several devices.

Cons:

  • Unsupported on Apple devices.

AV1

The newest video codec on this list is AV1, developed by the Alliance for Open Media. AV1 is royalty-free and open-source, making it a more attractive option for many applications.

Pros:

  • Open-source.
  • 30% more efficient than H.265/HEVC.

Cons:

  • Still not widely adopted since it’s new.

Video Codecs vs. Video Containers

It’s important to understand the difference between video codecs and video containers:

  • A video container is a file format that can hold one or more audio and/or video streams and other data, such as subtitles or metadata. Common video containers include MP4, AVI, and MKV.
  • A video codec is an algorithm that encodes and/or decodes video data. Codecs are used to compress and decompress video data. A codec can be stored in a container, or it can be stored in its own file format. Some common codecs include H.264, MPEG-4, and VP8.

A container can hold multiple codecs, and a codec can be used in multiple containers.

Uncompressed RAW vs. Compressed Raw

A raw uncompressed video can be compressed using one of the video codecs before transmitting it to a network or a video hosting platform to make it available to the consumers. Uncompressed videos are perfect for filmmakers. They allow them to store high-quality video and edit it without losing quality.

Compressed raw video is a digital video that has been compressed using a video codec. The compression process reduces the amount of data that needs to be stored, making it easier to transmit and playback the video.

The first few seasons of BBC’s hit show Peaky Blinders were shot on an ARRI camera in ARRIRAW format. Unlike VP9 or ProRes Raw, ARRIRAW is not a video codec. It’s a format that gives you uncompressed, uncompromised data.

You can view it as a digital camera version of a negative. Once you have the data, you can compress it in various ways to make it more manageable. The image quality will be the same no matter how you compress it.

Compressed raw video has become more popular in recent years as storage and bandwidth costs have decreased. Many professional cameras offer compressed raw options, including the Panasonic Varicam LT and the Canon C200.

Professional vs. Consumer Video Codecs

Professional Video Codecs
You need to know what video codec is and how to choose the right one for your needs.

There are two main types of video codecs: professional and consumer.

Professional Video Codecs

These video codecs are designed for use in high-end applications, such as broadcast television and filmmaking. They offer the highest possible video quality and compression rates.

Some common professional video codecs include MPEG-2, H.265/HEVC, and ProRes.

Consumer Video Codecs

On the other hand, a consumer video codec is designed for lower-end applications, such as streaming video and DVD playback. They offer good video quality and compression rates but are not as high-end as professional codecs.

Some common consumer video codecs include MPEG-4, H.264/AVC, and VP8/9.

What Is the Best Video Codec for Streaming?

The answer to this question depends on many factors, including your budget, the quality of your internet connection, and the type of devices you’re using.

If you’re looking for a video streaming solution compatible with a wide range of devices and doesn’t require a lot of bandwidth, H.264/AVC is a good option.

What is the best video codec for quality? If you’re looking for the best video quality possible, H.265/HEVC is the codec you should use. As for low-latency streaming, VP9 is the best option.

The Anatomy of Video Transcoding

What is codec video transcoding? Video transcoding is the process of converting video from one codec to another. Transcoding is often necessary when you need to convert video from one format to another or when you want to change the bitrate, resolution, or other parameters of a video file.

The transcoding process usually consists of four main steps:

  1. Decoding: The first step is to decode the video from its current codec to an intermediate codec. This step is necessary because most video editing software only supports a handful of codecs.
  2. Encoding: Once the video has been decoded, it can be encoded into the new codec.  Loss of quality is pretty much inevitable during this step.
  3. Quality Adjustment: Sometimes, you may need to adjust the video’s quality settings before encoding it into the new codec. For example, you may need to lower the bitrate or resolution if the target codec doesn’t support high-quality video.
  4. Encoding: The video is encoded into the new codec and saved in the desired format.

The Lifecycles of a Video

How does a website or an app know what video codec to use to provide the best experience for its users?

It’s basically a three-step process:

  1. User-agent detection: Every time a user requests to stream a video, the server will run a script that collects metadata on their device, browser, or app. That data is then used to identify which codecs are supported by that particular user’s setup.
  2. Best codec identification: Once the server has a list of all the codecs that the user can handle, it will select the best one based on several factors, including quality, bitrate, and resolution.
  3. Video reproduction: Finally, when the server has selected the best codec, it will start streaming the video using that codec. If the user’s device or browser doesn’t support that codec, the server will automatically switch to another codec that the user can handle.

Conclusion

Today, we rely on mobile devices for educational and entertainment purposes. Over 50% of mobile traffic globally comes from YouTube and Netflix streaming videos. As the demand for mobile video content grows, so does the need for efficient video codecs that provide good-quality video without too much bandwidth.

Knowing the answer to the question “what is video codec” is essential for developers, engineers, and anyone who wants to understand better how mobile video content is delivered to their devices. Without codecs, we wouldn’t be able to enjoy the wide range of video content available today. So, the next time you’re streaming a video on your phone, take a moment to think about the codec used to deliver that content to you.

Are you looking to start live streaming or improve your professional live streaming experience? Why not give Dacast a try?

Dacast helps a wide range of businesses get started with live streaming. If you’d like to try out our services, you can check out how our live streaming platform could boost your business with our 14-day free trial.

All you have to do to get started is create a Dacast account today. No credit card is required.

GET STARTED FOR FREE

Feel free to join our LinkedIn group for regular tips on live streaming.

Thanks for reading, and good luck with your broadcasts!

Frederik Nielsen

Frederik is a writer, marketer, podcaster, musician, tech enthusiast, and overall curious person.