What determines video orientation (landscape or portrait) during playback? I captured a short video on my Android phone in portrait mode (i.e. to be viewed vertically).  When I played it on Windows 7 using WMP (or VLC), it displayed incorrectly in landscape orientation.

Thinking that I had to rotate it, I transferred the video to a Windows 10 laptop to process in After Effects.  To my surprise, I found out that it plays in the correct portrait mode on Windows 10 (using whatever is the default player that comes with Windows 10), and also plays correctly when imported into After Effects, requiring no rotation.

What determines how a video is oriented during playback?
If the video is meant to be played in a different orientation than its stored representation, then a rotation flag is set in the stream metadata. A compliant player uses that tag and rotates the video during playback.

A tool like Mediainfo will display that data (if specified) like here:



A tool like ffmpeg can reset the tag. Of course, you'll also want to rotate the video stream as currently stored so it plays in the correct orientation after the tag has been reset. ffmpeg's transpose filter can do that.