A closed GOP is a Group of Pictures whose frames only reference frames inside itself — no frame in the GOP depends on a frame from the previous or next GOP. The opposite is an "open GOP", where the final B-frames may reference the I-frame of the next GOP for tighter compression. Closed GOPs are slightly larger but self-contained, which is exactly what modern streaming needs.
Why closed GOPs matter: adaptive bitrate streaming (HLS, DASH) chops video into segments, and each segment must be independently playable so the player can switch between bitrate renditions on the fly. If a segment relies on frames outside itself, the switch produces a visible glitch — broken motion, wrong colours, missing detail — until the player resyncs at the next clean point. Closed GOPs guarantee no such cross-segment dependencies. Every HLS or DASH segment starts with an idr (a strict I-frame that flushes all references) and contains only frames that depend on frames inside the same GOP.
For a product team, "closed GOP at the segment boundary" is a setting that should be always on for adaptive streaming pipelines. FFmpeg's -g (keyframe interval) and -force_key_frames flags handle this; encoder-level options like keyint/min-keyint in x264/x265 enforce it. The cost is roughly 2–5 % bitrate compared to open GOP — accepted as the price of clean rendition switching. Open GOP only survives in non-segmented scenarios: progressive downloads, archival masters, contribution feeds where every frame will be re-encoded downstream anyway.
The book · Volume 1 of 7
Video Encoding: A Complete Guide to Video Compression — From Pixels and Color to H.264, HEVC, AV1, Quality Metrics, and AI
A closed GOP keeps every frame's references inside its own group, which ABR segmenting and clean switching depend on. Volume 1 covers closed GOP structure in detail: I, P and B frames, keyframe intervals, open versus closed GOP trade-offs, and the encoder settings that keep segments independently decodable in H.264, HEVC and AV1. Written by Nikolay Sapunov, CEO at Fora Soft.
Getting playback glitches at segment boundaries and suspect your closed GOP settings?
Send us your encoder command lines and a few segments: we audit the GOP structure and keyframe alignment and hand back corrected settings for every rung of your ladder. 250+ video products shipped since 2005.