[Alexwlchan] seen one thing humorous. He knew that not placing a measurement for a video embedded in an internet web page would trigger his web page to leap round after the video loaded. So he put the precise numbers in. However with some movies, the web page would nonetheless refresh its format. He realized that not all video sizes are equal and never all pixels are sq..
For a wide range of causes, some movies have pixels which can be rectangular, and it’s as much as your software program to take this into consideration. For instance, when he put one of many suspect movies into QuickTime Participant, it confirmed the decision was 1920×1080 (1350×1080). That’s the non-square pixel.
So simply pulling the dimensions out of a video isn’t at all times enough to get an actual thought of the way it seems to be. [Alex] exhibits his outdated Python code that returns the inaccurate quantity and the way he managed to make it proper. The mediainfo library appears promising, however suffers from some rounding points. As a substitute, he calls out to ffprobe, an exterior program that ships with ffmpeg. So even if you happen to don’t use Python, you are able to do the identical trick, or you would go learn the ffprobe supply code.
[Alex] admits that there will not be many movies which have rectangular pixels, however they do present up.
If you happen to like enjoying with ffmpeg and movies, do this in your browser. Suppose rectangular pixels are radical? There was work for variable-shaped pixels.