Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    S

    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.

    Visit blogHN submissions
    Systems & PerformanceScience
    What HN says

    HN commenters repeatedly recommend "H.264 is Magic" as a great, digestible explanation of video compression, and link its PNG example.

    Stats for nerds
    16HN people shared it
    9linked in comments
    3Kstory points
    Jun 2024last shared
    2019people per year2024

    Top posts on HN

    1. 1
      H.264 is Magic
      15 people · 3K points · first shared 2016 · 219 comments on HN
    2. 2
      OutputFrame.png
      1 person · first shared 2024

    What HN people wrote when they linked it

    • spapas82Sep 2019

      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/

    • baqJul 2019

      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).

    • pertiqueApr 2022

      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-a-video-codec-work

    • IvanK_netJun 2024

      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

    • jitendracJul 2020

      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.

    • LordDragonfangJun 2022

      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/

    Related

    Diary Of An x264 Developerx264dev.multimedia.cx58 people

    The first in-depth technical analysis of VP8

    Diary Of An x264 Developer
    Personal · last shared 2015
    Aldo Cortesicorte.si88 people

    Visualizing binaries with space-filling curves

    Aldo Cortesi
    Personal · last shared 2026
    Dave Cheneydave.cheney.net271 people

    Why Slack is inappropriate for open source communications

    Dave Cheney
    Personal · last shared 2026
    MaskRaymaskray.me43 people

    Evolution of the ELF object file format

    MaskRay
    Personal · last shared 2026
    Coding Reliccodingrelic.geekhold.com21 people

    Non-blocking Programmers

    Coding Relic
    Personal · last shared 2025
    Bit Quabitbitquabit.com50 people

    Flux is the new WndProc

    Bit Quabit
    Personal · last shared 2025
    Paul Khuongpvk.ca106 people

    SBCL: The Ultimate Assembly Code Breadboard

    Paul Khuong
    Personal · last shared 2026
    Clément Bœschblog.pkh.me39 people

    Investigating why Steam started picking a random font

    Clément Bœsch
    Personal · last shared 2025