Fixing sideways and squashed phone video uploads by reading FFmpeg's display matrix
Portrait phone videos often store landscape-oriented frames alongside a display matrix that instructs players to rotate them on playback. Pipelines that ignore this matrix can produce sideways video, portrait content squashed into landscape frames, or lost rotation after stream copies into MPEG-TS. The author reproduces these failures using FFmpeg 6.1.1, hls.js 1.7.4, and Chromium 158, showing that ffprobe reports the rotation in side data rather than in tags. Tests show that FFmpeg autorotates before applying filters, which causes the squashing, while fMP4 preserves the matrix where MPEG-TS does not. The proposed fix is a shared Python helper that applies the rotation before any layout, thumbnail, or ladder decisions.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in