How to trim a video without losing quality

Most apps re-encode a video when you trim it, which loses a little quality every time. A keyframe cut copies the frames untouched. It has one limitation worth understanding.

Updated

Why trimming usually costs quality

When an editing app exports a trimmed video, it normally decodes every frame and compresses it again from scratch. Compression discards detail each time it runs, so the export is slightly worse than the original even if you only removed two seconds. Do it a few times, or pass the result through a chat app that compresses it again, and the loss becomes visible.

It is also slow, because every frame is processed, and it drains the battery.

None of that is necessary for a simple cut. The frames you want already exist in the file. They only need copying into a new one.

How video frames are stored

To see why copying has a catch, you need to know one thing about video files. They do not store each frame as a complete picture. They store three kinds of frame:

  • Keyframes are complete pictures. They are large.
  • Predicted frames store only what changed since an earlier frame. They are small.
  • Bidirectional frames store changes relative to frames both before and after. They are smaller still.

A typical file has one keyframe followed by dozens of the other kinds, then another keyframe, and so on. Phone cameras usually place a keyframe every second or so. Videos that have been edited or downloaded can have them several seconds apart.

A predicted frame is meaningless on its own. To show it, the player needs the keyframe before it and every frame in between.

The one limitation

A copied clip therefore has to begin on a keyframe. If you choose a start point between two keyframes, the cut moves back to the keyframe before it, and your clip begins up to a second or two earlier than you asked.

The end of the clip has no such restriction. You can stop after any frame, because nothing later is needed to show what came before.

Sound is easier. Audio is stored in tiny independent packets, each about a fiftieth of a second long, so it can be cut almost anywhere.

Doing it

  1. Open the video trimmer and choose your video.
  2. Set the start and end. Leave Fast cut selected.
  3. Read the line under the settings. It tells you where the clip will really start, and how much earlier that is than the point you chose.
  4. Press Cut video. It finishes in about a second, because nothing is decoded.

The new file has exactly the same picture and sound quality as the original, the same resolution and the same rotation. It is smaller only because it is shorter.

When you need the exact frame

Sometimes a second of lead-in is not acceptable: the clip must start on the beat, or the frames before it show something you want gone. Then the video has to be re-encoded from your chosen frame, which is what Exact cut does. To keep the loss small:

  • Re-encode once. Make all your cuts from the original, never from an earlier export.
  • Use a high quality setting. The trimmer's exact cut does this for you.
  • Cut only as much as you need. A short clip is quick to process.

A practical habit

If you know you will trim a recording later, start recording a couple of seconds early and let it run a couple of seconds late. With spare footage at both ends, a keyframe cut that begins a second early costs you nothing, and you keep the original quality.

Converters for this

More guides