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

Add workaround for Firefox video play performance issue #4210

Merged
merged 1 commit into from
May 3, 2021
Merged

Add workaround for Firefox video play performance issue #4210

merged 1 commit into from
May 3, 2021

Conversation

takahirox
Copy link
Contributor

@takahirox takahirox commented Apr 30, 2021

From #3470 (comment) and the following comments.

Firefox seems to have video play (or decode) performance issue. The FPS number becomes very bad if videos are played in viewport on Firefox.

In Three.js repo, it has been reported that somehow setting RGBA format to video texture improves the performance very well. (I guess it can avoid slow decoding in browser?).

The ticket has been opened for the performance issue in bugzilla but I don't think it can be resolved soon. So I would like to suggest to set RGBA format for Firefox as workaround so far.

11.2MB mp4 video + desktop Windows + NVIDIA GeForce GTX 1080.

RGB RGBA
Firefox 15fps 60fps
Chrome 60fps 60fps

Ideally we should test on more platforms (Mac, Mobile, other graphics boards and so on). I would be happy if you test on your end, too.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Contributor

@netpro2k netpro2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should double check that this doesn't cause any issues in Firefox reality or Firefox for android but otherwise looks good to me. This is an awesomely simple "fix" to a big problem!

Copy link
Contributor

@brianpeiris brianpeiris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My tests on various devices wiith a 4K video (https://brianpeiris.github.io/test-media/big-buck-bunny-4k-short.mp4):

RGB RGBA
FF on Windows 6fps 60fps
FF on Mac 20fps 60fps
FF on Linux 14fps 14fps
FxR on Quest 35fps 35fps

Firefox on Android: Could not test due to existing bug where videos don't render at all :( #4213

We should look at Android later, but the significant benefit on Windows and Mac makes this well worth it. Nice work!!

@dezigns333
Copy link

dezigns333 commented May 1, 2021 via email

@takahirox
Copy link
Contributor Author

Thanks for the test! I would merge this PR.

@takahirox takahirox merged commit 4a217fd into Hubs-Foundation:master May 3, 2021
@takahirox takahirox deleted the VideoTextureFirefoxWorkaround branch May 3, 2021 16:06
@dezigns333
Copy link

dezigns333 commented May 3, 2021 via email

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

Successfully merging this pull request may close these issues.

4 participants