Why Does My Video Play Sideways? The Rotation Flag Explained
A video plays upright on the phone that shot it and on its side somewhere else — an older player, an editing app, a website. The video is not broken. It is carrying an instruction that the second program ignored.
How phones store a portrait video
A phone’s camera sensor has one natural orientation. Rather than rotate every frame as it records, the phone saves the frames the way the sensor saw them and writes a small rotation flag into the file: “display this turned 90°”.
Programs that honour the flag show it upright. Programs that ignore it show exactly what is stored — the picture on its side. Same file, two answers, and it is the commonest surprise in phone footage.
How to check
The video quality checker reads the file’s headers and says so directly when it finds one: “The picture carries a 90° rotation flag rather than being stored upright.” That is a note, not a fault — a rotated phone video is a normal file — but it tells you why one app shows it wrong.
With ffmpeg installed, ffprobe shows it too, as a rotation or display-matrix
entry on the video stream.
How to fix it
There are two ways, and the difference matters.
1. Bake the rotation into the pixels (works everywhere). Re-encode the video: the frames are turned upright and the flag is removed, so every player agrees. With ffmpeg this happens by default when you re-encode:
ffmpeg -i input.mp4 -c:v libx264 -crf 18 -c:a copy output.mp4
ffmpeg applies the rotation as it decodes, so the output is stored upright.
-crf 18 keeps the quality loss of the re-encode negligible. Most editors do the
same when you export.
2. Use a player that honours the flag. Modern browsers and mainstream players do. This fixes viewing, not the file — the next program may still get it wrong.
There is no lossless way to make a file upright for players that ignore the flag: the stored frames are sideways, and only re-encoding changes them.
When it bites in a comparison
Comparing a phone original against an exported copy is a common case for this: one file is stored sideways with a flag, the other upright with none. A tool that ignores the flag compares a sideways picture with an upright one and reports them as completely different. If a comparison says two clips have almost nothing in common and you know they are the same footage, check both for a rotation flag first — or bake the rotation in on both before comparing them in DiffALL’s video comparison.
No original to compare against? DiffALL measures one file on its own and names what is wrong with it.
Check a file — free