The Youtube H.264 / mp4 lie. Forget the export madness!
If you search the internet for the best export options for uploading videos to YouTube, you will always come across videos and blog posts that present exporting as H264 codec in MP4 format as a panacea. The reality is different. YouTube re-encodes every upload, no matter what format you upload it in. The only advantage of this format is the fast upload, because the file size is smaller.
However, if you want to upload your video in the best possible quality, you should avoid quality-reducing encoding altogether.
No matter how you upload your video, Youtube will never say “Oh, that’s a great codec, I’ll keep that”. Because Youtube will always compress your video down as much as possible, so that it uses less memory in the data center and generates less traffic when you watch it.
But wait: Youtube itself says that you should upload all files in H.264 and MP4 format? Yes, exactly, because Youtube doesn’t see the point in accepting thousands of billions of cat videos in lossless format every day. That would cost Youtube a lot of money.
Fact is, it makes absolutely no sense to compress your video before uploading it. Youtube will do it again anyway and any compression process done in series will result in lower quality.
If there is a reason to compress before uploading, it is to shorten the upload time. If you have enough time, you should rather upload a video in HQ422 or ProRes or DNxHR that corresponds to the source in favor of the quality. Youtube can handle it – without problems and quality loss.
Therefore, do not change the bitrate, resolution or codec. Youtube will do what it wants with it later anyway.
Attention: If you upload videos with a higher resolution than 1080p, Youtube will automatically switch to the VP9 codec for all versions of the video, including 1080p. With this VP9 codec, better results are achieved for all resolutions. Therefore, it even makes sense to upscale 1080p video to 4K first and then upload it.