Is there a way to get the total number of video frames on Android?

匆匆过客 提交于 2020-01-04 19:49:30

问题


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



来源:https://stackoverflow.com/questions/24750824/is-there-a-way-to-get-the-total-number-of-video-frames-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!