Where sideways video comes from
A phone camera sensor has a fixed orientation. When you hold the phone one way, the frames come off the sensor rotated, and rather than turning millions of pixels in real time the phone writes the frames as they are and adds a note in the container saying which way up they go. That note is honoured by phones, by browsers and by most players. It is routinely dropped by older editors, by some upload pipelines and by anything that re-muxes the file carelessly, which is why the same clip can be upright in your camera roll and on its side after a round trip through a web tool.
