FFmpeg-Android icon indicating copy to clipboard operation
FFmpeg-Android copied to clipboard

How to Get Processing Progress Callback?

Open protectedMan opened this issue 5 years ago • 1 comments

I want to show the percentage of processing progress.

protectedMan avatar Jun 23 '19 06:06 protectedMan

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 milliseconds long You can use both variable to make percent value

Also you can find out StringUtils here jar: Apache Common Lang3 3.9

bahmanworld avatar Jul 16 '19 23:07 bahmanworld