BlogVideo

Cutting video without losing quality - and why key frames matter

A lossless cut takes seconds and changes nothing, but it can only start on a key frame. Here is what that means and when to choose the exact mode.

AIOMediaTools 2 min read

Most video editors re-encode the whole file when you cut it. That takes time and loses a little quality every time. A cutter that works by copy takes seconds and loses nothing. There is one catch, and it is worth understanding.

How a video is stored #

A video does not hold every frame as a full picture. That would be huge. Instead it stores a complete picture now and then - a key frame - and for the frames between, only what changed. To show frame 100, the player starts at the last key frame and applies the changes one by one.

Key frames come every second or two, depending on how the video was made.

What this means for cutting #

When you cut by copy, the tool takes the stored data as it is. It cannot start in the middle of a group of frames, because the first frame of the new file would have no full picture to build on. So a lossless cut starts on a key frame.

The Cutter & Joiner handles this openly. You mark a start; the tool moves it to the key frame before your mark and tells you by how much. The start is a little early, never late, so nothing you wanted is missing.

Two modes #

Lossless copies picture and sound bit for bit. It is instant. The cost is that the start moves to a key frame.

Exact cuts at your mark. For H.264 and HEVC video it encodes only the frames between your mark and the next key frame and copies the rest. The result is frame-exact and nearly everything is untouched. Some files need a full re-encode for an exact cut - interlaced video, or files with open groups of pictures. The tool tells you before you start.

Which to choose #

  • Trimming the dull start and end of a recording: lossless. A second more or less does not matter.
  • A clip that must begin on one particular frame: exact.
  • Several parts from one long video: mark them all, then export a file per part. In lossless mode this is still instant.

Make the marks easy #

Press I and O to mark a part, S to split. Page Up and Page Down jump between key frames. Snap marks to key frames moves your marks to where the lossless cut will really start, so what you see is what you get.

Joining the pieces #

You can join files without encoding when codec, picture size, pixel format and sound format match. The tool compares the files and lists any difference. If they differ you can let the tool encode them to match one reference file, or leave one out.

What to remember #

Lossless is a copy: same quality, instant, key-frame starts. Exact is a small re-encode at the edges. Know which one you need, and cut.

Written by AIOMediaTools

We build AIOMediaTools and write here about the daily work it is made for: photos, videos and audio files.