Ch. 10 · In Practice

한국어日本語
7 min

GOP Structure Explained: Keyframe Interval, Closed vs. Open GOP

How you arrange I, P, and B frames into a GOP sets the trade-off between compression efficiency and seeking, and why adaptive streaming needs closed GOPs.

In Chapter 3 you learned about intra frames (expensive but self-contained) and inter frames (cheap but dependent on references). The order and spacing in which you place them is the GOP (Group of Pictures) structure.

IBBPBBPBBI GOP length = 9 (from one I up to just before the next I) One GOP
A typical GOP structure: P and B frames fill the space between I frames

The GOP length trade-off

Longer GOPShorter GOP
Compression efficiency ↑ (intra frames take a smaller share)Compression efficiency ↓ (expensive intra frames show up often)
Seeking and channel-change responsiveness ↓Seeking and channel-change responsiveness ↑
Fewer quality-switch points in adaptive streaming (covered later)Quality-ladder switches are frequent and smooth
Slow recovery after a transmission errorFast recovery after an error
In the field: typical industry values

VOD streaming commonly uses one intra frame every 2-4 seconds (for example, a GOP of 60-120 at 30 fps). This has to line up exactly with the segment boundaries of adaptive streaming, which you will meet shortly, because a quality switch can only happen at a point that is an independently decodable intra frame. Live and broadcast delivery often use a shorter GOP (for example, 1-2 seconds or less) to cut latency and channel-change time, giving up some compression efficiency in exchange. Conversely, if the GOP is too long, the black screen after a channel change lasts longer. Where latency comes from in live streaming and how to reduce it are covered in Chapter 15.

Closed GOP vs. open GOP

In a closed GOP, B frames never reference frames in the next GOP, so the GOP is fully independent at its boundary. An open GOP allows references across the boundary to gain a little more compression efficiency. Adaptive streaming needs to switch freely between segments, so it must use closed GOPs.

GOPGroup of Pictures

Group of Pictures. The span from one intra frame up to just before the next intra frame.

Closed / Open GOPClosed / Open GOP

Whether references across the GOP boundary are allowed. Streaming requires closed GOPs.

Keyframe intervalKeyframe interval

How often an intra frame is inserted. The key parameter in the quality-versus-seekability trade-off.

Check yourself

Why must adaptive streaming use closed GOPs?