I, P, B Frames: The Time Dimension of Video Compression
One minute at 30fps is 1800 frames, yet the file weighs less than a few dozen photos — because video never stored 1800 complete pictures. It stored a few full frames plus a thousand descriptions of change.
Three frame types, three jobs
The I frame (keyframe) is a complete picture — an independent photograph decodable without any other frame. The P frame records only the difference from the previous frame: unmoved regions reused, moved regions as motion vectors. The B frame goes further, referencing the frame after as well and averaging — the most efficient of the three.
A typical sequence cycles "I P B B P B B …" with an I frame every 2-5 seconds acting as the anchor. This structure is the GOP (group of pictures): frames inside depend on each other, and the I-frame boundary is the only place to "start from scratch".
What GOP explains
Seek behavior: players can only start decoding at an I frame — seek into mid-GOP and the player jumps back to the nearest I frame, then decodes forward rapidly. Longer GOPs mean longer catch-up paths and lazier seek response; stream-copy trimming only cutting at I frames is the same mechanism.
Editing lag: editors need real-time random access to every frame, and long GOPs make every access drag a chain of dependencies — ProRes-style all-I-frame intermediates exist precisely to give the editing stage "grab and go" frames. Size swings: at fixed CRF, cut-heavy or high-motion passages spike I-frame density and size, while static scenes barely add data inside a GOP.
Practical knobs and judgments
Compression settings: a 2-second GOP (an I frame every 60 frames) is the universal balance of seek responsiveness and efficiency; seek-heavy content (teaching videos) can afford denser I frames. Laggy editing timelines: follow the ProRes route to an intermediate codec rather than shortening the GOP — one conversion buys a smooth timeline.
The codec checker’s advanced mode can show frame-type info and confirm a file’s GOP length. With I/P/B in mind, the other knobs fall into place: CRF is the quality budget, preset the encoder effort, and GOP the independent time-dimension dial — together they decide size and experience.