The Problem Everyone Runs Into
You cut a clip to start at 0:30. The result starts at 0:26. Or it starts at the right moment, but the picture is frozen for two seconds while the sound plays. Or — the strangest case — the clip has sound and no picture at all. None of this is a bug in your file. It follows directly from how video is stored, and once you know the reason, you also know how to avoid it.
We ran into exactly this while testing our own video trimmer: a ten-second screen recording, cut from second 2 to second 5, came out as an audio-only file. The explanation is a single word: keyframes.
A Video Is Not a Stack of Pictures
If a camera saved every frame as a complete image, one minute of Full HD video would be several gigabytes. Video codecs such as H.264, H.265 and VP9 avoid that by storing most frames as differences. A frame says, in effect, "the same as the previous one, except this region moved a little to the left".
Only now and then does the encoder store a complete, self-contained picture. That is a keyframe (also called an I-frame). Every frame after it depends on it, directly or through a chain of other frames, until the next keyframe arrives.
How often keyframes appear is a setting of the encoder. Phone cameras typically write one every second or so. Streaming and screen-recording software often uses 2 to 10 seconds, because fewer keyframes mean smaller files. Some screen recordings have a single keyframe at the very start and none after it for a long time.
What "Cutting Without Re-encoding" Really Does
Many trimming tools advertise that they cut "instantly, without quality loss". They do this by copying the stored data from the start time to the end time into a new file. Nothing is decoded and nothing is encoded, so it is fast and the copied frames are bit-for-bit identical to the original.
The catch: a copy can only begin at a keyframe. A frame that says "like the previous one, but…" is useless when the previous one is not in the file. So the tool has three options, and different tools choose differently:
- Start earlier. The cut is moved back to the nearest keyframe before your start time. Your clip is a few seconds longer than you asked for.
- Start on time, with broken frames. The file begins with frames that cannot be decoded. Players show a frozen or grey picture until the next keyframe comes along, while the sound plays normally.
- Drop the picture. If the part you selected contains no keyframe at all, there is nothing a player can ever display. You get sound only. This is what happened to our screen recording.
The shorter the clip and the rarer the keyframes, the more likely the third case becomes. A three-second cut from a recording with a keyframe every ten seconds will usually miss all of them.
The Exact Way: Decode and Encode Again
The alternative is to decode the video from the last keyframe before the start time, throw away everything before your start point, and encode the part you want as a new video. The new file begins with a fresh keyframe exactly where you asked.
| Copying the data | Encoding again | |
|---|---|---|
| Start and end point | Nearest keyframe, often seconds off | Exactly where you set them |
| First frames | Can be frozen or missing | Always a clean picture |
| Speed | A few seconds | Depends on the length of the clip |
| Picture quality | Identical to the source | Very slightly lower; invisible at high quality settings |
The price is one more generation of compression. With a high quality setting, that loss cannot be seen at normal viewing size. Our trimmer now always works this way and encodes the kept part with H.264 at a high constant-quality level (CRF 20) and 160 kbps AAC sound. We made that change after the test above, because a clip that reliably has a picture is worth more than a few seconds of waiting.
When Copying Is Still the Right Choice
Copying is not wrong; it is a different tool. It is the better choice when you are splitting a two-hour recording into large chapters and a second or two of slack does not matter, when the file is enormous and encoding it again would take a long time, or when the footage will be edited further and you want to avoid any extra compression.
Desktop programs such as LosslessCut are built for this and show you where the keyframes are, so you can place your cuts on them. If you need a short, precise clip — a highlight, a GIF source, a quote for a presentation — encoding again is the reliable route.
Practical Tips
- Clip starts too early or frozen? The tool copied the data. Use one that encodes the clip again.
- Planning to make a GIF? Trim first, then convert with MP4 to GIF. GIF files grow by roughly 100 KB or more per second at modest settings, so every second you remove counts.
- Recording your screen for later cutting? If your recorder has a "keyframe interval" setting, 1 or 2 seconds makes the recording much easier to cut and to scrub through, at the cost of a slightly larger file.
- Removing a part from the middle means making two clips — before and after — and joining them in an editor.
- Clip still too large? Lower the resolution or run it through the video compressor afterwards. More on how codecs work is in Video codecs explained.