What is a video codec?
A video codec (short for coder-decoder) is a technology used to compress and decompress digital video files. The main purpose of a video codec is to reduce the file size of a video while maintaining quality, making it easier to store, transmit, and stream video content over networks. Codecs work by using algorithms to remove redundant or non-essential data, allowing for efficient video encoding and playback.
How video codecs work?
When a video is recorded, it’s raw and uncompressed, resulting in large file sizes. A video codec compresses this data by encoding the video file into a more compact format for storage or transmission. When the video is played back, the codec decodes the compressed data and reconstructs the video as closely as possible to the original quality.
Video codecs perform this process in two main stages:
- Encoding: Compressing the video file to reduce size.
- Decoding: Decompressing the video to play it on various devices.
Some of the most widely used codecs include H.264 (AVC), H.265 (HEVC), VP8, and VP9. In this blog, we’ll focus on VP8 and VP9, comparing their features to help you decide which codec is the best fit for your needs.
VP8 and VP9 has a significant impact on video quality, compression, and performance. Developed by Google, both codecs are part of the WebM project, designed to provide efficient compression for web videos. Despite their shared origins, VP8 and VP9 have distinct differences that make them suitable for different use cases.
What is VP8?
Released in 2010, VP8 was developed as an open alternative to proprietary codecs like H.264, addressing the demand for a royalty-free video compression standard. As the primary codec for the WebM container format, VP8 quickly gained traction across various platforms, including YouTube and other streaming services. It uses a block-based motion compensation architecture to effectively reduce file sizes while maintaining high video quality, making it especially suitable for online video streams under limited bandwidth conditions.
The codec's efficient encoding capabilities and support for lower resolutions have made it a popular choice for web-based applications, such as WebRTC, where real-time video communication is essential. Additionally, VP8's open-source and royalty-free nature encouraged its adoption by the broader web community, setting the stage for its successor, VP9, which offers even greater compression efficiency and quality.
What is VP9?
Introduced in 2013 as the successor to VP8, VP9 brought significant improvements in compression efficiency and video quality, positioning itself as a strong competitor to the H.265/HEVC codec without the burden of licensing fees. VP9 supports higher resolutions, including 4K and even 8K, making it ideal for modern streaming services that demand high-quality video while minimizing bandwidth consumption. The codec leverages advanced prediction algorithms and a flexible block size ranging from 4x4 to 64x64 pixels, allowing for optimal compression across various types of content.
Additionally, VP9 supports High Dynamic Range (HDR) content, offering a wider color range and enhanced visual fidelity, further cementing its value for contemporary video applications.
Compression efficiency betweenVP8 and VP9
VP8 compression efficiency:VP8 offers decent compression capabilities, but it is generally less efficient compared to more modern codecs like VP9 and HEVC (H.265). To maintain comparable video quality, VP8 typically requires higher bitrates, especially at higher resolutions. For instance, a 1080p video encoded with VP8 may require a bitrate of approximately 2-3 Mbps. While VP8 can effectively handle standard definition and lower resolutions, its performance diminishes as the resolution increases, leading to potential quality loss unless the bitrate is significantly increased.
VP9 compression efficiency: In contrast, VP9 significantly enhances compression efficiency. It achieves a 30-50% better compression rate than VP8 while maintaining the same level of video quality. This means that VP9 can deliver superior video quality at the same bitrate or achieve equivalent quality at a lower bitrate, which is crucial for reducing bandwidth requirements.
Example:
A 1080p video encoded with VP9 might only need 1.5-2 Mbps to achieve the same quality that would require 2-3 Mbps with VP8.
Here's a graph comparing the compression efficiency of VP8 and VP9. It shows that at the same bitrate, VP9 maintains higher video quality (as indicated by PSNR or VMAF scores) compared to VP8, demonstrating its superior compression efficiency.
- VP8: Offers good quality at lower resolutions (e.g., 720p and below). However, at higher resolutions like 1080p or 4K, VP8 struggles to maintain the same level of quality without significantly increasing the bitrate.
- VP9: Excels at maintaining video quality, especially at higher resolutions. VP9's advanced compression algorithms allow it to preserve finer details and improve visual quality even at lower bitrates, making it ideal for 4K streaming.
Example:
- VP9 is widely used on platforms like YouTube, which defaults to VP9 for high-resolution videos (1080p and higher) to maintain quality while minimizing bandwidth.
Encoding speed between the codecs
Encoding speed refers to how quickly a video file can be processed using a particular codec.
- VP8: Generally faster to encode than VP9 due to its simpler compression algorithms. This makes it suitable for live streaming or applications where encoding speed is a priority over maximum compression efficiency.
- VP9: VP9's more complex compression algorithms mean that it takes longer to encode compared to VP8. The higher computational complexity results in slower encoding times, making it less ideal for scenarios where real-time encoding is necessary.
Decoding performance
Decoding performance is important for playback, particularly on devices with limited processing power, such as smartphones and tablets.
- VP8: Easier to decode and requires less processing power, making it more suitable for lower-end devices or scenarios where battery life is a concern.
- VP9: While VP9 offers better compression and quality, it requires more processing power to decode, which can be a drawback on older or less powerful devices. However, newer hardware, such as modern smartphones and browsers, are optimized to handle VP9 efficiently.
Example:
- Many older Android devices are better suited for VP8 playback due to lower CPU/GPU demands, while newer devices are optimized for VP9.
Hardware support across VP8 and VP9
The extent of hardware support directly impacts how smoothly a codec performs, particularly for high-definition video content.
- VP8: Has broad support across devices and browsers, including older hardware. VP8 is supported by a wide range of web browsers (e.g., Chrome, Firefox, Opera) and Android devices.
- VP9: VP9 is supported by newer devices and browsers, but older hardware may struggle with VP9 video playback. Many modern devices, including 4KTVs, smartphones, and Chrome cast devices, now have hardware-accelerated VP9 decoding, making playback smoother and more power-efficient.
Example:
- YouTube defaults to VP9 for many users due to its superior compression, and Chrome and Firefoxbrowsers fully support VP9 playback






