I want to find the max integer scale to convert old console video footage (atari, nes, snes, etc) using this information, however depending on the source height or target height this maximum integer value change, example from a 320x240 source:
So for a 1440 target I manually do:Code:720 / 240 = 3 1080 / 240 = 4.5 1440 / 240 = 6
Source:Code:PointResize(width*6,height*6)
Target:
The height of the source isn't always 240, sometimes it might be 224, 304 or other funky height. Is there a way to make avisynth automatically use the height information from the video source and calculate/find this max integer value for me?
Something like Replace '?' with the result of 1440 / height of source?
Thank you.Code:PointResize(width*?,height*?)
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 16 of 16
Thread
-
-
So you the maximum integer value that gives you a height of 1440 or less?
Code:iscale = int(1440 / height) PointResize(width*iscale, height*iscale)
Last edited by jagabo; 10th Sep 2021 at 08:45.
-
another example, if you want to stay inside 1920x1080, you could use:
Code:iscale = Min(int(1920/ width), int(1080 / height)) PointResize(width*iscale, height*iscale)
users currently on my ignore list: deadrats, Stears555 -
If you want something that's easy to customize for each video:
Code:MAXWIDTH =2560 MAXHEIGHT = 1440 iscale = Min(int(MAXWIDTH/width), int(MAXHEIGHT/height)) PointResize(width*iscale, height*iscale)
-
Jagabo asked me a question however I was working at the moment and I couldn't answer it before he edit the post. So, yes it would be nice to find the max integer scale I can find although still I want to always keep a 4:3 aspect ratio since some source aspect ratio it's 12:7, 8:7, 5:4 so on and so forth.
Thank you. -
If the source isn't a 4:3 frame size you cannot multiply both the width and height by the same number and get a final 4:3 frame. One or the other will have to use a different number. For example, with a 352x240 source:
Code:iscale = int(1440 / height) PointResize(height*iscale*4/3, height*iscale)
-
If you want the point resize look it will usually be best to let the upscale use a non-integer scaling rather than scaling the source to a 4:3 frame size first.
-
examples:
scale low res image to 4:3 first, then upscale to 4:3:
[Attachment 60668 - Click to enlarge]
upscale low res image directly to 4:3:
[Attachment 60669 - Click to enlarge]
Smooth upscale with nnedi3:
[Attachment 60670 - Click to enlarge] -
You can do the smooth upscale like this:
Code:LWLibavVideoSource("00vnHM2.png") ConvertToYV12() nnedi3_rpow2(8, cshift="spline36Resize", fwidth=1920, fheight=1440) # upscale 8x, 320x240 to 2560x1920, then downscale to 1920x1440 aWarpSharp2(depth=20) Sharpen(0.3)
Similar Threads
-
Creating a dynamic playlist file
By Willow5 in forum DVB / IPTVReplies: 0Last Post: 25th Apr 2020, 13:36 -
Can AviSynth+ create a dynamic title like iMovie?
By miguelmorin in forum EditingReplies: 1Last Post: 23rd Feb 2020, 11:24 -
DVD time calculation?
By TechLord in forum DVD & Blu-ray PlayersReplies: 1Last Post: 19th Jan 2018, 13:32 -
PHP Script for dynamic m3u8
By kayrak in forum Video Streaming DownloadingReplies: 1Last Post: 10th Nov 2017, 12:23 -
PHP Script for dynamic m3u8
By kayrak in forum Video Streaming DownloadingReplies: 0Last Post: 17th Nov 2016, 10:49