Ch. 21 · Platform Uploads and Re-encoding

한국어日本語
8 min

Building the Source, Part 1: High Quality, Same Resolution and Frame Rate

The file you upload should be the highest-quality source you can manage, not a final version you've already shrunk. Don't change the resolution or frame rate arbitrarily, and lower CRF only as far as the file size allows.

Reducing re-encoding loss isn't hard. It comes down to damaging the video as little as possible before it gets re-encoded. Let's split this into three parts. This lesson covers the first two, quality and resolution/frame rate; the next lesson covers color metadata.

Principle 1: Set your editor's source and export settings high

If you export your footage or edit straight to an upload file, give the export a generous bitrate. A high-quality preset in your editing software, or an intermediate codec used in broadcast and post-production, are candidates, but files can get very large, and whether the platform accepts that format has to be checked in its official help pages. If you build the file on the command line, the direction is to set CRF lower (= higher quality) than you would for normal delivery.

An example upload source. The CRF and preset values are only a starting point; check them on your own video and pick from there
ffmpeg -i edit-master.mov \
  -c:v libx264 -preset slow -crf 16 -pix_fmt yuv420p \
  -c:a aac -b:a 192k \
  -movflags +faststart upload.mp4
  • The lower the CRF, the higher the quality and the larger the file (CRF, 2-pass, CQ). What's appropriate varies from video to video and can't be set to one number; even the same CRF gives very different results depending on the clip (Why the same CRF gives different results).
  • The slower the preset, the smaller the file at the same quality (choosing a preset). An upload source is a file you make once and are done with, so you can afford to spend more time.
  • If file size is the problem, check this first. If you have to shrink the file because of an upload size limit or your connection speed, you can calculate the bitrate needed for your target size with the video size and bitrate calculator and aim for a target bitrate instead of CRF.

Principle 2: Don't change the resolution or frame rate arbitrarily

The default is to leave the resolution and frame rate as shot. There are two reasons. First, once you reduce them, you can't go back. Second, when the platform lowers the resolution for viewing it does its own processing, so if you shrink first, the platform processes it again on top. Frame rate needs particular care. Forcing a change between values like 24, 25, 30, and 60 can duplicate or drop frames and make motion stutter (frame rate review, the fps filter).

ItemRecommended directionWhy
ResolutionKeep the resolution you shot and edited atYou can't restore it after shrinking, and if the platform shrinks it again it's processed twice
Frame rateKeep the original value. If variable, make it constantArbitrary conversion can cause stuttering motion (timestamps)
Dimensions (width × height)Even numbers for yuv420pBecause of chroma subsampling, odd dimensions cause problems in H.264
BitrateGenerous, within what you can affordThe cleaner the input, the better the result after re-encoding
The trap of 'the platform will shrink it anyway, so I'll shrink it first'

Shrinking the resolution before uploading has the advantage of a faster upload, but your shrinking step and the platform's re-encode overlap. Especially for video that viewers might watch on a big screen, the resolution you choose for the uploaded file can become the ceiling on the best quality viewers can get. Check the platform's official help pages for which quality tiers are created from which resolution.

CRFCRF

The quality-based rate control mode of x264 and x265. The lower the number, the higher the quality and the larger the file.

VFR (variable frame rate)VFR (variable frame rate)

Video whose frame intervals are not constant. It shows up in screen recordings and some smartphone footage.

Check yourself

Which is the correct default direction when building a source to upload to a platform?

Check yourself

When you need to fit a file within a specific size because of an upload size limit, which tool on this site can you use?