What is video codec?
The term codec is a combination of words “encoder” and “decoder” (or “compressor” “decompressor”). So, simply put, video codecs are hardware or software used to compress and decompress digital video files - essentially to make them smaller in size and simplify their transmission without compromising quality.
Because of this reason, video codecs are inseparable from the world of video streaming. Codec technology aids in every step of creating, editing, transmitting, and streaming digital videos. And as streaming has evolved, so have the codecs and their abilities. While several codecs are available, H.264 and H.265 are the most commonly used ones. As a result, there is often confusion as to which of the two codecs is better; how does H.264 vs. H.265 pan out?
In this article, we’ll walk you through H.264 and H.265 codecs in brief, after which we’ll compare the two codecs on the following important parameters:
- Compression ratio
- Video quality
- File size
What is H.264 Codec?
H.264 codecs have been extremely useful and popular. It offers sophisticated compression levels with minimal loss in quality. H.264 doesn’t demand extremely high computational power either. This enables many computer hardware to encode video data hardware- or software-assisted versions of H.264.
H.264, also known as Advanced Video Coding (AVC), works by processing video frames using a motion-compression-based, block-oriented video compression standard. These units are known as macroblocks, and they consist of 16x16 pixel samples. This can be further subdivided into blocks and prediction blocks. Head on to the following article to learn about the technicalities of H.264 in depth.
Overall, the H.264 codec provides substantially lower bitrates than its predecessor and is still used by different streaming sources.
What is H.265 Codecs?
H.265 is the upgraded and more advanced version of H.264. Also known as High-Efficiency Video Coding (HEVC), this supports further reduced size than H.264 and thus requires lesser bandwidth for streaming and transferring videos.
Unlike the macroblocks approach by H.264, H.265 processes information using Coding Tree Units (CTUs). The restriction with macroblocks was that they could span 4x4 or 16x16 sizes, but CTUs can process as many as 64x64 blocks which helps in the compression being much more efficient. Apart from this modification in the CTU size, HEVC also supports improved motion compression and spatial prediction than its predecessor. Because of this reason, HEVC requires higher computational power to be able to compress the data. Please read the following article for a technical overview of the H.265 codec!
With the basics settled, let’s now look at the differences between H.264 vs. H.265 codec!
H.264 Codec vs. H.265 Codec - How do they differ?
Here are some important points of comparison for the two codecs:
Compression ratio is the primary factor differentiating H.264 and H.265 codecs. H.265, aka HEVC, provides double the coding efficiency compared to the AVC. This translates into HEVC saving about 50% of the bitrate while providing the same encoding quality. In more specific terms, H.265’s average bit reduction is 65% at 4K UHD, 60% at 1080p, 58% at 720p and 50% at 480p.
There is a big difference between H.264 and H.265 codecs regarding video quality at the same bitrate. In H.264, the borders of the blocks are likely to be distorted. This is because each macroblock is fixed, and each macroblock’s data is independent of one another. With H.265, on the other hand, the images are sharper and more detailed, with less blocking and fewer artifacts. This is because it determines the size of the CTUs based on regional information. As a result, H.265 is superior to H.264 when compression with better image quality.
How well a codec compresses the digital video directly correlates to the final file size that needs to be transmitted or streamed. The lesser the bandwidth, the lower the file size. In general, H.264 codecs produce videos 1-3x larger than those produced by H.265. So, in terms of file size and limited storage space to save large files, H.265 trumps H.264.
In terms of compatibility, the AVC trumps HEVC, and HEVC is quite behind in popularity compared to AVC. If 100 devices and platforms support H.264 codec, you will find only 30 corresponding devices and platforms supporting H.265. You can’t dismiss that H.265 is the codec of the future, and slowly but surely, a greater number of platforms and devices will adapt to H.265.
Regarding overall performance comparison, H.265 undoubtedly trumps H.264 - but this doesn’t come without its context. H.264 has everyday use cases applicable to almost all common devices. However, HEVC encoding requires high computational power. As a result of this, HEVC can compress videos much more efficiently than AVC while keeping the same level of image quality. H.264 performance is not up to the mark for 4K streaming, but HEVC does justice to that.
A comprehensive comparison of H.264 and H.265
Here’s are some more points of comparison, apart from those discussed above, to elaborate on H.264 vs. H.265:
|Name||MPEG-4 Part 10 AVC||MPEG-H, HEVC, Part 2|
|Successor to||MPEG-2 Part 2||MPEG 4 AVC, H.264|
|Drawbacks||Impractical for delivering 4K or 8K content due to high bitrate requirements. Frame rate support is low too.||Computationally expensive due to expensive motion estimation and larger prediction units.|
The short story is that H.264 and H.265 codecs differ in video compression efficiency. H.265 provides more efficient resources and bandwidth than H.264, which leads to the lesser strain put on servers that will finally host the digital files. All of this reduces the overall costs in the long run. As you read, HEVC is also not without its shortcomings, and despite all its advancements, it does have a few disadvantages to be kept in mind. These are not deal-breakers, but it is good to have them in mind for a complete picture.
In addition to higher resolutions at lower bit rates, HEVC also provides an improved color gamut, increasing the picture quality much more than ever before. If you are currently using H.264 codecs, it might be good to try out H.265 for your video content or video streaming projects!