Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tdarr misidentifies non 16:9 resolutions in flows. also identifies based on height and reencodes based on width. which causes infinite loops of reencodes #711

Open
taltamir opened this issue Oct 31, 2024 · 0 comments

Comments

@taltamir
Copy link

taltamir commented Oct 31, 2024

related to HaveAGitGat/Tdarr#1110
where tdarr misidentifies non 16:9 resolutions in the GUI.

in addition to the GUI, tdarr also misidentifies resolutions in flows.
additionally, there is a mismatch between CheckVideoResolution and Set Video Resolution
one uses horizontal res and the other vertical res. which causes infinite loops when trying to downscale some aspect ratios


if you try to automatically downscale files to a lower resolution, if they are not 16:9 aspect ratio it can cause an infinite loop of reencoding the same file. Most dramatically when they are vertical resolution such as 9:16 aspect ratio. But even horizontal aspect ratios can do it on occasion (as cinema resolutions are sometimes weird)

take a sample 9:16 1080p file that is 1080x1920 resolution.
CheckVideoResolution
https://docs.tdarr.io/docs/plugins/flow-plugins/index/video/Check%20Video%20Resolution
reports the 1080x1920 file it as 4KUHD file. but then

Set Video Resolution (for ffmpeg)
https://docs.tdarr.io/docs/plugins/flow-plugins/index/ffmpegCommand/Set%20Video%20Resolution
sets the encode resolution to "scale=1920:-2" instead of "scale=-2:1080"

It thinks it is downscaling a 3840x2160 file down to 1920x1080
but what it actually does is upscaling a 1080x1920 file up to 1920:3414 resolution.

It then identifies in the gui and in flows the resulting 1920:3414 file as a 8K file... every time it requeues it will "downscale" it to the same size as before.
simply wasting resources and adding 1 generational distortion to the file every time it is processed.

For non vertical resolutions it is not as dramatic. but still problematic. Cinema resolutions include: 1.33:1, 2:1, 2.66:1, 2.55:1, and 2.35:1.
some of which can get misidentified as larger than they are and trigger said infinite loop of slight upscaling followed by repeated recompress in same res.

It is worth nothing that there is an other output in CheckVideoResolution. it just does not seem to ever get used. exotic sizes just get rounded instead of showing up as other

@taltamir taltamir changed the title tdarr misidentifies non 16:9 resolutions. also identifies based on height and reencodes based on width. which causes infinite loops of reencodes tdarr misidentifies non 16:9 resolutions in flows. also identifies based on height and reencodes based on width. which causes infinite loops of reencodes Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant