Video Codecs: H.264, H.265, and VP9

The Importance of Choosing the Right Video Codec

 

H.264, H.265, and VP9
H.264, H.265, and VP9
H.264, H.265, and VP9
H.264, H.265, and VP9

Video Codecs: H.264, H.265, and VP9

As the world becomes increasingly digitized, the importance of video codecs in our lives cannot be overstated. Video codecs are essential in video compression, encoding, streaming, and playback. Choosing the right codec can make the difference between smooth playback and frustrating buffering, between crisp and clear images and pixelated messes. In this article, we will explore the differences between three of the most popular video codecs in use today: H.264, H.265, and VP9.

H.264 vs H.265: What’s the Difference?

H.264, also known as AVC (Advanced Video Coding), has been the dominant codec in use for the past decade. It is widely supported by devices and software and offers good compression while maintaining high video quality. However, H.265 (HEVC) is slowly taking over. It is a newer and more advanced codec that offers better compression ratios, which means smaller file sizes with the same quality as H.264. H.265 is also better at handling high-resolution videos, making it a good choice for 4K and 8K videos. However, it requires more processing power to decode, which may be an issue on older devices.

Personally, I have found that H.265 delivers noticeably better quality than H.264 for the same file size. It is especially noticeable in high-motion scenes like action movies or sports. However, it does require more processing power, so make sure your device can handle it before choosing it as your preferred codec.

VP9: The New Kid on the Block

VP9 is a newer codec developed by Google and is designed to be a royalty-free alternative to H.265. It offers better compression than H.264 while maintaining the same video quality. It is also highly efficient at handling high-resolution videos, making it a good choice for 4K and 8K videos. However, its adoption has been slow due to its lack of support in many devices and software. It also requires more processing power to decode than H.264.

One of my personal experiences with VP9 was when I was trying to stream a 4K video on my laptop. I noticed that the video was buffering a lot and the quality was not as good as I expected. After some research, I found out that the video was encoded with VP9, which my laptop did not support. I had to switch to H.264 to get smooth playback.

Conclusion: Choosing the Right Video Codec

Choosing the right video codec is crucial for ensuring smooth video playback and high video quality. H.264 is still a solid choice for most situations, but H.265 and VP9 offer better compression and handling of high-resolution videos. However, they require more processing power and may not be supported by all devices and software. Make sure to choose the codec that best suits your needs and device capabilities.

In conclusion, video codecs are an essential part of our digital lives, and choosing the right one can make all the difference in our video-watching experience. Always keep in mind the pros and cons of each codec and make an informed decision based on your needs.

H.264

H.264

H.264

H.264 (MPEG4 AVC) video compression standard features and related information: codecs, containers, playback, etc.
H.264 is a video compression standard adopted by the International Organization for Standardization (ISO). Also known as MPEG-4 part 10 and AVC (advanced video coding).

h264

Advantages of H.264

Compared to MPEG2 (DVD-Video) and MPEG4 ASP (DivX, XviD), H.264 compression works significantly more efficiently, providing better image quality (up to the level unattainable for MPEG2 and MPEG4 ASP) and a size smaller file.

Disadvantages of H.264

The main disadvantage of H.264 is the noticeably higher hardware requirements for encoding and playing video files.

For example, on a computer based on an Intel Pentium 4 processor clocked at 3.2 GHz, it is comfortable (no problem, no jerks) to use the ffdshow test decoder in Windows Vista, only the video is played in “medium” HD resolution – 1280 × 720. The so-called Full-HD video (1920 × 1080), depending on the complexity of the scenes, can already “slow down” noticeably. However, it should be noted that in Windows of the previous generation, XP, Full-HD video on the same computer is played quite smoothly in many cases.

The efficiency of using computer resources during playback depends to some extent on the decoder used.

H.264 decoders
ffdshow tests
A popular free decoder for many video and audio compression formats, including H.264.
CoreAVC
The paid codec is considered the codec that currently consumes the least resources. Since version 1.9.5, it supports decoding using the hardware capabilities of nVidia video cards through the CUDA interface. Modern versions also support the use of the hardware capabilities of ATI (AMD) and Intel graphics cards using the DXVA interface.
H.264 support
H.264 is accepted as a standard for compression of high definition video (HD, HDTV), it is distributed in a new generation of optical media: Blu-ray and HD DVD, it is used on mobile devices, it is compatible with Apple QuickTime, It is spreading in digital television transmission systems, videoconferencing, video surveillance, etc. The de facto standard for multimedia web applications and online video hosting sites like YouTube, Adobe Flash Player has supported direct playback of H.264 videos since version 9.0.115, released in late 2007.

