Reference · Video compression

GOPs, I-frames, P-frames, B-frames and keyframes

Modern video codecs save large amounts of data by storing some pictures relative to other pictures. A GOP—group of pictures—describes a run of coded pictures organised around independently decodable or reference pictures.

Diagram of an example group of pictures containing I, P and B frames.
A GOP combines independently decodable and predicted pictures.
Short version: I-frames can be decoded without motion prediction from other pictures; P- and B-type pictures can use other pictures as references. A keyframe is usually a point where decoding can begin cleanly, but exact terminology differs by codec and container.

I, P and B pictures

TypeGeneral ideaTypical effect
I / intra pictureCoded primarily from information within that picture.Larger but provides a natural random-access/reference point.
P / predictive pictureCan predict from earlier reference pictures.Usually smaller than equivalent intra pictures.
B / bi-predictive pictureCan use reference pictures from both temporal directions, depending on codec structure.Can improve compression efficiency but complicates decode/display order.

Modern standards are more nuanced than the old MPEG shorthand, but I/P/B remains a useful mental model.

What is a GOP?

A GOP groups pictures into a prediction structure. A short GOP inserts random-access points more frequently; a long GOP can improve compression efficiency by exploiting similarity across more pictures.

Streaming encoders often choose GOP/keyframe intervals to balance compression, channel switching, adaptive-streaming segment boundaries and seek responsiveness.

Why keyframes matter for seeking and editing

If playback starts on a picture that depends on earlier reference pictures, a decoder may need to begin from an earlier random-access point and decode forward. That is why a seek can land slightly before the requested frame or take longer in heavily inter-frame-compressed media.

Frame-accurate editing can also require decoding neighbouring frames even if only one visible frame is being changed.

All-I versus long-GOP

ApproachStrengthTrade-offExamples
All-I / intraframeEasy random access and editingHigher bitrate for similar visual qualityMany ProRes modes, some AVC-Intra/DNx workflows
Long-GOP / interframeHigh compression efficiencyMore dependency between picturesH.264, HEVC, AV1 delivery and camera modes

Common confusion

A keyframe is not simply “the best-quality frame.”

Its importance is that it provides a decoding/random-access boundary.

B-frames are not automatically bad for quality.

They are compression tools. Their value depends on codec, encoder and use case.

All-I does not mean uncompressed.

Every picture can still be heavily spatially compressed.