HaveAGitGat / Tdarr

Tdarr - Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker)
Other
3.05k stars 96 forks source link

Tdarr misidentifies non 16:9 aspect ratio resolutions in GUI. such as vertical filmed videos in 9:16 aspect ratio. or unusual cinema aspect ratios #1110

Open taltamir opened 3 weeks ago

taltamir commented 3 weeks ago

1080p resolution is 1920x1080, which is a 16:9 ratio. which is one of the family of 2k resolutions, specifically "FullHD" https://en.wikipedia.org/wiki/2K_resolution

If you use your phone to film vertically (such as by preparing it for upload to youtube as a "youtube shorts") then the vertical and horizontal are inverted. and it is 1080x1920. a 9:16 aspect ratio.

tdarr will misidentify this 9:16 video as a 4KUHD. which is specifically the 16:9 aspect ratio of 4K which is actually 3840x2160 pixels.

This is because it is only looking at the vertical figure. And seeing a vertical of 1920 it rounds it up to the nearest option, which is 4KUHD.

4KUHD


Proposed Solution:

  1. have a simple if (x > y) function that compares the width and height to set a bool indicating a video is vertical or horizontal. if it is vertical, for the purpose of assigning resolution invert the horizontal and vertical. That is, 1920x1080 is vertical 1080p

  2. calculate and display the aspect ratio.

  3. take aspect ratio into account when when determining the size class instead of assuming 16:9

For example, HalfHD at 16:9 res is 1280x720 a 1.33 aspect ratio video encoded at scale:1280:-1 will be 1280x962 this should not be mistaken for a 1080p just because the x962 is closer to x1080 than it is to x720

ideally identify cinema resolutions. but if not, just report the exact resolution in both vertical and horizontal.


There are related bugs involving the flows. But they should go in the plugins. I will make the appropriate issues there and link them shortly.

Here is the test file in 1080x1920 which I used to to get the picture above of the GUI reporting it as 4KUHD vertical-res-test.zip