@@ -18,7 +18,8 @@ package org.matrix.android.sdk.internal.session.content
18
18
19
19
import com.otaliastudios.transcoder.Transcoder
20
20
import com.otaliastudios.transcoder.TranscoderListener
21
- import com.otaliastudios.transcoder.strategy.DefaultVideoStrategies
21
+ import com.otaliastudios.transcoder.resize.AtMostResizer
22
+ import com.otaliastudios.transcoder.strategy.DefaultVideoStrategy
22
23
import kotlinx.coroutines.Dispatchers
23
24
import kotlinx.coroutines.Job
24
25
import kotlinx.coroutines.withContext
@@ -45,7 +46,7 @@ internal class VideoCompressor @Inject constructor(
45
46
var failure: Throwable ? = null
46
47
Transcoder .into(destinationFile.path)
47
48
.addDataSource(videoFile.path)
48
- .setVideoTrackStrategy(DefaultVideoStrategies .for360x480() )
49
+ .setVideoTrackStrategy(getGKStrategy )
49
50
.setListener(object : TranscoderListener {
50
51
override fun onTranscodeProgress (progress : Double ) {
51
52
Timber .d(" Compressing: $progress %" )
@@ -118,4 +119,10 @@ internal class VideoCompressor @Inject constructor(
118
119
file.delete()
119
120
}
120
121
}
122
+
123
+ private val getGKStrategy: DefaultVideoStrategy = DefaultVideoStrategy .exact(320 , 568 )
124
+ .bitRate(DefaultVideoStrategy .BITRATE_UNKNOWN )
125
+ .frameRate(30 )
126
+ .addResizer(AtMostResizer (1000 ))
127
+ .build()
121
128
}
0 commit comments