Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Please add feature to resize videos #34

Open
parmeetmaster opened this issue Dec 17, 2022 · 0 comments
Open

Please add feature to resize videos #34

parmeetmaster opened this issue Dec 17, 2022 · 0 comments

Comments

@parmeetmaster
Copy link

parmeetmaster commented Dec 17, 2022

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)
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant