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

Facing FPS issues in some android devices #1635

Open
rahulmitra-ncompass opened this issue Nov 7, 2024 · 15 comments
Open

Facing FPS issues in some android devices #1635

rahulmitra-ncompass opened this issue Nov 7, 2024 · 15 comments

Comments

@rahulmitra-ncompass
Copy link

When we are streaming a video in 720p we are setting the FPS to 30 but it is falling very low in some devices, and there is not sync in which it can detected. Some examples:

  1. Redmi 9 (Android 11) -> FPS range 13-19
  2. Samsung Galaxy F13 (Android 14) -> FPS range 15-21
  3. Samsung Galaxy SM-A50 (Android 11) -> FPS range 23-25

Any advice how to fix this ?

@pedroSG94
Copy link
Owner

pedroSG94 commented Nov 7, 2024

Hello,

Are you using filters? This feature could reduce your fps.
Can you tell me video source or stream object used and filters? (Camera1, Camera2, Display, etc)

@rahulmitra-ncompass
Copy link
Author

We are using custom filters but previously it maintained from 25 to 30. (This is a recent issue)

And we are using camera2.
How could we maintain the fps while using filters ?

@pedroSG94
Copy link
Owner

What do you mean with recent issue? Do you have a library version working with better performance?
Can you tell me which version?

@rahulmitra-ncompass
Copy link
Author

rahulmitra-ncompass commented Nov 7, 2024

before when we had the 2.0 series we didn't face any such fps issues, currently we are using 2.5.1
our aim is to maintain the fps for the entirety of the stream. Can you help us achieve that ?

@pedroSG94
Copy link
Owner

pedroSG94 commented Nov 7, 2024

Please, test with version 2.5.0 and version 2.5.4 and let me know the result.

In version 2.5.1 I did a refactor to camera2 and I did a fix to that in version 2.5.2. Maybe the error is related to that

@rahulmitra-ncompass
Copy link
Author

rahulmitra-ncompass commented Nov 11, 2024

Changed the library version to 2.5.0, no changes.
But after changing to 2.5.4 the fps issue is fixed in some devices, i.e., it is still persisting in some devices.
Can you help ?

@pedroSG94
Copy link
Owner

exactly, which version was working fine?
I'm going to compare the code related with the camera2

@rahulmitra-ncompass
Copy link
Author

In 2.1.9 it was working properly

@pedroSG94
Copy link
Owner

Hello,

I did a branch for this case:
#1639
Try this gradle:

  implementation 'com.github.pedroSG94.RootEncoder:library:30658db922'

This gradle use the camera2 code source of version 2.1.9 and should fix the problem. If the problem is not fixed we can assume that the problem is not related with that class and we should find the reason.

@rahulmitra-ncompass
Copy link
Author

Thank you for creating a gradle.
But we would to like let you know that there are some particular devices that are still facing the issue and they are all Samsung mobiles (F13, A50) other than that the issue is fixed in other devices

@pedroSG94
Copy link
Owner

pedroSG94 commented Nov 13, 2024

Hello,

I tested using a samsung A53 and a samsung tab A9+ but I'm not able to reproduce the problem.

Can you tell me filters used? Also, remove filters to make sure that the problem is not related with the filters
Did you try using CameraX as video source? You can compile the app example, open rotation example and change the video source using the top-right menu

@rahulmitra-ncompass
Copy link
Author

We used android view filter in our app and yes we noticed normal fps without using it.
And we even got normal fps after using CameraX as source even after using android view filter

@pedroSG94
Copy link
Owner

Hello,

I did a fix in master. Can you check if it is working fine with camera2 using the last commit of master branch?
Gradle:

  implementation 'com.github.pedroSG94.RootEncoder:library:58ce357411'

@rahulmitra-ncompass
Copy link
Author

No we tried the gradle and the fps issue is still happening again in camera2.

@pedroSG94
Copy link
Owner

pedroSG94 commented Nov 19, 2024

I see, I don't understand because in this version:

Hello,

I did a branch for this case: #1639 Try this gradle:

  implementation 'com.github.pedroSG94.RootEncoder:library:30658db922'

This gradle use the camera2 code source of version 2.1.9 and should fix the problem. If the problem is not fixed we can assume that the problem is not related with that class and we should find the reason.

You are using Camera2ApiManager code of version 2.1.9 that worked for you. So, I think that the problem is not related with Camera2ApiManager in that devices. You mentioned that in the devices that still fail, if you remove the filter, it is working properly, right?
Can you copy the source code of the filter in the version 2.1.9 and try with that filter?
You have the code here:
https://github.com/pedroSG94/RootEncoder/blob/2.1.9/encoder/src/main/java/com/pedro/encoder/input/gl/render/filters/AndroidViewFilterRender.java
Let me know if it is working for you and then we can focus in the filter performance or even revert the changes.

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