← The Codec

Codec basics: why HAP destroys H.264 on stage


Live stage with large LED screens
The wall is only as smooth as the codec feeding it. Pick the wrong one and everyone in the room sees it.

It is 11pm. Your set is peaking, you push the fader, and the wall stutters. Not the odd dropped frame — a full, visible hitch every time you trigger a new clip. The crowd notices. You notice. And the cause is almost always the same: your content was exported as H.264.

H.264 is the most common video codec on earth. It is also one of the worst possible choices for live visuals. Understanding why is one of the highest-leverage pieces of technical knowledge a VJ can have — so let us break it down properly.

How H.264 actually works

H.264 is a delivery codec. It was designed to make video small enough to stream over the internet and fit on a Blu-ray — not to be scrubbed, looped and triggered in real time across eight layers. It hits those tiny file sizes with temporal compression: instead of storing every frame in full, it stores a few complete keyframes (I-frames) and then, for every frame in between, only stores what changed from the frames around it (P- and B-frames).

This is brilliant for watching a film start to finish. It is a disaster for performance. When you jump to an arbitrary point in an H.264 clip — exactly what triggering and scrubbing do — the decoder cannot simply read that frame. It has to find the previous keyframe and rebuild every intermediate frame up to the point you asked for, on the CPU. Multiply that by the number of layers you are running and the machine buckles.

Enter HAP: built for the GPU

HAP is a codec designed from the ground up for real-time playback, and it makes the opposite trade-off to H.264: bigger files, almost no CPU load. Two things make it special.

First, HAP is an all-intra codec — every single frame is a complete keyframe. There is no temporal compression, so the decoder never rebuilds anything. Jump to frame 4,000 of a clip and it decodes instantly and independently. Scrubbing, reverse playback, instant triggering — all effectively free.

Second — and this is the clever part — HAP stores frames using texture compression (the S3TC / DXT family) that GPUs decode natively in hardware. The compressed frame is handed almost directly to the graphics card, which unpacks it on the fly using silicon built for exactly that job. Your CPU barely touches the video. That is why a machine that chokes on three layers of H.264 will happily run sixteen layers of HAP.

Pixelated retro display close-up
HAP hands compressed texture data straight to the GPU — the same hardware path your visuals already live on.

The HAP family

  • HAP — the baseline. Solid quality, smallest of the HAP variants, no alpha channel. Your default for opaque content.
  • HAP Alpha — adds a full alpha channel for transparency. Use it for overlays, lower-thirds, logos and masked content.
  • HAP Q — higher quality (DXT5 / YCoCg), larger files. Reach for it when you can see banding in gradients or mush in fine detail on a big wall.
  • HAP Q Alpha — highest quality plus alpha. Biggest files, best image — for hero content where it genuinely matters.

The catch: disk and file size

HAP’s gift to your GPU is paid for on your disk. A one-minute HAP Q clip at 4K can be several gigabytes — ten to twenty times the size of the equivalent H.264. That matters in two ways.

First, storage: a full show’s worth of HAP can run into hundreds of gigabytes. Second, and more importantly, read speed. To play multiple layers of large HAP files in real time, your storage has to feed the data fast enough. A spinning hard drive will not keep up. You need a fast SSD — ideally NVMe — and for heavy multi-layer shows that is not optional. The single most common “HAP is stuttering” question turns out to be a slow disk, not the codec.

HAP also supports an optional lightweight compression called Snappy, applied in chunks. It shrinks files a little more at negligible CPU cost and lets the decode run multi-threaded. Leave it on unless you have a specific reason not to.

How to export HAP

HAP is not built into most editing tools by default — it is a codec you install. The modern, free, cross-platform route is the AVF Batch Converter, or the HAP encoder plugins for After Effects and Premiere. A clean workflow:

  • Master your content at full quality first — ProRes is a fine intermediate.
  • Convert to HAP for opaque clips, HAP Alpha when you need transparency, HAP Q for hero or gradient-heavy material.
  • Keep your frame rate sane — 30 or 60, matched to your show. HAP will not fix a 24-into-60 judder problem.
  • Organise files on disk so the SSD read pattern stays predictable across the set.

When is H.264 actually fine?

H.264 is not evil — it is just the wrong tool for triggered, layered playback. It is perfectly good for a single full-screen video that plays start to finish, for content you are streaming or sending a client to preview, and for anything headed to the web. Play one locked clip on one layer and H.264 will behave. The moment you start triggering, scrubbing or stacking layers, switch to HAP.

The one-line rule

If the computer has to perform the video — trigger it, loop it, scrub it, stack it — use HAP. If it only has to play the video from start to finish, H.264 is fine. Get this one decision right and half of your “my machine can’t handle it” problems disappear before the show even starts.