VideoConverter
Video file conversion library based on ExtractDecodeEditEncodeMuxTest.java CTS test
Installation
VideoConverter is installed by adding the following dependency to your app/build.gradle
file:
dependencies {
implementation 'com.dstukalov:videoconverter:1.10'
}
You may also need to add the following to your project/build.gradle
file:
repositories {
...
mavenCentral()
}
Usage
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();
Demo