To understand an H.264 file, let’s first consider some of its other names. H.264 is also known as “codec H.264” and MPEG-4 Part 10, Advanced Video Coding.
What does this tell us? First, that H.264 is part of the international standards for compressing and storing audiovisual data. These standards are collectively known as MPEG-4. Codec, meanwhile, is short for coder-decoder. Therefore, H.264 is a standard for encoding and decoding audiovisual footage.
There are different types of codecs. Some are known as lossy codecs. As the name suggests, these impact the quality of the audiovisual data being encoded. MP3 is perhaps the most famous example of a lossy codec. Other codecs, including H.264, are known as lossless. These codecs do not affect the quality of the data being processed. However, they do still compress data. Lossless codecs like H.264 are popular for this very reason. You get a smaller file size, which helps save storage space and reduces the time required for uploading and downloading, while not having to compromise on media quality.
H.264 uses a number of clever techniques to achieve this. One method is called inter-frame compression. We might conceive of video footage visually. However, that’s not how it is stored. Like all information stored digitally, each frame of footage is represented by binary – sequences of ones and zeroes. Most video footage is shot at 24 frames per second. Therefore, each frame is usually quite similar to the one immediately before and after. In turn, the data representing each frame often shares many similarities. Identifying these similarities is the essence of inter-frame compression. It allows for the elimination of repeated data. As an example, imagine taking the first frame of a video and recording all of the data representing that frame. For the next frame, only save the data that is different from the keyframe. Do the same for all subsequent frames. The saved file can be decoded by using the same process, just in reverse.
Another, even more complex technique used in H.264 is called predictive coding. Put simply, predictive coding involves analyzing the data representing a frame, or a group of frames, and using it to generate an estimate for the data that will be needed to represent subsequent frames. This allows H.264 to further reduce the total amount of data required to encode an audiovisual file.
H.264 uses these and other advanced techniques to encode and compress audiovisual media efficiently and without loss in quality. These features have made it a very popular video format, and one that is therefore widely adopted, which in turn has given it the advantage of being widely supported – compatible with most platforms and devices.
If H.264 is so ubiquitous, you might be wondering why it’s not a more common file extension. Technically, H.264 is a codec, not a file type. Therefore, files encoded with H.264 are often labeled with the .mp4 or even .avi extension.