FFmpeg-Android
FFmpeg-Android copied to clipboard
How to Get Processing Progress Callback?
I want to show the percentage of processing progress.
You can use following code
@Override
public void onProgress(String message) {
try {
long current = Functions.timeToMillisecond(StringUtils.substringBetween(message, "time=", ""));
percent = (int)((current * 100) / duration);
progress.setProgress(percent);
} catch (Exception e) {
e.printStackTrace();
}
}
🔽 Note: Get video duration as milliseconds
long
Convert current progress time [from message] to millisecondslong
You can use both variable to make percent value
Also you can find out StringUtils
here jar
:
Apache Common Lang3 3.9