mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Use variable bitrate mode when transcoding to ensure compatibility with old devices (#5223)
* Use variable bitrate mode when transcoding This should be compatible with more devices that may lack the needed codecs to properly encode using constant bitrate mode (CBR). * Fix video output size (again)
This commit is contained in:
committed by
GitHub
parent
2535b08004
commit
fa755e5b75
+5
-1
@@ -27,7 +27,11 @@ class VideoCompressorHelper(
|
||||
fun getOutputSize(inputSize: Size): Size {
|
||||
val resultMajor = min(inputSize.major(), maxSize)
|
||||
val aspectRatio = inputSize.major().toFloat() / inputSize.minor().toFloat()
|
||||
return Size(resultMajor, (resultMajor / aspectRatio).roundToInt())
|
||||
return if (inputSize.width >= inputSize.height) {
|
||||
Size(resultMajor, (resultMajor / aspectRatio).roundToInt())
|
||||
} else {
|
||||
Size((resultMajor / aspectRatio).roundToInt(), resultMajor)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user