android-mediacodec

Handle MediaCodec video with dropped frames

让人想犯罪 __ 提交于 2019-11-29 09:14:34
I'm currently doing fast precise seeking using MediaCodec . What I currently do to skip frame by frame is, I first get the total frames: mediaInfo.totalFrames = videoTrack.getSamples().size(); Then I get the length of the video file: mediaInfo.durationUs = videoTrack.getDuration() * 1000 *1000 / timeScale; //then calling: public long getDuration() { if (mMediaInfo != null) { return (int) mMediaInfo.durationUs / 1000; // to millisecond } return -1; } Now, when I want to get the next frame I call the following: mNextFrame.setOnClickListener(new View.OnClickListener() { @Override public void

Using MediaCodec asynchronously to decode and render a Video File

拜拜、爱过 提交于 2019-11-28 13:01:36
问题 Recently started toying around with the Android Media Codec class to render the video frames from a Native C++ application. Was able to successfully decode and render both audio and video streams using Android MediaCodec class using synchronous approach[queueInputBuffer and deququeInputBuffer]. Android has a good reference example of how to do it in Native C++ Application. Ex : SimplePlayer.cpp Now i have started with the implementation of asynchronous approach using callbacks and feed the

Handle MediaCodec video with dropped frames

蓝咒 提交于 2019-11-28 02:39:03
问题 I'm currently doing fast precise seeking using MediaCodec . What I currently do to skip frame by frame is, I first get the total frames: mediaInfo.totalFrames = videoTrack.getSamples().size(); Then I get the length of the video file: mediaInfo.durationUs = videoTrack.getDuration() * 1000 *1000 / timeScale; //then calling: public long getDuration() { if (mMediaInfo != null) { return (int) mMediaInfo.durationUs / 1000; // to millisecond } return -1; } Now, when I want to get the next frame I