Video file conversion library based on ExtractDecodeEditEncodeMuxTest.java CTS test
VideoConverter is installed by adding the following dependency to your build.gradle file:
dependencies {
implementation 'com.dstukalov:videoconverter:1.7'
}
MediaConverter converter = new MediaConverter();
converter.setInput(context, uri);
converter.setOutput(outputStream);
converter.setTimeRange(timeFrom, timeTo);
converter.setVideoResolution(360);
converter.setVideoBitrate(2000000);
converter.setAudioBitrate(128000);
converter.setListener(percent -> {
publishProgress(percent);
return isCancelled();
});
converter.convert();