Standards, formats, codecs, containers
The codec and the standard are not the same. A standard is a specification (description) of a compression algorithm (eg H.264), a codec is its specific software implementation (eg x264).

You should also not confuse the format of the data and the format of the container in which this data can be stored. The same data (eg compressed according to the H.264 algorithm by the x264 encoder) can be packed in different containers (eg Matroska, MP4 or AVI). In contrast, a container of the same format (eg MKV) does not have to contain video data in H.264 format; you can easily find a MKV file with a normal DivX video inside.

Data container formats
There are several common container formats, the main ones being MP4, Matroska (MKV), and AVI.

MP4
The official container standard for H.264 video. The main disadvantage of MP4 is that according to the specification, said file can only contain audio in AAC format. This leads to a forced loss of sound quality, for example when backing up DVD movies due to the need to transcode from one lossy compression format (AC3, Dolby Digital) to another (AAC). Purely technically, in an MP4 container you can place the stream of any format, but the ability to play the file on any player will not be guaranteed.
Matroska (Matryoshka, MKV)

AVI
The AVI container generally contains videos in the popular DivX and XviD (MPEG4 ASP) formats. The AVI container is not formally designed to store data encoded in accordance with the H.264 standard and is therefore not generally used for these purposes and in the rare cases of incorrect use of the container, the ability to play the corresponding files.

H264 – Bad Internet Video Quality?

H.264 – Bad Internet Video Quality?

H.264

Another common opinion based on materials that are often presented incorrectly or out of place. Here, as in the previous case, lack of practice and unwillingness to learn play a very important role. After all, you are just as likely to get poor recording quality due to the curves of the settings, both frame-by-frame and MPEG-like codecs. Many system vendors are squeezing quality to be able to record performance, which leads to this result. Most non-professional consumers also find H.2b4 video on the Internet, where it is highly compressed and intended primarily for a general idea of ​​the comic nature of the scenes or the situation in general.

H.264

Here again from the forum: “If, for example, a car is driving in the distance and its wheel falls off in motion, the codec can draw the whole machine from a long-playing keyframe in synthesized frames, along with the wheel that it is no longer there. ” This is possible only in case of a strong underestimation of the bit rate. The Internet is full of compressed entertainment videos, including accidents, and other situations related to video surveillance. It is very strange to consider the quality of this video, obtained, however, by compression in the H.264 format, equal to the quality of the file and draw some conclusions about the quality of the compression format in general. Can’t see the difference in the task of uploading videos to the Internet or recording a high-quality file?

Does H.264 consume more resources?

Many opinions on the subject of H.264 are promoted by individual manufacturers of network video cameras. For example, the article “The hidden cost of N.264”, which exists even in a video version, says that the cost of a solution in N.264 turns out to be significantly higher than that of MPEG or even frame-by-frame codecs. picture. In fact, the resource requirements for decoding video, especially multi-channel and high definition, will be slightly higher than MPEG-4, because all codecs are generally symmetric in terms of resources for encoding and decoding (in the sense, if the codec needs more resources to encode, and this is normal, since the more efficient the codec, the more resources are needed, even for decoding). The question is only on two points.

First, how much more demanding is H.264 on the computer CPU to monitor. Our practice shows that the load on the processor when decoding H.264 depends on the bit rate, however even at the maximum bit rate the download will be comparable to decoding a frame-by-frame JPEG (MJPEG) sequence. The authors of the article “The Hidden Cost of Н.264” focus on the higher cost of client stations and storages (as more and more efficient processors will be required), overshadowing a serious decrease in bandwidth requirements of the net. But even if we’re talking about 30% gain compared to slightly lagging MPEG-4, not to mention MPEG-2 and frame-by-frame codecs as well, isn’t 30% enough? Is it for small “safe cities”, where the rent from providers of data transmission channels costs 70 conventional rubles against 100 (the same 30%), is this a small saving? Or does it not matter that we can transfer 30% more cameras over the existing network?

