Just to be clear it is probably a good thing that YouTube re-encodes all videos. Videos are a highly complex format and decoders are prone to security vulnerabilities. By transcoding everything (in a controlled sandbox) YouTube takes most of this risk on and makes it highly unlikely that the resulting video that they serve to the general public is able to exploit any bugs in decoders.
Plus YouTube serves videos in a variety of formats and resolutions (and now different bitrates within a resolution). So even if they did try to preserve the original encoding where possible you wouldn’t get it most of the time because there is a better match for your device.
MrSoup@lemmy.zip 2 weeks ago
You are right. For example you can upload an avi to YouTube, but they will never host and stream an avi.
DdCno1@beehaw.org 2 weeks ago
AVI is a container, not a codec. An AVI container can contain video encoded with any kind of codec (unlike some other container formats, which are more restrictive). If you want to, you could put e.g. a VP9 or AV1 video stream (so the ones that YouTube is using) into an AVI container. In theory at least, if you uploaded an AVI file containing VP9 video, YouTube could just extract it from the container and stream it as is, but they’ll still re-encode it. Before you think that all of this talk of modern codecs in AVI containers is theoretical, AVI is used a a standard for archiving with some institutions, so it’s more relevant than you might think.
However, you are partially right in that AVI can not be used for streaming, not just by YouTube, but in general, since this requirement obviously wasn’t taken into account when it was introduced in 1992 and thus not incorporated into this standard.