I saw Mayday’s thread intended as a beginner guide to scaling, and I want to discuss how to properly handle anamorphic video (with SAR other than 1:1, so non-square-pixel). Decided not to add to the existing thread as it’s an instructional thread and shouldn’t contain this kind of discussion.
When anamorphic video is played back or otherwise processed, it has to be scaled to the target DAR. The prime example is DVD, where a U.S. encoding consists of 720x480 that is usually presented with a DAR of 4:3 or 16:9. The raw video is 3:2, and any processing has to add or remove rows/columns of pixels to achieve the desired DAR.
It is my opinion (that I want to validate or have disproved) that feeding anamorphic video into TVAI with the DAR flag intact is a bad idea, because if you look at the ffmpeg command lines it generates, input video gets scaled to achieve a square-pixel SAR, which means that in many cases pixels are lost. For example, a 4:3 DVD goes into TVAI as 720x480 but gets squashed down to 640x480 during processing. The same 720x480 becomes 720x405 for 16:9 video. So, either 80 vertical lines or 75 horizonal lines of pixels get discarded before enhance/upscale begins.
Similarly, manual pre-processing to scale the video to make it square-pixel will either lose information in the same manner described above, or it will add rows/columns of pixels via traditional interpolated scaling methods like Lanczos, Bicubic, etc. Losing information is bad, and pre-upscaling via interpolation is less bad, but still bad when trying to get the most out of an upscale process.
So, my thesis is that anamorphic video should be turned into square-pixel by throwing away the DAR flag but should not be pre-scaled prior to TVAI processing. I would feed 720x480 into TVAI with nothing other than cropping (if there are any ugly black/green borders as can be found in many old TV show DVD sets) and removal of the DAR flag to make it seem 1:1. The output from TVAI would be 3:2 like the original. I would scale it to achieve the desired DAR only at this point, after enhancement (during my final encode, and while muxing the audio tracks back in, etc.).
Hi, I have also been racking my brains about that. It seems there is no other way; you lower resolution or you stretch and additional “lines” gets generated. I think stretch is better, normally, because reconstruction models works over it and complete these “lines”, but I am not 100% sure we can discuss.
It seems that SLm likes more lower resolution, but this is not really the reason; SLm quality pends on set upscale factor, and when your source is larger, then you can just do for example 2x instead 3x to reach same wanted target resolution…and SLm 3x is a bit better than doing 2x.
What you can do is 3x SLm anyway and overshoot desired target resolution to profit from higher SLm upscale factor, but then SLm gets slower and you have to downscale afterwards the output and downscale is an additional time consuming step.
I try to avoid generate 720x405, this is always bad, because it’s not 16:9 and gives floating points when upscale. What I do here is scale 16:9 anamorph 480p content to 864 x 486 and then crop the output result a little bit. I’m doing SLm 3x with my 864 x 486 content, and get 1458 pixels in high out and crop it down to 1440p. Quite complicated, maybe someone has a better solution
I agree that scaling is unavoidable, but my point is that scaling (in my opinion) should happen on the enhanced video, not on the input video. So, enhance/upscale first (leaving it anamorphic), then squish it down to achieve the right aspect ratio. If you scale up first, you’re adding pixels that are just copies of other pixels (ok, it’s a little more complex than that with most algorithms, but not much better), when Topaz could have done a lot better job of adding those pixels. Let Topaz add pixels, disregarding aspect ratio and making sure it treats the input as 1:1 SAR, then take away pixels from the result.
I think you’re right in this case of NTSC 720x480 4:3 anamorph, squish down the output is better. 720x480 → upscale 3x = 2160 x 1440 → squish to 1920 x 1440 (4:3)
In all other cases where you have to stretch, it’s better doing with source, because output-stretching is not TVAI enhanced and lowers quality.
I created my script to convert to 1:1 SAR before or after TVAI depending on the input resolution. So if it’s closer to 16:9 I do it before to give TVAI more to work with, and if it’s 4:3 I do it after.
Stretching should never be necessary. Any situation calling for a stretch can always be dealt with by upscaling first (TVAI), then downscaling (traditional resize). This is the only way to not to duplicate pixels via simple interpolation ahead of TVAI’s better methods.
What exactly did you mean stretching is never necessary and TVAI is better method? TVAI “square pixel” does not work properly and by using SLm anyway I have it grayed out. I don’t upscale anamorph 16:9 PAL DVD 720x576 (SAR) pixels native into TVAI and then I must stretch anamorph output result from 5:4 to 16:9, this is exactly what I want to avoid. Also set a DAR on the upscaled video “stretch to 16:9 when play” is not good.
What I mean is that the video going into TVAI should have its anamorphic (DAR) flag removed but not modified otherwise. So, in your example of 720x576 anamorphic with 16:9 DAR, the flag should be removed, the video should be fed to TVAI as 720x576, TVAI should upscale it so both height and width is >= the desired final value, and then any necessary downsizing should be done as a post-processing step. So, if I wanted 1920x1080 as the final 16:9 square-pixel resolution, I’d let TVAI upscale 720x576 → 2160x1728 (3.0x), then I would downscale 2160x1728 → 1920x1080. The downscaling would create the aspect ratio, and it would throw away some of the upscaled resolution created by TVAI, but this process avoids creating “false” pixel data in the preprocessing stage and gives TVAI the “purest” version of the original video to work with.
So my argument boils down to: TVAI should not be allowed to see the DAR flag of a non-square-pixel video, because it will apply its own pre-scaling if it does, but I don’t believe the right way to fix that is to pre-pad the video with fake pixels. Instead, remove the DAR flag, let TVAI treat the video as if it is already square-pixel, and fix the aspect ratio at the end via downscaling of the height and/or width.
We mean the same thing: output downscaling is okay, stretching not. That’s the point for everything. I just didn’t know you wanted to go to 1080p, because I do 3x to 1440p, and downscaling isn’t possible there. So yes good workflow if the goal is 1080p