Sid Bala
sidbala.com · Personal blog · on HN since 2016
Sid Bala is a software developer whose best-known post explains how H.264 video compression works.
What HN saysHN commenters repeatedly recommend "H.264 is Magic" as a great, digestible explanation of video compression, and link its PNG example.
16HN people shared it
8linked it in comments
9stories submitted
3.0Kstory points
2 years agolast shared
2016people per year2026
Most-shared posts
- 1H.264 is Magic15 people · 3.0K points · first shared 2016 · 219 comments on HN
- 2OutputFrame.png1 people · first shared 2024
What HN people wrote when they linked it
LordDragonfang · 2022-06-24
If you want a similar read on DCT-based encoding, I highly recommend this article which lays it out in an extremely digestible format:
https://sidbala.com/h-264-is-magic/
cheeze · 2020-07-06
You're thinking of "h264 is magic"
https://sidbala.com/h-264-is-magic/
GREAT article
DavidVoid · 2019-11-23
I can also recommend this article on just how impressive H.264 at compressing a file while retaining good quality.
https://sidbala.com/h-264-is-magic/
IvanK_net · 2024-06-15
Lossy compression is possible in PNG to a certain degree. This is the "same PNG", but 94 kB instead of 1015 kB:
1015 kB: https://sidbala.com/content/images/2016/11/outputFrame.png
94 kB: https://www.photopea.com/keynote.png
pertique · 2022-04-01
A good high-level breakdown of H.264: https://sidbala.com/h-264-is-magic/
Associated HN post, although there have been a few: https://news.ycombinator.com/item?id=30710574
More technical look at video codecs in general with sources: https://github.com/leandromoreira/digital_video_introduction#how-does-…
jitendrac · 2020-07-06
see more details, https://sidbala.com/h-264-is-magic/
I know that's not fair comparison, but imaging clever compressions were not invented and you would download terabytes of data to view a small movie.
spapas82 · 2019-09-01
The image for an MPEG compressed video is splitted in 16x16 blocks. For each frame (excluding the 1st of course), the compressing algorithm tries to to matchthat particular block with a block in the previous frame (it searches the previous frame to see where there are the fewest differences). If it can do it it only encodes the differences and the position in the previous frame; this is called an inter(predicted) block. If however it can't match that block with the previous frame then it needs to re-encode from scrach; that's the intra macroblock. As you can understand after a shot cut there will be much more intra macroblocks.
There are some more info in the wikipedia: https://en.wikipedia.org/wiki/Macroblock and also there's a nice article explaining some of the magics of H264 compression: https://sidbala.com/h-264-is-magic/
baq · 2019-07-03
working on FFT-transformed images is quite the dark magic if you don't understand what you're looking at; this is especially interesting when you look at what e.g. H.264 does to images in FFT: https://sidbala.com/h-264-is-magic/ (look at the 2% mask and the resulting image - it provokes a 'this shouldn't be possible' reaction).