You recorded a video on your phone, it looked fine in your camera roll, but when you uploaded it to a website, emailed it, or opened it on a different device, the video appeared rotated 90 degrees sideways or completely upside down. This is one of the most common video frustrations, and the explanation involves how phones handle orientation.
Why this happens: rotation metadata vs. actual pixel rotation
When you hold your phone in landscape or portrait mode and hit record, the camera sensor always captures frames in the same physical orientation. It does not rotate the actual pixel data. Instead, the phone writes a rotation flag into the video file's metadata, typically in a field called the "rotation" or "display matrix" tag in the MP4 container.
When you play the video in your phone's Photos app or in a modern media player like VLC, the player reads this rotation flag and rotates the display accordingly. The video looks correct. But when you upload the file to certain platforms, older media players, or web-based video elements that do not read the rotation metadata, the raw unrotated frames are displayed, and your video appears sideways or upside down.
This is not a bug in your phone. It is a compatibility gap between software that respects metadata and software that does not.
Which platforms and players get it wrong
Most modern platforms handle rotation metadata correctly. YouTube, Instagram, TikTok, and Twitter all read the rotation flag and display the video properly. The problems tend to occur with:
- Older versions of Windows Media Player (pre-Windows 10 builds)
- Some web browsers when playing videos via the HTML5 video element without proper CSS handling
- Email clients that embed video previews
- Custom CMS platforms and self-hosted websites
- Video editing software that strips metadata on import (some versions of older editors)
- Linux media players depending on configuration
The permanent fix: re-encoding with physical rotation
The definitive solution is to physically rotate the pixel data so the video frames themselves are oriented correctly, and then remove (or zero out) the rotation metadata flag. After this process, every player on every platform will display the video in the correct orientation because the pixels themselves are in the right position. No metadata interpretation required.
This does require re-encoding the video, which means the file goes through a compression cycle. If you use a reasonable quality setting (CRF 18-23 for H.264), the quality loss from a single re-encode is imperceptible.
How to identify the current rotation
Before fixing a rotated video, you need to know what rotation was applied. You can check this using FFprobe (the inspection tool that comes with FFmpeg). The output will show a "rotation" field with a value like 90, 180, or 270 degrees. Common scenarios:
- Phone held normally (portrait, home button at bottom): rotation = 0 (no rotation needed)
- Phone held landscape, home button on right: rotation = 90
- Phone held landscape, home button on left: rotation = 270
- Phone held upside down: rotation = 180
Metadata strip vs. pixel rotation: which fix to apply
If the video is already correct in some players but wrong in others, the problem is metadata. Stripping the rotation metadata and re-encoding with physical rotation guarantees consistent playback everywhere. The MediaBrew flip and rotate tool does exactly this: it re-encodes with the correct pixel orientation and sets rotation metadata to 0.
If your video also appears mirrored (common with front-facing camera recordings on some Android devices), apply a horizontal flip at the same time. Both operations happen locally via FFmpeg WebAssembly, so the file never leaves your device.