resize - Calculte new width and height of the video based on the original width, height and ratio -


after searching through - wasn't able find answer i'll give shot here.

i need resize desktop video in order feet on mobile screen, let's original width of video 1915 , original height 1075, calculated aspect ratio:

aspectratio = (width/height); aspectratio = 1.78; 

now mobile screen resolution is: height = 1609, width = 1080.

how can resize video in order keep same aspect ratio??

thank you

aspectratio = (width/height)

you want aspectratio 1.78, if want prevent stretching or cropping.

and, max new height 1609 , max new width 1080, so:

1.78 = (1080/height) height = 1080/1.78 = 606.74...

or

1.78 = (width/1609) width = 1.78*1609 = 2864.02...

so, can have 1080x606.74 (which fits on screen), or 2864.02x1609 (which doesn't fit).

so, answer 1080x606.74...


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -