Hasty Briefsbeta

Bilingual

When square pixels aren't square

4 months ago
  • #aspect-ratio
  • #video
  • #web-development
  • Videos on web pages can have their aspect ratio specified to prevent layout shifts when loading.
  • QuickTime Player shows two resolutions: storage aspect ratio (SAR) and display aspect ratio (DAR).
  • Pixel aspect ratio (PAR) affects how pixels are displayed, sometimes making square pixels appear rectangular.
  • Non-square pixels are common in vertical videos like YouTube Shorts.
  • The formula DAR = SAR × PAR links storage, pixel, and display aspect ratios.
  • The Mars EDL 2020 Remastered video example shows how PAR affects the displayed image.
  • A Python function using ffprobe can accurately calculate the display aspect ratio by considering PAR.
  • Using the display aspect ratio ensures correct space allocation for videos on web pages.