Video Rotation Metadata
Video rotation metadata describes a display transformation without requiring the stored picture samples to be rotated.
A phone can store each video frame in a 1920 × 1080 landscape grid while recording a portrait scene. The file's display transformation tells the player to turn that grid upright. After a pure quarter-turn, its presented dimensions become 1080 × 1920.
Rotation metadata stores the instruction, rather than a second rotated copy of all the pictures.
Turn a small sample grid
Here is a 4-column, 3-row grid. The letters stand for sample positions:
A B C D
E F G H
I J K L
After a clockwise quarter-turn, the picture has 3 columns and 4 rows:
I E A
J F B
K G C
L H D
Every position survives. Rows and columns change roles. In zero-based coordinates the mapping is (x, y) → (H − 1 − y, x), where H is the original height. For a 1920 × 1080 source, its top-left sample moves to output position (1079, 0), and its bottom-left sample moves to (0, 0).
A quarter-turn can be described as a position permutation. Arbitrary angles also require constructing output samples between the original grid positions, so their processing is a different resampling problem.
The matrix is a presentation instruction
QuickTime and related MP4 workflows represent display transformations with a matrix. It can combine a turn with translation, scaling, or mirroring. A media inspector often reduces a simple matrix to an angle for convenience.
An angle's sign depends on the tool's convention: clockwise and counterclockwise descriptions use opposite signs for the same physical turn. The useful question is where the picture's positions are presented, rather than whether two tools print the same signed number.
Display rotation or physically rotated samples
When the Emby app receives the original clip, it can decode the stored landscape grid and apply the display transformation as it presents the frame. The coded video remains in its original orientation.
A conversion can instead rotate the decoded samples before encoding them. It then produces a 1080 × 1920 picture that is already upright, and the output's display information should describe that upright grid.
| Output representation | What the player needs |
|---|---|
| Original sideways sample grid | The original turn instruction |
| Physically rotated upright grid | A normalized orientation that does not apply the old turn again |
Deleting the instruction from the first representation leaves the clip sideways. Keeping the old instruction on the second applies the turn twice. The two outputs need different metadata because their stored pictures differ.
A thumbnail and a playback stream can pass through different transformation stages. When they disagree, compare the source matrix, the decoded or converted picture dimensions, and the output orientation information. These observations locate the boundary where the turn was applied.