{
  "id": 21948678,
  "title": "Fix sideways and squashed phone uploads: read FFmpeg's display matrix before you scale",
  "url": "https://urgent.news/2026/11/26/fix-sideways-and-squashed-phone-uploads-read-ffmpegs-display-matrix",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-26T08:43:17.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/masonwritescode/fix-sideways-and-squashed-phone-uploads-read-ffmpegs-display-matrix-before-you-scale-5bgd"
  },
  "original_language": "en",
  "account": "When recording a video with a smartphone held upright, it often stores landscape frames with a display matrix indicating a rotation. The most common issues arise when these videos are uploaded and processed through pipelines. This can result in the video playing sideways, being squashed into a widescreen box, or having incorrect thumbnails or container shapes. The original file plays fine in all situations, but something in the pipeline drops or misreads the rotation information.",
  "summary": "TL;DR Portrait phone videos usually store landscape frames plus a display matrix that says \"rotate on playback\". We'll reproduce the three ways pipelines break it (wrong orientation from ffprobe , a landscape ladder that squashes portrait video, and TS stream copies that drop the matrix), then fix each one with a small Python helper and two FFmpeg rules. Tested on FFmpeg 6.1.1, hls.js 1.7.4,…",
  "key_points": [
    "Smartphone videos store display matrix indicating rotation",
    "Pipelines often misread or drop rotation information",
    "Fix by consulting FFmpeg's display matrix before scaling"
  ],
  "editors_take": "Ignoring rotation metadata during video processing breaks the visual integrity of smartphone content, turning simple uploads into a technical hurdle for pipelines that fail to respect display matrices.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}