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 09: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:
Code:( Resolution Width / Resolution Height ) * Pixel AR = Display AR
So
W1 / H1 * PAR1 = DAR1 = 1.7777777 (aka 9/16), 9/16 being 16/9 rotated into portrait mode
and
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.
That means:
W1 / H1 = W2 / H2
Plugging in the numbers and solving for x,
480 / 854 = x / 1080
Or
480 * 1080 / 854 = x
Or ~607
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).
Done.
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.
ScottLast edited by Cornucopia; 26th Oct 2020 at 23: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, marcorocchini -
Since both are square pixel the aspect ratio of an image is defined as:
Code:aspect_ratio = width / height
Code:old_aspect_ratio = new_aspect_ratio old_width / old_height = new_width / new_height
Code: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 10: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, marcorocchini
Similar Threads
-
Any way to reencode a DVD to 1080p using my MadVR upscale settings.
By Hoover1979 in forum Video ConversionReplies: 2Last Post: 11th Mar 2020, 23:52 -
How to upscale 1080p to 1440p with best results
By DunnoNo in forum Video ConversionReplies: 22Last Post: 19th Jan 2019, 08:42 -
need to downscale a 1080p video then upscale to 720p with fillers
By zanzar in forum Newbie / General discussionsReplies: 6Last Post: 17th Mar 2016, 17:57 -
Vertical Phone Video Rotator?
By ahhaa in forum ComputerReplies: 8Last Post: 28th Jan 2016, 09:05 -
Better Codec for for Mobile Phone
By sanveer in forum Newbie / General discussionsReplies: 4Last Post: 3rd Nov 2015, 22:11