What Are Keyframes? Why They Matter for Video Cutting
Learn what keyframes (I-frames) are, how inter-frame compression works, and why keyframes determine where you can cut video losslessly. Beginner-friendly.
The Basics: How Video Compression Works
A video file isn’t just a series of independent images played in sequence. If it were, file sizes would be enormous — a 1080p frame is about 6 MB uncompressed, which means 30 fps video would generate 180 MB per second.
Modern video codecs (H.264, H.265, AV1) solve this by exploiting a simple fact: most of what’s in one frame is also in the next frame. The background doesn’t change. Objects move slightly. Only a small portion of the image is actually different.
Instead of storing every frame as a complete image, codecs store:
- A complete reference frame (called a keyframe or I-frame)
- Differences from the previous frame (called P-frames and B-frames)
This is called inter-frame compression, and it’s why a 2-hour movie fits on a 4 GB file instead of taking 2 TB.
The Three Frame Types
I-Frames (Keyframes)
An I-frame (Intra-coded frame) is a complete, self-contained image. It doesn’t reference any other frame. You can decode and display an I-frame by itself.
Think of it as a photograph — it contains all the information needed to show the image.
P-Frames (Predicted Frames)
A P-frame (Predicted frame) stores only the differences from a previous frame. It says “start with the last frame, then move this block 3 pixels to the right, change these pixels from blue to green.”
P-frames are much smaller than I-frames — typically 30–50% of the size.
B-Frames (Bi-directional Frames)
A B-frame (Bi-directional frame) references both a previous and a future frame. It can say “blend between the frame before and the frame after.” B-frames are the smallest, often 10–20% of an I-frame’s size.
Why This Matters for Video Cutting
Here’s the critical implication: you can only start playback from a keyframe.
If you try to play from a P-frame, the decoder doesn’t have the reference image it needs. It would try to apply differences to a frame that doesn’t exist, producing garbage or an error.
This is why:
- Seeking in a video player sometimes jumps to a slightly different position than where you clicked — it snaps to the nearest keyframe
- Lossless video cutting can only start at keyframe boundaries
- Cutting between keyframes requires re-encoding the frames between the cut point and the nearest keyframe
Example
Imagine a 60-second video encoded at 30 fps with keyframes every 2 seconds:
Frame 0 (I) → Frame 1-59 (P/B) → Frame 60 (I) → Frame 61-119 (P/B) → Frame 120 (I) → ...
If you want to cut at exactly frame 45 (1.5 seconds in):
- Lossless cut: Must snap to frame 0 (0s) or frame 60 (2s) — can’t start at frame 45
- Re-encoded cut: Can cut at exactly frame 45, but must re-encode frames 0–60 to create a new I-frame at frame 45
Keyframe Intervals (GOP Size)
The distance between keyframes is called the GOP size (Group of Pictures). Common values:
| Content | Typical GOP | Keyframe every |
|---|---|---|
| Screen recording | 60–120 frames | 2–4 seconds |
| Streaming video | 30–60 frames | 1–2 seconds |
| YouTube uploads | 30 frames | 1 second |
| Broadcast TV | 15–30 frames | 0.5–1 second |
| Blu-ray movies | 24–48 frames | 1–2 seconds |
A shorter GOP means more keyframes, which means:
- More precise lossless cutting (more potential cut points)
- Faster seeking in video players
- Larger file sizes (I-frames are bigger than P/B-frames)
A longer GOP means fewer keyframes:
- Better compression (smaller files)
- Less precise lossless cutting
- Slower seeking
How Lossless Trimmers Handle Keyframes
Keyframe-Snap Approach
Most lossless trimmers snap your cut point to the nearest keyframe. If you select 1m30s as your start point and the nearest keyframes are at 1m28s and 1m32s, the tool cuts at one of those positions.
This is the simplest approach and guarantees zero quality loss. The output is a perfect subset of the original file data.
Smart Cut (Hybrid) Approach
Some advanced tools offer “smart cut” or “exact cut” mode. Here’s how it works:
- Find the keyframes before and after your desired cut point
- Re-encode only the frames between the keyframe and your cut point (creating a new I-frame)
- Copy everything else losslessly
This gives you frame-accurate cuts while re-encoding less than 1% of the video. The re-encoded frames may have a barely detectable quality difference, but for practical purposes it’s indistinguishable.
Visualizing Keyframes
When you open a video in a lossless trimmer like DalCut, the timeline shows keyframe positions as markers. This helps you:
- See exactly where you can make lossless cuts
- Understand why the tool snaps to certain positions
- Choose cut points that align with keyframes for perfect lossless output
If your cut point is between keyframes, the tool shows you the nearest valid positions so you can make an informed choice.
Practical Tips
1. Record with shorter keyframe intervals
If you know you’ll be trimming later, configure your recording software to use a GOP of 30–60 frames (1–2 seconds at 30 fps). This gives you more keyframe positions for precise lossless cuts.
In DalVideo, the default settings produce keyframes every 2 seconds, which is a good balance between file size and cut precision.
2. Don’t worry about exact cuts
For most trimming tasks — removing intros, cutting end credits, extracting clips — a 1–2 second margin is perfectly fine. You rarely need frame-exact precision for these operations.
3. Use AI scene detection
Scene transitions often happen at or near keyframes (since rapid visual changes generate more I-frames during encoding). AI scene detection in tools like DalCut identifies these natural boundaries, which often align well with keyframe positions.
4. Check before re-encoding
Before accepting a re-encoded cut, ask yourself: does the extra 1–2 seconds really matter? Lossless cutting at the nearest keyframe preserves perfect quality. Re-encoding introduces potential artifacts, even if minimal.
The Bottom Line
Keyframes are the anchor points of video compression. They’re complete images that make seeking and cutting possible. Understanding them helps you:
- Know why lossless cuts snap to specific positions
- Make informed decisions about precision vs. quality
- Configure recording settings for easier editing later
For everyday video trimming, you don’t need to think about keyframes at all — your cutting tool handles it automatically. But understanding the concept helps you make better decisions about when lossless cutting is sufficient and when re-encoding is genuinely needed.
Most of the time, lossless is enough. And that means faster processing, perfect quality, and smaller files. Try it yourself with DalCut — the timeline shows keyframe positions so you can see exactly how it works.