Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Fix sideways and squashed phone uploads: read FFmpeg's display matrix before you scale

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,…

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.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Move your custom video player into Document Picture-in-Picture (controls included)

TL;DR video.requestPictureInPicture() only takes the <video> , so your custom controls vanish. documentPictureInPicture.requestWindow() opens an always-on-top window you fill with your own DOM.

  • Custom video players can now use Document Picture-in-Picture (PiP) with active controls.
  • openDocPip function creates new document window for PiP view using requestWindow() method.
  • Event listeners ensure smooth transition of player between PiP and main document modes.

TOTP in Node with no packages: four steps, each checked against RFC 6238

When an authenticator code is rejected, the fault sits in one of four steps: decoding the secret, turning the clock into a counter, the HMAC, or the truncation to six digits.

  • Four steps in TOTP generation examined: Base32 secret decoding and clock conversion
  • ASCII secret "12345678901234567890" provided as GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ
  • Unix time divided by period (30 seconds) to generate counter

More from Thursday 26 November →