Is there a way to get the total number of video fr

2019-07-19 15:07发布

问题:

I am currently extracting, decoding, editing and re-encoding a video on Android using MediaCodec and MediaExtractor on Android. In the course of this process I would like to give users some information on the progress. I am already counting how many frames were extracted, decoded and encoded. In order to compute a percentage and to show users how far the process is, I would need the total number of frames in the original stream. However, I am unable to find a method in the MediaExtractor.

Does anybody know how I can get the total number of frames in a video before I start extracting?

回答1:

you can use total video duration and current frame timestamp to show the progress

no API for total frames is available in MediaExtractor