Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping of frames on MP4 video #93

Open
sorsorak opened this issue Mar 3, 2018 · 3 comments
Open

Skipping of frames on MP4 video #93

sorsorak opened this issue Mar 3, 2018 · 3 comments

Comments

@sorsorak
Copy link

sorsorak commented Mar 3, 2018

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.

@protyposis
Copy link
Owner

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.

@sorsorak
Copy link
Author

sorsorak commented Mar 3, 2018

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.

@protyposis
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants