Urgent.News

What's breaking now, across thousands of outlets.

Tech

H.264 Is Magic

H.264 is a video compression codec standard that is ubiquitous across the internet, Blu-ray, phones, security cameras, drones, and more. It is a remarkable piece of technology that reduces the bandwidth required for transmitting full-motion video, resulting from 30+ years of work with a single goal in mind. This post aims to provide insight into some of the details at a high level without getting too bogged down in the intricacies.

Most video files are uncompressed, containing a 3D array of bytes with 2 spatial dimensions and 1 temporal dimension. For instance, 1080p at 60 Hz translates to approximately 370 MB/sec of raw data, which is nearly impossible to handle. A 50GB Blu-ray disk would only hold around 2 minutes of such video.

A simple uncompressed video file is much larger than the compressed H.264 video. For example, a 300-frame H.264 video is just 175KB, while a single frame in PNG format is 1015KB, which is 5 times larger. H.264 achieves this efficiency through various techniques, including lossy compression, which throws away less important bits and only keeps the essential bits.

Unlike lossless codecs like PNG that retain all information, H.264 discards detail information. This is achieved through entropy encoding, which reduces data redundancy by representing information in a more compact form. Additionally, H.264 transforms datasets into a different coordinate space, such as frequency domain representation, to achieve a perfect lossless transformation as long as frequency coordinates are high enough.

This mathematical theorem enables H.264 to discard detail information effectively, resulting in significant file size reduction.

Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at sidbala.com →

More in Tech

More from Thursday 29 October →