If you publish on YouTube, you already live with containers and codecs, even if you never open a settings panel. The file you upload, the stream a viewer receives, and the archive you keep are often three different encodings of the same work. This walkthrough covers what MP4, WebM, and M4A actually are, when to use them, and how to choose a quality from 144p to 4K when you are saving your own videos, a Creative Commons source, or any other copy you are permitted to keep offline.
Containers and codecs are not the same thing
A container is the box ( .mp4 , .webm , .m4a ). A codec is the compression recipe inside it (H.264, VP9, AAC, Opus). Players have to understand both, which is why a file can be "an MP4" and still refuse to play: the box is fine, the codec is not.
YouTube itself is a useful example. The site accepts a fairly wide set of upload containers, then re-encodes your video so phones, TVs, and browsers can each request something they can decode.…