Skip to content
anYTrim

Understanding it

Codecs and resolutions

What to download, what to upload where, and why uploading at a higher resolution improves quality even for viewers watching at 1080p.

6 min read

Everything here answers one question: how do you end up with the best
quality after a platform has had its way with your video?

No prior knowledge assumed. If you read one section, read the next one.

Every platform re-encodes everything

YouTube, Instagram, TikTok, X — all of them. There is no file so good it gets
left alone.

So the goal is never "upload the perfect file". It is hand the platform the
healthiest possible source, and avoid damaging it yourself on the way there.

That is the entire reason anYTrim never re-encodes a clip.

What YouTube actually offers

The stream list is not arbitrary. YouTube encodes each video several times,
and which codecs exist depends on the resolution.

Resolution Codecs Notes
144p – 1080p H.264, VP9, AV1 H.264 is the universally compatible one
1440p (2K) VP9, AV1 only No H.264 above 1080p, anywhere
2160p (4K) VP9, AV1 only
4320p (8K) AV1 only Rare

There is no H.264 above 1080p on YouTube. This surprises people
constantly. If your editing software insists on H.264, 1080p is your ceiling
— and that is YouTube's decision, not anYTrim's.

The three codecs

Codec Year Efficiency Plays everywhere? Edits smoothly?
H.264 (AVC) 2003 Baseline Yes, universally Yes
VP9 2013 ~30% better than H.264 Mostly Poorly
AV1 2018 ~30% better than VP9 Modern devices Poorly

"Better" means the same visual quality in a smaller file. A 4K AV1 stream at
20 Mbps looks like H.264 would at roughly 40 Mbps.

Which stream should I pick?

Your goal Pick Why
Clip and re-upload Highest resolution available, usually 4K AV1 Best source, and the clip is not re-encoded
Archive Highest resolution available Same reasoning; storage is cheap
Edit in Premiere / Resolve / CapCut 1080p H.264 The only format that scrubs smoothly without extra work
Edit at 4K anyway 4K AV1 plus proxies, or a mezzanine See below
Watch on a phone or old laptop 1080p H.264 Hardware decoding, no battery drain
Just the audio Opus, format original No conversion of an already-lossy track
Save space 720p H.264 Noticeably smaller, still fine on a phone

The biggest lever: resolution

This is the part most people get wrong, so it gets its own section.

YouTube chooses how hard to compress your upload based on the resolution
you give it
. Uploads above 1080p are encoded with VP9 and AV1 at generously
higher bitrates. Uploads at 1080p and below mostly get H.264 at a lower one.

The consequence is counter-intuitive:

Uploading a 1440p or 4K file produces a better-looking video even for
someone watching it at 1080p
, because the 1080p rendition is derived from
a higher-quality encode.

In order of impact:

  1. Upload the highest resolution you have. Do not downscale 4K to 1080p
    "to save time". It costs quality and buys nothing.
  2. If your clip is 1080p, consider upscaling to 1440p before upload. This
    adds no real detail, but it moves you onto the better encoding ladder. A
    genuine trick, widely used, and the one case where adding an encode is
    worth it.
  3. The codec of the uploaded file barely matters. H.264, VP9 and AV1 are
    all accepted and all re-encoded.

Do not re-encode a 4K AV1 clip to AV1 before uploading. It is already
AV1. Re-encoding it is pure loss with no upside. Upload what anYTrim produced,
exactly as it is.

Platform cheat sheet

Platform Upload Notes
YouTube (landscape) Highest resolution you have, as-is 4K and 1440p get the better codec ladder
YouTube Shorts 1080×1920 vertical, up to 3 min Needs reframing, which does mean a re-encode
Instagram Reels 1080×1920, H.264 Compresses hard; start from the best source
TikTok 1080×1920, H.264 Compresses hardest of all
X 1080p, H.264, mp4 Strict limits; 1080p is effectively the cap
Discord 720p–1080p H.264 Upload size limits bite first

Anything needing a vertical crop or burned-in captions will be
re-encoded, because the pixels genuinely change. Do that step last, once,
starting from the lossless clip.

Why 4K feels broken in an editor

VP9 and AV1 are long-GOP: most frames are stored as differences from
other frames, so the computer must decode a run of frames to show you any
single one. Excellent for file size, terrible for scrubbing.

Three ways out, best first:

  1. Edit 1080p H.264. Download that stream instead. No conversion, no
    proxies. The right answer for most people.
  2. Use proxies. Premiere and Resolve generate low-resolution stand-ins
    for editing and swap the originals back for export. Built in, free.
  3. Convert to a mezzanine codec (DNxHR or ProRes). Every frame stored
    independently, so it scrubs instantly and is visually lossless — at
    roughly ten times the file size. Use it when you need frame-exact
    cuts.

Audio

Codec Typical Verdict
Opus 128–160 kbps Best quality per bit. YouTube's default.
AAC 128–256 kbps Slightly worse at the same bitrate, plays everywhere
MP3 128–320 kbps Only if something old demands it
FLAC / WAV Huge Pointless here — the source is already lossy

Set the audio format to original unless you have a reason not to. Choosing
mp3 or flac re-encodes an already-lossy track; flac in particular gives
you a large file that is losslessly preserving existing damage.

The clean workflow

  1. Fetch the link. Pick the highest resolution on offer.
  2. Download it, or clip straight from the URL to fetch only the ranges you
    want.
  3. Set IN and OUT. anYTrim cuts as a stream copy — seconds, not minutes, and
    nothing lost.
  4. Upload the clip exactly as it came out. No "convert to mp4 just in
    case". No re-encode to AV1. No downscale.
  5. Only if you need captions, a vertical crop or an overlay: do that once, in
    an editor, starting from the lossless clip — so you spend one generation
    instead of two.

Your upload then carries one less round of compression than everybody doing
the same thing through a conventional editor.

Quick answers

"Which is best: H.264, VP9 or AV1?" For downloading and clipping: AV1,
because it is the highest quality available and anYTrim will not touch it.
For editing: H.264, because everything plays it smoothly.

"Should I convert my clip to AV1 before uploading?" No. If it is already
AV1 you would be re-encoding for nothing. If it is H.264 you would spend a
generation for no benefit, since the platform re-encodes it anyway.

"Why is my 4K file 5 GB?" Because it is 4K. At 20 Mbps, an hour is about
9 GB. Clip first, keep the clip, delete the master.

"Is mkv safe to upload?" Yes. Every major platform accepts it.

"Does uploading at a higher resolution really help?" Yes, and it is the
single most effective thing you can do.

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.