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:

Mediainfo rotate tag

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.

  • Could you provide an example ffmpeg command line to set the Rotation tag let's say to 90° in the answer? Thank you very much! – user3450548 Nov 16 '15 at 14:37
  • See this earlier answer: video.stackexchange.com/a/16340/1871 – Gyan Nov 16 '15 at 14:47
  • Thanks so much, for the information as well as the tool. I installed Mediainfo, and sure enough, rotation value was 90 degrees for the file in question (counter clockwise). I read somewhere that the rotation tag can be changed while recording if the recorder is so capable. How would this tool handle that? Just curious. – Sabuncu Nov 19 '15 at 16:49
  • The rotation tag isn't dynamic i.e. 90 for the first minute 180 for the rest. Never seen that happen. Is that what you're asking? What you read probably meant that before the file is finalized on the recorder, the user could specify a value manually. – Gyan Nov 19 '15 at 17:04
  • Thanks, yes that's what I meant (dynamic) - can't locate where I read that, but it doesn't matter now, based on your comment. – Sabuncu Nov 19 '15 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.