1. Video
  2. Post-Production
  3. Video Editing

What is a Video Codec (Complete Guide for 2025)

Scroll to top
17 min read

There’s a crucial element to getting your videos playing correctly in different places, and it's a - sometimes complicated - balance between quality and size. Much of this comes down to video codecs, so in this article, we’ll walk you through what a video codec is and everything you’ll need to know to make the right choices when it comes to your projects.

What is a Video Codec (Complete Guide for 2024)

What is a Video Codec?

Codec is a shorthand combination of compression-decompression or encoder-decoder. They help digital video data to be efficiently compressed for storage and transmission, and then decompressed again for playback. They reduce the size of video files without significant loss in quality, or at least, they do when you use the right one.

Video codecs use various algorithms and techniques to remove redundant or unnecessary data, and this compression makes it possible to store more videos using less storage space, and to transmit them over the internet easily. It's a crucial balance between keeping that all-important quality, but having a manageable file size.

A Brief History of Codecs – What is a Codec in Video?

books in a pilebooks in a pilebooks in a pile

We promise this bit won’t get too heavy. Prior to digital, video content was typically recorded as an analogue signal on magnetic tape (video tape) but when CDs arrived, you could then store and transmit video using those, too! Of course, this then threw up the problem of storage and bandwidth limitations, and so the boffins needed to find ways to reduce the data associated with video content. In 1974, Nasir Ahmed, T. Natarajan, and K. R. Rao came up with discrete cosine transform (DCT) compression methods.

During the late 1980s, some companies began experimenting with DCT-based lossy compression for video encoding, leading to the creation of the H.261 standard. H.261 was, essentially, the inception of practical video coding standards. Since then, DCT compression techniques have been incorporated into all major video coding standards that have followed.

Okay, that was quite a lot. Let’s get back to how this is relevant to your video work.

What is a Codec in Video: The Role of Video Codecs

We’ve touched on this, but here’s what you need to know about what a codec in video actually does.

  1. Compression: The main function of video codecs is to compress video data. This compression is essential for reducing the file size, making videos more manageable for storage, and efficient for transmission.
  2. Quality preservation: While compression reduces file size, it can’t compromise the quality to an extent where we can see degradation. Modern video codecs try to balance a decent level of compression while keeping the quality high.
  3. Playback: Codecs also play a role in the decompression and playback of video files. They ensure that the compressed video data is properly reconstructed for viewing. Think of compression as packing a suitcase, it then needs unpacking when it gets to its destination.
  4. Streaming: For online platforms like Netflix, YouTube, and others, video codecs enable smooth streaming by efficiently transmitting data over the internet and adapting to a variety of network conditions.
  5. Compatibility: Video codecs ensure that video files can be played on a range of devices and software applications. They act as a common language for digital video.

A Small Aside: Understanding Video Containers

a woman looking at her phone with a confused face a woman looking at her phone with a confused face a woman looking at her phone with a confused face

There’s a distinction between video codecs and video container formats even though you might actually see them used interchangeably. Video container formats, (sometimes called wrappers), are specific file formats created to hold information like video, audio, subtitles, and so on. Containers, as you’d imagine from their name, are for storage, and their role related to codecs is to have the codec in there and then ‘open’ to let it do its job. A bit like a box! That said, not all playback platforms support every container or codec. That’s why multi-format encoding is important if you’re distributing content to a range of platforms or devices.

Some of the most common video container formats include:

  • MP4: MP4 is widely used for online streaming and storing video on devices. It's compatible with a range of video codecs.

  • MKV (Matroska): MKV is known for its flexibility, supporting various video and audio codecs as well as subtitles. It's mostly used for high-definition video files. It's an open standard, which means it can be used by anyone for anything. 

  • AVI: AVI (Audio Video Interleave) is an older container format sometimes used for Windows-based applications. It’s not as efficient as more modern containers, but is still in use.

  • MOV: MOV (sometimes QuickTime File Format or QTFF) is a container format by Apple for QuickTime. It's popular for Apple devices and editing software but can also contain video encoded with various codecs.

  • WebM: WebM is a royalty free alternative to HTML5 (video and audio), an open-source container developed for web video. It's optimised for use with the VP9 video codec and its development is Google sponsored.

The right container selection and codec pairing are vital for smooth video playback and distribution.

Another Small Aside: Understanding Video Bitrate

While video codecs are responsible for compressing video data, video bitrate is essential for quality. Bitrate refers to the rate that video data is transmitted or consumed per unit of time, and that’s usually measured in bits per second (bps) or kilobits per second (Kbps). It directly influences the quality of the video. To put it in simple terms: a higher bitrate equals better video quality.

  • High bitrates are needed for high-definition (HD) and ultra-high-definition (UHD) content. It preserves fine details, colours, and smooth motion. Streaming services generally use higher bitrates for premium subscribers.

  • Medium bitrates are okay when it comes to standard-definition (SD) and some HD content. The video quality might not be as crisp as higher bitrates, but it's generally acceptable for most viewers.

  • Low bitrates are used for applications with limited bandwidth, like mobile networks. They result in lower video quality, with noticeable compression artefacts like pixelation, blurring, and banding.

  • Constant vs. Variable Bitrate: Some video codecs use variable bitrate (VBR) encoding, where the bitrate adapts to the complexity of the video. Constant bitrate (CBR) encoding keeps the bitrate consistent through the video. VBR can provide better quality for the same average bitrate but might cause problems when streaming with limited bandwidth.

What Are the Most Common Video Codecs?