Second, many “normal” network cameras (I mean more or less professional) are currently capable of transmitting video in two independent streams, with different resolutions, frame rates, and bit rates. And the “normal” software for these cameras also knows how to work with two streams. For multi-screen display, we can choose a low resolution sequence, for full-screen display, the maximum available, the change occurs automatically; the recording in the archive, of course, is done in high resolution. Perhaps you will say that I contradict myself, the second stream in each channel of the network and the saving of at least 30% are incompatible. However, I can assure you that with the correct settings, the second stream will not take up even 5% of the total bandwidth required.
Just go ahead
I’m not trying to act here as an advocate for H.264, I’m just not encouraging the hobbyist, for the fact that PR doesn’t rule reason. Everything must be appropriate for the task. If it is very important to you that your video is of the highest quality, if you want to be sure that it does not lose anything, ZIP is your assistant. Only lossless compression, which none of the codecs used in video surveillance will provide, will satisfy your requirements.

H.264. Some truth about delusions

H.264. Some truth about delusions

How does the widely used video compression codec 'H.264 / MPEG-4 AVC'  dramatically compress huge-sized movies? - GIGAZINE

This article is devoted to misconceptions, the constant distortion of facts, attempts to publicize competing compression technologies, and simply important points related to using the H.264 compression format. In video surveillance systems, of course,

How to Encode H.265 (HEVC) Video on Mac OS X

Although the general trend in the world is evident, some still try to defend their point of view at the cost of correcting these same trends. Well, I respect your point of view, unless it is based on a reluctance to study the subject or is simply a PR of your own technological solution. However, the second case is no less respectable, since protecting one’s interests is always good, even for the development of the industry; in this case, the dispute helps the consumer to better understand the correctness of the choice.

So what is it really about? It is already clear about video compression in H.264 format. But we will return to the controversy surrounding its use in digital video surveillance.
Mir and H. 264
Meanwhile, the world has chosen H.264. This is not an unfounded statement. Let’s see who uses this compression format. All and various. Let’s leave the perverse proprietary reviews on the conscience of the manufacturers, as even a good idea can be spoiled by a bad implementation. Let’s see, which of the manufacturers doesn’t use it? These are mostly megapixel IP video cameras, as the performance of the processors built into them is for the most part still insufficient to compress multiple megapixels in real time. Rather inexpensive processors with the ability to compress video in H.264 to a resolution of at least 2 megapixels have just started to appear on the market (yes, the widely advertised HDTV is only 2 megapixels, multiply 1920 by 1080 yourself). What can we say about the highest resolution? For the broad masses, focusing on the medium and low price segment, it will not be available soon. But there are more than enough hardware codec chips to embed in IP cameras with a resolution of D1 (720×576): here you have DSP processors and ASIC chips, and whatever your heart desires, today it is difficult to find a standard definition camera that does not support this format. …
Again time-lapse versus inter-frame
However, there are apologists who advocate other options for video compression. In his arsenal, arguments about better compression and the suitability of formats as evidence in court. But think about it, what does the court care, with what codec is it compressed? Is the compression format important to the court and not if the witness can confirm the violation and the expert can confirm the invariability of the video? Or maybe someone will argue that video compressed with a frame-by-frame codec is harder to switch (false) than one between frames? And the frame-by-frame codec doesn’t need a digital signature at all?

Both the magazines and the Internet forums are full of debates about the suitability and professionalism of the formats, and I am tired of reading absolutely unfounded “evidence” of this or that. The hobby is the main problem, an argument based on emotions, not arguments and mathematics. Let me give you a couple of examples.

There is a gigantic error based on the unwillingness to read the standards and generally study the device of even the simplest codecs. We are talking about the H.264 format and, in general, the methods of compression between frames.

“All the frames, except me, are synthesized, since they take information from the previous ones and simply indicate where to move this section of the image to a new location. That is, as if you selected a section of the frame in Photoshop and moved it to a new location. actually there is a frame that is not valid. ”

In fact, quite the opposite. It is the blocks in IP frames that are compressed when modified, and those that have not changed (that is, there was no movement) will remain unchanged. In general, the IP frame consists only of the modified information (blocks), which means that the information in them is not repeated, but is updated, but the l-frame is completely compressed, regardless of the changes.

Also there: “The codec uses psychophysical compression, that is, part of the image, which moves, becomes rough – all the small details are removed. This is because a person does not distinguish between details in fast-moving objects So does it make sense for a film codec to waste space and traffic to get details? “