MediaPlayer-Extended
MediaPlayer-Extended copied to clipboard
Skipping of frames on MP4 video
Hi, I have this issue where the video skips some frames around 1 second. Is there any way I could force the MediaPlayer to display them. The video displays properly on the original MediaPlayer. I have used the default seekmode (Exact) and Precise. That did not help.
I love the accuracy of seek on audio files. If it is not much to ask, can you tell me how it is done, in general, and is there any C++ code involved?
Regards and thanks.
Hi, is 1 second of your video getting skipped or a few frames around the 1 second mark? And how do you think is this related to seeking?
The library just uses Android's MediaExtractor
and MediaCodec
components, so there's no magic involved. All Java code.
Thanks for the information, protyposis. As for the skipping, I think one second is actually being skipped because the audio is skipping one second too.
I was desperate enough to try the seek modes cause I thought there was some seeking involved in playing the video files (without actually seeking). I have no idea how things work within MediaPlayerExtended.
Lastly, the seeking done for audio is pretty awesome. Though, sometimes the mp3 file takes half a second (to a second) to play even though I have used the onseekcompleted listener (1 out of 5-6 times). I even tried skipping the onseekcompleted listener and adding a wait timer of one second. It is the same.
I am trying to develop an app that plays something at the same time that a media file is played that is why time is of an issue to me.
So this one second that is skipped is actually at the beginning of the video? There is actually a seek done at the start of playback (to time 0
) so this might be related to your issue.
Can you post the logcat output of loading the media and starting playback, or even better provide a sample file?