I-frame (keyframe)
An I-frame (intra-coded frame), also called a keyframe, is a complete video frame that is compressed on its own without referring to any other frame. An I-frame in video is unrelated to an HTML iframe on a web page. Players can start decoding from an I-frame, which makes I-frames essential for seeking and starting streams. I-frames are much larger than P-frames or B-frames.
Why it matters
I-frames decide how quickly a video starts, how precisely viewers can seek and how cleanly players switch quality. They are also the most expensive frames to store and send. Placing too few makes seeking and joining slow; placing too many wastes bandwidth on every view.
How it works
- The encoder compresses an I-frame using only the pixels inside that frame, like a still image.
- Following P-frames and B-frames store only changes and point back to the I-frame as their reference.
- When a viewer seeks or joins a stream, the player jumps to the nearest I-frame and starts decoding there.
- Encoders insert I-frames at a set interval and at scene cuts, where predicting from earlier frames would fail.
What is the difference between I-frames, P-frames and B-frames?
I-frames are complete pictures, P-frames store changes from earlier frames, and B-frames borrow from both earlier and later frames. That order also runs from largest to smallest. A player can start decoding only at an I-frame, while P-frames and B-frames depend on references.
How often should I-frames appear in a stream?
For streaming, a keyframe every 2 seconds is a common default. It lets players join and switch quality quickly without wasting many bits. Apple's HLS guidance and YouTube Live's encoder guidance both recommend 2 seconds. On-demand files meant only for download can use longer gaps to save space.
Is an I-frame the same as an HTML iframe?
No. A video I-frame is a fully coded picture inside a video stream. An HTML iframe is a web page element that embeds one page inside another, such as an embedded video player. The names only look alike, and searches for one often turn up the other.
Where it's used
OTT services and live sports streamers place I-frames at regular points so viewers can join, seek and switch quality cleanly. Short video apps use them to make scrubbing feel instant.
Where it usually goes wrong, and how FastPix handles it
Teams often encode with sparse keyframes to save bits, then find that seeking lands late, scrub previews feel imprecise and viewers wait after jumping ahead.
Scrubbing previews in the FastPix player come from storyboard sprite sheets, so viewers can see where they will land before they let go. Video Data measures seek latency for every view, so teams can find slow seeking on specific devices and fix it before it costs them viewers on long videos.
By the numbers
- Apple's HLS authoring specification says key frames (IDRs) should be present every two seconds. (Apple Developer: HLS Authoring Specification for Apple Devices)