There are several video codecs to choose from, and each does its thing with its own advantages and disadvantages. Here are some of the most common ones:

Codec Description Common Containers
     
H.264/AVC You’ll likely have heard of, or already used H.264. It’s been widely used for streaming, video conferencing, and for Blu-ray discs, H.264 is a good mix of compression efficiency and video quality. It's a standard for many applications. MP4, MKV, AVI, MOV, FLV, 3GP
     
H.265/HEVC The successor to H.264, H.265 has even better compression efficiency, making it a good choice for 4K and 8K video, though it takes faster computers for its encoding and decoding. MP4, MKV, MOV, AVI
     
VP9 Developed by Google, VP9 is an open-source codec that competes with H.265. It's often used for web video, especially on platforms like YouTube. Its predecessor was VP8 which was H.264’s competitor. WebM, MKV
     
AV1 Another open-source codec, AV1 offers competitive compression efficiency and is gaining popularity for web video and streaming via a royalty-free licensing model. MKV, WebM, MP4
     
MPEG-2 An older codec, MPEG-2 was widely used for DVDs and cable television. It's still used in some broadcast applications. MPEG, VOB (often used for DVDs)
     
MPEG-4 Part of the MPEG standard, MPEG-4 is versatile and supports a wide range of multimedia applications, including video conferencing and mobile video. MP4, MOV, AVI, MKV

Different software and hardware might support additional container formats, so it’s wise to check your specific case before choosing. Wikipedia has a comparison table of container formats.

FREE
7 Minutes

How to Use OBS to Stream With Custom Animations and Overlays

Learn how to easily add custom animations in OBS and set them up to be triggered during your live stream. Tom will walk you through the process of exporting custom animations on a transparent layer from After Effects and then setting up your OBS studio into Scenes, Sources and Assets as well as how to trigger your scenes in OBS using an Elgato Stream Deck and OBS hotkeys.

    How Video Codecs Work - Compression

    cutting up watermeloncutting up watermeloncutting up watermelon

    To get how video codecs work, it's important to understand compression. Video compression involves two types: lossless and lossy.

    Lossless compression keeps all of the original data, which means no loss in quality, but usually means quite large file sizes.

    Lossy compression ditches some data to reduce file size. Video codecs mostly use lossy compression because it's more practical to have lower file sizes.

    If the compression is too much, you’ll start to get noticeable issues in your video. Things like: blockiness, visible banding, and artefacting. Your choices (in most cases) should aim to preserve visual quality above all else.

    Hardware and Software Codecs – Are They Different?

    Yes, there are differences between hardware and software codecs in terms of performance and efficiency.

    Hardware Codecs are specialised chips or components built into devices like smartphones, digital cameras, and dedicated video encoding/decoding hardware. They’re designed for efficient, real-time video processing, so they’re great for power-hungry applications like recording high-quality video, or demanding video games.

    Software Codecs: Software codecs rely on your computer processor to perform video compression and decompression. They’re more flexible, but typically need more processing power, so they’re less efficient for certain tasks.

    How Do Video Codecs Affect Streaming Quality?

    The choice of codec determines how efficiently video data is transmitted and how it adapts to various network conditions, so when it comes to streaming, they can definitely affect quality.

    • Compression Efficiency: The codec's compression efficiency affects how well video can be delivered at lower bitrates. Efficient codecs minimise buffering (pre-loaded segments of video) for smoother streaming.

    • Adaptive Streaming: This involves delivering multiple versions of the same video at different bitrates, and relies on video codecs that can switch between these versions based on the network conditions of the person watching, so the quality is adjusted in real time!

    • Latency: Some video codecs introduce more latency, or lag (a delay) than others. Low-latency codecs are needed for applications like live streaming, online gaming, and interactive video conferencing.

    • Device Compatibility: The chosen codec needs to be supported by a range of devices and platforms to reach the greatest number of people possible.

    How do I Choose a Codec?

    man filming opening a boxman filming opening a boxman filming opening a box

    In a nutshell, it depends on the specific requirements of your project or application, but here are some best practices to think about:

    Certain codecs excel in particular scenarios. With streaming applications, as an example, you might choose a codec that has good compression efficiency at lower bitrates. For professional video production, you’d likely prioritise quality.

    Compatibility is important, so make sure your chosen codec is compatible with the devices and platforms your audience will use. You might need to support multiple codecs to reach a bigger audience.

    Find out the best bitrate based on the desired video quality, and available bandwidth. Some applications might need multiple bitrate versions of the same video to support adaptive streaming.

    Be conscious of licensing terms associated with video codecs. Some codecs, like H.264, have licensing fees for certain commercial uses, while others, like VP9 and AV1, are royalty-free.

    New codecs and updates to existing ones are released regularly so it’s worth keeping up with what’s out there to make sure you’re staying competitive and compatible.

    Envato Elements

    envato elementsenvato elementsenvato elements

    If you're a video maker then be sure to check out Envato Elements, where you can find a huge amount of assets to help you create your projects. Use as many as you like for one monthly subscription - and there are freebies each month too!

    Conclusion

    The choice of video codec can significantly impact video quality, compatibility, and streaming performance. By choosing the right codec and understanding important factors like bitrate and containers, you can make sure that your audience has a smooth, high-quality viewing experience that builds trust for future productions.

    About This Page

    This page was written by Marie Gardiner. Marie is a writer, author, and photographer. It was edited by Gonzalo Angulo. Gonzalo is an editor, writer and illustrator.