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

FPS Question #1699

Open
danielhergil opened this issue Jan 10, 2025 · 2 comments
Open

FPS Question #1699

danielhergil opened this issue Jan 10, 2025 · 2 comments

Comments

@danielhergil
Copy link

Hi there! I am developing a sports streaming app with the purpose to achieve a very good video quality. Every works very nice but I got stuck on the 60fps feature with Camera 2 API. I know that lot of devices have this API locked with their own brand API, but I do not know if it is any way to achieve this 60fps live video or any workaround you have found.

Also, I have configured the stream to be able to use Camera UVC, that as far as I know, it is using directly hardware usb features and it is bypassing the Camera 2 API. I have tried to record the stream with the USB Camera in 60 fps, but the video result it was 30 fps as well. What I do in my app is starting the preview with the Camera2 and then the user can switch to the USB Camera. By default the prepareVideo method is set with 60 fps. Is it any way that I can use the USB Camera with 60 fps?

Thank you :)

@pedroSG94
Copy link
Owner

Hello,

With Camera2 API if you set fps to 60 in prepareVideo method and the camera still works to 30 fps that means that the camera can't support 60fps using Camera2 API. Maybe you can find any special official library to support it for a device brand but I think that in most of cases it is locked and you can't do anything about it. Also, remember that maybe 60fps is only supported for a certain resolution. For example in my Pixel device you can get 60fps with 1280x720 but it is not available with 640x480. I recommend you test using 1280x720 and 1920x1080 that in most of cases support 60fps if it is available for your device.

About USB camera. The library open the camera with the default values but maybe you can modify the class used to set the values required.
I'm using this library:
https://github.com/shiyinghan/UVCAndroid
And this is the class used to open the camera:
https://github.com/pedroSG94/RootEncoder/blob/master/extra-sources/src/main/java/com/pedro/extrasources/CameraUvcSource.kt

You can copy paste that class and modify it as you want to adapt the code to your needs

@danielhergil
Copy link
Author

Thank you for your fast reply Pedro.

About the Camera2 API I understand the limitations. Now I am trying if I can improve the fps by doing motion interpolation with the last release of OpenCV SDK. If I can get something interesting without a big hardware impact I will let you know.

For the USB camera, sure, I will try to modify the default parameters because I think that will provide the 60 fps that I want.

Thank you again for all the work!!

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