I used this script on vertically shot phone YouTube footage attached which is 480 x 854p to upscale to 1080p:
I forgot it was vertical footage and needs to be upscaled to smaller dimensions and then borders added to keep the correct proportions. So what size should I upscale to and what size of borders should I add?Code:nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1920, fheight=1080)
Is there a calculation program I can use or a calculation I can do to figure out the correct upscale size for things such as this with weird dimensions?
I know I used the wrong script but why did the video fail to encode and give this error?:
What does that mean? The input width is already 480 which multiplied by 4 is 1920. Is it saying the width needs to be 482? Why when that would give 1928 width?nnedi3_rpow2: for YV12, YV411, YUY2 and YV16 input width must be mod 4 (482)!
Also do you have a seperate script to make the picture as wide as possible while keeping everything in proportion - I know some of the top or bottom needs to be cropped to do that which is fine as there's nothing important there that needs to be kept. Don't care what size I end up with as long as it's 720p or bigger.
+ Reply to Thread
Results 1 to 5 of 5
Last edited by VideoFanatic; 27th Oct 2020 at 10:29.
How about you keep the political stuff off these boards, as per the rules, ok?
In one sentence, you say you want to keep the aspect ratio, and then in another you say you don't mind cropping some of the image. These are at odds with each other.
A universal resize formula is just plugging in the universal AR formula into the corresponding (matching) variable.
The universal AR formula is:
( Resolution Width / Resolution Height ) * Pixel AR = Display AR
W1 / H1 * PAR1 = DAR1 = 1.7777777 (aka 9/16), 9/16 being 16/9 rotated into portrait mode
W2 / H2 * PAR2 = DAR2 = 1.7777777 (aka 9/16)
Since the DARs match (DAR1 = DAR2), plug the rest in. Aka
W1 / H1 * PAR1 = W2 / H2 * PAR2
Since you know (or can confidently assume) that for both phones and HDTVs use square pixels, that means PAR1 and PAR2 are both 1.
W1 / H1 = W2 / H2
Plugging in the numbers and solving for x,
480 / 854 = x / 1080
480 * 1080 / 854 = x
Since that's not mod4, round up or down to nearest mod4. In this case, that would be 608. This means that there will be a very minor AR mismatch (1 pixel's worth), but that can happen with modX constraints (especially constraints that don't apply equally to both sides). Not enough to worry about.
So you resize to 608x1080. Then pad sides out to 1920 (simply = 1920 - 608 = 1312. Half that to 656 for each side).
If you do want to crop, you have nothing matching, so it's a free-for-all and it's up to you how much you are comfortable cropping.
Last edited by Cornucopia; 27th Oct 2020 at 00:29. Reason: Typo
I agree, either the content needs to be cropped or it should be resized to 656x1080 (normal resizer is good enough no gain from using nnedi3 here) and then letterboxing to 1920x1080 should be the way to go.
I know I used the wrong script but why did the video fail to encode and give this error?users currently on my ignore list: deadrats, Stears555
Since both are square pixel the aspect ratio of an image is defined as:
aspect_ratio = width / height
old_aspect_ratio = new_aspect_ratio old_width / old_height = new_width / new_height
old_width / old_height = new_width / new_height old_width / old_height * new_height = new_width 480 / 854 * 1080 ~= 607.026
Another way to look at is: you're going to scale the height from 854 to 1080. A factor of 1080/854 = 1.2646... To keep the aspect ratio you want to scale the width by the same amount: 480 * 1.2646 = 607+.
If you want to scale the width to fill a 1920 pixel wide frame you are going to scale by a factor of 1920x480 = 4. So also scale the height by 4: 854 * 4 = 3416. Crop that 1920x3416 to 1920x1080.
Last edited by jagabo; 27th Oct 2020 at 11:37.
I wonder why I end up at 656,... LOL,.. I had another vertical clip in my temp download folder.
-> I agree 608x1920users currently on my ignore list: deadrats, Stears555