light_compressor icon indicating copy to clipboard operation
light_compressor copied to clipboard

Please add feature to resize videos

Open parmeetmaster opened this issue 2 years ago • 0 comments

Hello sir,

Can you add sample to resize the video.Like your other dependency in android .If that is already exist kindly add inside sample.

return when (quality) { VideoQuality.VERY_LOW -> (bitrate * 0.1).roundToInt() VideoQuality.LOW -> (bitrate * 0.2).roundToInt() VideoQuality.MEDIUM -> (bitrate * 0.3).roundToInt() VideoQuality.HIGH -> (bitrate * 0.4).roundToInt() VideoQuality.VERY_HIGH -> (bitrate * 0.6).roundToInt() }

when { width >= 1920 || height >= 1920 -> { newWidth = (((width * 0.5) / 16).roundToInt() * 16) newHeight = (((height * 0.5) / 16f).roundToInt() * 16) } width >= 1280 || height >= 1280 -> { newWidth = (((width * 0.75) / 16).roundToInt() * 16) newHeight = (((height * 0.75) / 16).roundToInt() * 16) } width >= 960 || height >= 960 -> { newWidth = (((width * 0.95) / 16).roundToInt() * 16) newHeight = (((height * 0.95) / 16).roundToInt() * 16) } else -> { newWidth = (((width * 0.9) / 16).roundToInt() * 16) newHeight = (((height * 0.9) / 16).roundToInt() * 16) } }

parmeetmaster avatar Dec 17 '22 09:12 parmeetmaster