Skip to content
anYTrim

Understanding it

Why the clips are actually lossless

What a stream copy is, why it matters, and the one thing it cannot do.

3 min read

"Lossless" gets used loosely enough to be meaningless. Here is the precise
claim anYTrim makes, and the precise limit on it.

The claim

A clip's video and audio data are byte-for-byte identical to the
corresponding bytes of the source file.
Not visually indistinguishable —
identical. You can verify it with a checksum, and the
clipping guide shows how.

What changes is the container around those bytes: timestamps are rebased so
the clip starts at zero, and the index is rewritten. The compressed frames
themselves are copied, not decoded and re-compressed.

Why that matters

Video compression is lossy. Every encode throws away detail permanently, and
the next encode throws away detail from the already-damaged version. This is
generation loss, and it compounds.

Original  →  the platform's encode  →  your editor's export  →  platform again
  100%              ~80%                      ~65%                    ~50%

Those numbers are illustrative. The shape is not.

A normal "cut a clip" workflow in a video editor adds one of those steps for
no reason at all: you are re-encoding the entire clip purely to change where
it starts and ends. anYTrim removes that step:

the platform's encode  →  anYTrim clip  →  platform again
       ~80%                   ~80%              ~65%
                          (identical)

You keep a whole generation. For anyone making clips, this is the single
largest quality win available, and it costs nothing — not money, not time,
not hardware.

How it works

Under the hood, the cut is FFmpeg's stream copy:

ffmpeg -ss <start> -i input.mkv -to <end> -c copy output.mkv

-c copy is the whole trick. It tells FFmpeg to demux the input, select the
packets in the range, and mux them straight into the output without ever
handing them to a decoder. There is no encoder in the pipeline, so there is
nothing to lose quality to and nothing for a CPU to grind through.

That is also why it is fast and why it needs no graphics card. Clipping is
I/O and arithmetic. A four-minute export in an editor is four minutes of
encoding; here there is no encoding to do.

The keyframe constraint

This is the real limit, and it is not a bug.

Compressed video does not store every frame whole. A keyframe (or
I-frame) is a complete picture. The frames after it are stored as differences
from their neighbours, and they are meaningless without the keyframe they
depend on. Keyframes typically appear every one to two seconds, and on a
long-GOP codec like VP9 or AV1 sometimes further apart.

A stream copy therefore has to begin on a keyframe. If your IN point falls
between two, the clip must start at the earlier one — otherwise the first
second would be built from differences against a picture that is not in the
file.

So you get exactly one of these two things:

  • A bit-identical clip whose start time snapped backwards a little.
  • A frame-exact clip whose opening section was re-encoded.

Not both. Anyone claiming otherwise is doing the second one and not
mentioning it.

anYTrim picks the first and shows you where the cut really landed in the
"Really starts at" column. The OUT point is unaffected: the end of a clip can
fall anywhere, because trailing frames can simply be dropped.

When you need frame-exact instead

Use an editor, and start from the lossless clip rather than from the master.
That way you spend exactly one generation instead of two. If you are doing
serious frame-exact work, convert to an intra-frame mezzanine codec — DNxHR
or ProRes — where every frame is stored whole, so every frame is a valid cut
point. Expect roughly ten times the file size.

Why downloading is separate from clipping

Downloading is yt-dlp's job and clipping is FFmpeg's, and anYTrim runs both
as separate programs rather than embedding them.

That matters for a reason worth stating: yt-dlp ships extractor fixes most
weeks
, because the sites it reads keep changing. Running it as a subprocess
means a fix is a file swap, not a new release of anYTrim. It also means every
command the app runs is a command you could have typed, and can inspect.

Verifying it yourself

Do not take the claim on trust. The clipping guide
has a short procedure: extract the same byte range two ways and compare the
hashes. They match, or the claim is wrong.

Found a mistake, or something unclear? These pages are markdown files in the repository — a pull request is welcome, or report it.

A choice about measurement and adverts. We count page views in our own database — which guides get read, where downloads come from — and we show a few Google adverts on the guides to cover what this costs. Nothing is sold or shared, and nothing is gated behind either answer. Choose them separately.