So YouTube took its own free alternative-VP9 (video quality is not worse than H.265). H.265 codecs charge higher licensing fees.
On the Google Support site, it still regards H.264 as the best video codec for YouTube upload. YouTube supports HEVC H.265 video uploading (hasn’t announced official support). It is able to offer decent video quality and is good for video storing and streaming. MP4 is the most popular video container format for a video to store and stream videos over the Internet. When the file format of your video is among the supported ones, you can make things better by picking the best video format for YouTube 1080p/4k. Checking out the format of your 1080p/4k video before uploading them. If YouTube does not support your video format, you will receive an error message saying 'Invalid file format'. After receiving the videos, YouTube will process them and make them faster to load and stream while keeping the best possible quality. Videos of different sizes, resolutions, and formats are uploaded to YouTube. David Taylor, David Newman, and Brian Schunck, GoPro