A GOP is the sequence of frames between one keyframe and the next, including the keyframe that starts it. A video with a keyframe every two seconds at 30 fps has GOPs of 60 frames.
GOP length is where several unrelated-seeming behaviours come from:
- File size. The keyframe is the expensive frame. Fewer of them across the same duration means a smaller file, and the difference is not marginal on content with little motion.
- Seek precision. You cannot decode from the middle of a GOP, so long GOPs make scrubbing coarse.
- Error resilience. Damage inside a GOP propagates to the end of it. A corrupt stream recovers at the next keyframe.
- Streaming segmentation. HLS and DASH cut video into segments that must begin with a keyframe, so the GOP length constrains the segment length.
For compression specifically the useful framing is: longer GOPs are cheaper, and you pay for them in navigability. A 10-second GOP on an archival copy nobody will scrub is a straightforward win. The same setting on a clip someone needs to find a moment in is an annoyance they will feel every time they drag the scrubber.
Most encoders also allow a maximum GOP length plus scene-change detection, which inserts keyframes early at hard cuts. That is almost always the right configuration: long GOPs where the footage is continuous, fresh keyframes where it is not.