If a video appears sideways, check both its stored image dimensions and any existing rotation metadata. For example, a file might have a resolution of 320 × 180 pixels and additionally specify that it should be rotated during display. Whether a particular playback or processing step respects this instruction must be verified at the actual output stage.
Two ways to get a rotated view
A rotation hint first modifies the display instruction. The encoded image data can remain unchanged in this case. In contrast, applying a picture rotation via a filter reassigns pixel positions and requires a new encoding for the standard compressed output file. FFmpeg distinguishes between these two approaches: display_rotation specifies a display rotation; during transcoding, autorotate can be applied at the filter stage.
FFmpeg: Display rotation and automatic rotation
A dedicated test with an asymmetric image
For this article, we generated a silent H.264 clip on November 13, 2026, using FFmpeg 8.0.1: one second long, 25 frames, 320 × 180 pixels. An orange field was positioned in the top-left corner, and a turquoise field in the bottom-right corner. The uneven markings make the alignment visible; a uniformly colored image would not serve this purpose.
A copied version received a rotation hint of 90 degrees. FFprobe still reported 320 × 180 pixels along with the additional rotation value. When decoding with automatic rotation explicitly disabled, all 25 frames matched the original exactly. Therefore, in this test, the rotation hint preserved the undistorted frame sequence.
The second version was rotated left using the transpose=cclock filter and re-encoded. It then had a resolution of 180 × 320 pixels and no additional rotation metadata. For this small comparison, we used a lossless H.264 setting. This is a test decision and not a general recommendation for producing the smallest possible website files.
FFmpeg: Directions and behavior of the transpose filter
Additionally, we compared the automatically aligned metadata decoding with the newly rotated version: the decoded images matched. This confirms the difference between this synthetic file and the decoder used. However, automatic correction during upload or identical behavior across all browsers and smartphones was not tested.
First, inspect the existing file
With FFprobe installed, you can for example view the video stream of a local file like this:
ffprobe -v error -select_streams v:0 -show_streams -of json eingabe.mp4
Check the width, height, and optionally the rotation values in the additional stream data. Then verify a clearly recognizable image. Simply swapping width and height or changing a display setting does not confirm correct orientation of the content. Existing mirrorings or other transformations require separate evaluation.
Verify the same image point before and after upload
- Select a location with clear orientation, such as readable text or a person whose upright position is clearly visible.
- Compare the original file, the new export, and the actual generated viewer player. Note at which stage the display differs.
- If the image data is already correctly oriented, check whether an additional rotation hint triggers further rotation. Do not modify the original file without justification.
- Keep a clear new export version and also check thumbnail, image crop, and subtitles within the intended playback sequence.