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

Video FPS performance comparison Exoplayer vs MediaPlayer #8045

Closed
skreenr opened this issue Oct 6, 2020 · 9 comments
Closed

Video FPS performance comparison Exoplayer vs MediaPlayer #8045

skreenr opened this issue Oct 6, 2020 · 9 comments

Comments

@skreenr
Copy link

skreenr commented Oct 6, 2020

[REQUIRED] Searched documentation and issues

This seem like not exactly a new issue, as I am finding this thread #5003
Not sure how the cases are, hence I am sharing observations and a concern below:

[REQUIRED] Question

I am observing that the video playback FPS appear to be lower compared to what I was getting using MediaPlayer for same video content. MediaPlayer delivered smooth playback at 30fps, Exoplayer playback looks less smooth, maybe a little flickery
My videos are 720x1520 resolution at 30 fps, and my tests were done with this LWP project using Exoplayer: https://github.com/AlynxZhou/alynx-live-wallpaper/blob/master/app/src/main/java/xyz/alynx/livewallpaper/GLWallpaperService.java
I have replacing their video with my own with specs per above

The thread at #5003 seem to focus on how it might be a device manufacturer/chipset-related thing
Let me mention the effect was observed on a fairly recent big screen device from a leading brand

Please advise if in fact Exoplayer has this issue and can't always match MediaPlayer in quality

I recall seeing suggestion to use code to detect dropped frame
Would appreciate actual code sample for that

A full bug report captured from the device

I have emailed the bug report with issue #8045 in Subject line

Link to test content

Content piece has been emailed with issue #8045 in Subject line

@tonihei
Copy link
Collaborator

tonihei commented Oct 9, 2020

I can't see a difference on my device between ExoPlayer and MediaPlayer. I also had a look at the bugreport but couldn't find anything suspicious.

Could you verify whether this problem is related to the mentioned device only or if it happens on other devices too?

Also, can you try to use the ExoPlayer demo app instead of the GLWallpaperService and see if it's still reproducible? It might be related to the way in which they render the output.

@tonihei tonihei self-assigned this Oct 9, 2020
@skreenr
Copy link
Author

skreenr commented Oct 10, 2020

I had an international tester with Xiaomi Redmi tell me Exo version playback is somewhat slow
Asked him to send a bug report
How exactly to check for dropped frames in code?

What matters is how you test the playback: we need to play it fullscreen in a background service
Here is the code I used: https://github.com/AlynxZhou/alynx-live-wallpaper/blob/master/app/src/main/java/xyz/alynx/livewallpaper/GLWallpaperService.java
just replaced the original video

@tonihei
Copy link
Collaborator

tonihei commented Oct 12, 2020

How exactly to check for dropped frames in code?

You can add an AnalyticsListener and listen to onDroppedVideoFrames.

What matters is how you test the playback: we need to play it fullscreen in a background service
Here is the code I used: https://github.com/AlynxZhou/alynx-live-wallpaper/blob/master/app/src/main/java/xyz/alynx/livewallpaper/GLWallpaperService.java
just replaced the original video

This is rendering to some kind of customized GLSurfaceView using ExoPlayer. How do you compare the performance with MediaPlayer? Is it using the exact same surface for rendering?

@skreenr
Copy link
Author

skreenr commented Oct 13, 2020

I have a different codebase using MediaPlayer. It works well except when it doesn't – there been reports of video not showing at all, on some big-screen handsets by China makers, and logs show some issues w NuPlayer and not much to work with. Hence the interest in potentially replacing it w Exoplayer,
Plus being able to Crop big videos for small screens will be major benefit too

I wasn't actually able to convert my MediaPlayer code to Exoplayers, perhaps because I have quite a few things in there (I do cyclical wake-animation playback as explained on wakeanimation.org)
so just I grabbed some project off Github, the Alynx, to see what I can get in terms of quality

Perhaps we can find some other coding testbed to judge?
it needs to run as a background service in fullscreen, just like LWP do

@tonihei
Copy link
Collaborator

tonihei commented Oct 13, 2020

In this case it's hard for us to say whether there is anything wrong with ExoPlayer or if it's down to the different way of integrations in your app. If you can find a way to compare them directly with the same surface etc. and you still see a difference, then please let us know. I'll mark this issue with "need more info" again and the bot will auto-close it in a couple of weeks if you haven't found anything by that time. But feel free to reopen (or file a new issue) once you got something.

@skreenr
Copy link
Author

skreenr commented Oct 16, 2020

OK I build a very basic LWP, two of them: one using MediaPlayer and another Exoplayer, to play a video clip of ~7sec in a loop. Looking at the result it seems to me like Exoplayer's playback is just a bit slower, maybe few FPS. Another observation is that when activating the LWP in Settings, in Preview the video plays with delay a little more pronounced than with MediaPlayer, just fraction of a sec. Not a show stopper, but something I see.
Can send over projects' code and media

@tonihei
Copy link
Collaborator

tonihei commented Oct 19, 2020

OK I build a very basic LWP

What is a LWP?

in Preview the video plays with delay a little more pronounced than with MediaPlayer, just fraction of a sec.

This depends on many things including how you configure both players (e.g. have a look at DefaultLoadControl to set bufferForPlaybackMs).

Looking at the result it seems to me like Exoplayer's playback is just a bit slower, maybe few FPS.

As I mentioned above, this is really hard to debug without having a very concrete way of reproducing. When trying to reproduce, the setup needs to be completely identical between MediaPlayer and ExoPlayer using as little customization as possible (e.g. try removing looping, background service, special surfaces etc.). Otherwise it's unclear whether the issue is related to ExoPlayer and to how you integrate both players into your app.

@google-oss-bot
Copy link
Collaborator

Hey @skreenr. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Collaborator

Since there haven't been any recent updates here, I am going to close this issue.

@skreenr if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@google google locked and limited conversation to collaborators Jan 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants