What is Keyframe?
Definition
A keyframe (or I-frame) is a fully self-contained video frame that can be decoded on its own, without referencing any other frame. The frames between keyframes store only what changed, so seeking and clean cuts work best at a keyframe.
In compressed video, a keyframe (I-frame) holds a complete picture, while the frames around it (P-frames and B-frames) record only the differences from nearby frames. The span from one keyframe to the next is called a GOP (Group of Pictures). Storing one full image plus a series of compact updates, rather than every pixel of every frame, is what keeps video files small.
Keyframes are the only points a player can jump to directly. When you scrub a timeline, the player seeks to the nearest keyframe and decodes forward from there. Lossless trimming or cutting (copying the stream without re-encoding) can only begin cleanly at a keyframe, which is why a cut may snap to a point slightly earlier than the one you picked.
Keyframe interval is a trade-off. More frequent keyframes make seeking smoother and editing more precise but enlarge the file, since each I-frame is heavy. Fewer keyframes give better compression but coarser seeking. A common default is one keyframe every 2 seconds (roughly every 48-60 frames at 24-30 fps). This is different from animation keyframes, which mark motion points rather than encoded frames.
Quick facts
- A keyframe is also called an I-frame (intra-coded frame)
- It is fully self-contained and decodes without any other frame
- P-frames and B-frames between keyframes store only changes
- The span from one keyframe to the next is the GOP (Group of Pictures)
- Lossless cuts and seeking start cleanly only at a keyframe