Closed XinYiWorld closed 4 years ago
Thanks for your help,it solved my problem but the progress step is a little large。 I found a resolution to share with you :
-v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 src.mp4
if(message.contains("frame=") && message.contains("fps=") ){ int indexOfFps = message.indexOf("fps="); int curFrame = Integer.parseInt(message.substring(7, indexOfFps).trim()); progressDialog.setProgress((int) (curFrame*100f/ totalFrame[0])); }
this is a stupid method,it have to execute 2 ffmpeg commands。
You can get the percentage like this: