VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Member Belini's Avatar
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    Is there any formula for calculating custom aspect ratio to eliminate black stripe from video when desktop resolution is not proportional to video resolution?

    Example for not having black stripes on top and bottom of a 1280 x 720 video open on a 640 x 480 screen I can use 16:12 aspect ratio but this I did tests manually and wanted to have a formula that could apply to videos of different resolutions with Same desktop resolution, can anyone give a hint?
    Last edited by Belini; 4th Dec 2019 at 09:17.
    Quote Quote  
  2. Are you looking to squeeze (distort) the picture to fit the screen or crop the picture to fit the screen?
    Quote Quote  
  3. Member Belini's Avatar
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    Both cases may happen because the screen resolution will always be the same but the video resolution may be higher or lower then I need to create a formula to calculate the correct aspect ratio to fill the screen.

    Example if screen is 1280 x 720 and video is also 1280 x 720 aspect ratio 16:9 fills the entire screen

    If the screen is 640x480 and the video is 1280x720 the aspect ratio to fill the entire screen will have to be 16:12

    https://youtu.be/KVDRVo6E2Oc

    In the example on youtube I opened a 1270 x 720 video on a 640 x 480 screen then applied 16:12 custom aspect ratio to fill the whole screen, apply custom aspect ratio I can but I don't know how to calculate the correct aspect ratio for every situation.
    Last edited by Belini; 4th Dec 2019 at 09:58.
    Quote Quote  
  4. Try this old small standalone program.Works perfectly.

    https://www.videohelp.com/software/Aspect-2
    Quote Quote  
  5. Code:
    DAR = FAR * SAR
    
    DAR = Display Aspect Ratio, the final shape of the picture
    FAR = Frame Aspect Ratio, the width:height of the video
    SAR = Sample Aspect Ratio, the width:height of each pixel (really the spacing between them)
    Quote Quote  
  6. Member Belini's Avatar
    Join Date
    Aug 2011
    Location
    Brazil
    Search Comp PM
    I ended up making a list of known resolutions and comparing with Desktop to apply the right aspect ratio, but I will test these tips too, thanks everyone.

    Code:
    $aspect = @DesktopWidth & "x" & @DesktopHeight
    Switch $aspect
    	Case "640x480", "800x600", "960x720", "1024x768", "1280x960", "1400x1050", "1440x1080", "1600x1200", "1856x1392", "1920x1440", "2048x1536", "2800x2100", "3200x2400"
    		$aspect = "4:3"
    	Case "1125x900", "1280x1024", "2560x2048"
    		$aspect = "5:4"
    	Case "1280x800", "1440x900", "1680x1050", "1920x1200", "2560x1600"
    		$aspect = "16:10"
    	Case "640x360", "1024x576", "1152x648", "1280x720", "1360x768", "1366x768", "1536x864", "1600x900", "1920x1080", "2048x1152", "2560x1440", "3840x2160", "7680x4320"
    		$aspect = "16:9"
    	Case "1920x810", "2560x1080", "3440x1440"
    		$aspect = "21:9"
    EndSwitch
    Quote Quote  
  7. For square pixel displays you can just use the monitor resolution as the aspect ratio. For example 1920/1080 = 16/9 = 1.7777...
    Quote Quote  



Similar Threads