-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
SAMSUNG A72 - no 60fps from camera capture #4675
Comments
What is the result of |
The phone has the SAMSUNG Camera application that records at 60 fps. I don't know why the program doesn't display the 60fps option. This is very strange. Can this be fixed? |
It seems your camera cannot capture at 60fps (it declares at most 30fps without high speed mode). You can capture at 120ps in high speed mode for specific sizes though:
Depending on your device, it might work to pass a non-declared value:
Otherwise, you can then limit the encoding frame rate using |
This is impossible, because, as I have already written, in the SAMSUNG Camera application I can normally record video at 60fps. After uploading this video to my computer I have real 60fps. So it's impossible for the phone's camera not to have 60fps. |
What is the result of each of these commands: scrcpy --video-source=camera --camera-size=1920x1080 --camera-fps=60 --print-fps
scrcpy --video-source=camera --camera-size=1920x1080 --camera-high-speed --camera-fps=60 --print-fps
scrcpy --video-source=camera --camera-size=1920x1080 --camera-high-speed --camera-fps=120 --max-fps=60 --print-fps ? |
|
Just to confirm, is the video recorded by your camera app actually at 60fps? (I think it is) What about:
? |
In both cases the FPS is very low. |
Have you tried another encoder? |
In H264 and H265 it is still only 30fps. AV1 is not working, I have a message: ERROR: [FFmpeg] Your platform doesn't support hardware accelerated AV1 decoding. |
Yes, the FFmpeg build for scrcpy for Windows does not include a AV1 decoder: #4744 (comment) But in practice AFAIK no device have a correct AV1 hardware encoder anyway (in term of performance, stability and latency).
OK, I'm sorry, the API reports that the camera does not support 60 fps, I don't know how your samsung camera app captures it. |
I also don't know how it happens that the original camera application records at 60fps. I set 60fps in Open Camera but it records at 30fps. |
@rom1v Moving over here: Tried Manual Camera Pro. 1080 and settings 60 FPS in the settings results in "Serious Camera Error", so yeah seems like 3rd party applications don't have access. As for scrcpy 120 1080 black screen streaming
Regular 60
|
Yes, it is exactly this. With Camera2Test we can see the difference. Using a modified Camera2Test app with com.samsung.android.scan3d package name on my S23Ultra, I can see that Samsung exposes more Camera IDs, such as ID 5, 6, 7, 20, 21, 23, 52, 54, 56 and 58, none of them are accessible from non-samsung apps, they can only see ID 0, 1, 2 and 3. I don't know anything about programming or anything like that, so I may be wrong, but since scrcpy uses ADB to connect to devices, I don't think it's possible to spoof the access to the camera as if it was from a Samsung app, but most probably it can't. Maybe it's possible from a rooted device if the person knows where to edit the list of allowed apps. |
You can try to change the value here:
|
From my understanding, for this to work I have to install the Android Shell apk with a modified package name, right? So I googled for an alternative shell for Android, and I found this one https://smartpack.github.io/ashell Now my question is, is it possible to run scrcpy through aShell (even if I need to start the scrcpy server directly from my phone) and communicate with the client on Windows? I don't know if I'm going too far, but this could be beneficial to all Samsung phone users that uses scrcpy Also, and most probably, I'm all wrong because I don't understand much about these things, english is not my main language, and I'm basically googling everything so far lol |
You don't need to install it, "just" rebuild scrcpy with that change and run it. https://github.com/Genymobile/scrcpy/blob/master/doc/build.md |
I did this, I got some warnings during the process (the main exe and server were created anyway). |
Yeah sadly I confirmed the build worked but doesn't present any new modes
|
Even worse with the changed package name it never gets a camera stream even on the supported modes. EDIT: So the faked package name CAN get a video stream on Android 13. Breaks on Android 14. Even with the faked package name on Android 13, no extra modes are presented and manually trying 60 FPS results in the Camera Capture Failed. |
Decompiling Decompiling Samsung Camera app shows Samsung uses some hidden APIs to set extra options. Through a quick Google I found https://gist.github.com/tdrkDev/c2e4f66481b5d5fb12f1245ded4fc49b already assembled many useful information about it. Especially in these lines it suggests Samsung has another package name allowlist (must be in C++). The conclusion is we have found the code path to enable 60FPS on Samsung devices, but still requires more reverse engineering and testing. |
Environment
Describe the bug
A clear and concise description of what the bug is.
On errors, please provide the output of the console (and
adb logcat
if relevant).Please do not post screenshots of your terminal, just post the content as text instead.
I have a problem with capturing video from the camera of the SAMSUNG A72 phone. It constantly limits fps to 30. The camera can work at 60fps but I cannot force the program to capture at 60fps from the camera. I tried adding the command --camera-fps=60 but --print-fps still shows that it is 30fps and the video is not smooth.
The text was updated successfully, but these errors were encountered: