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

About --max-fps option #5914

Open
TEACAET opened this issue Mar 10, 2025 · 2 comments
Open

About --max-fps option #5914

TEACAET opened this issue Mar 10, 2025 · 2 comments

Comments

@TEACAET
Copy link

TEACAET commented Mar 10, 2025

My cmd is "scrcpy.exe --max-fps=120 -K --video-bit-rate=20M -w -m 2800 -d".

When scrcpy outputs INFO: 0 fps after being idle for a while, then use the arrow keys to flip pages, the operation becomes noticeably laggy and "frame drop(?)". The output from scrcpy is as follows:
INFO: 11 fps
INFO: 40 fps
INFO: 39 fps
INFO: 11 fps
INFO: 38 fps
INFO: 9 fps
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 6 fps
INFO: 53 fps (+2 frames skipped)
INFO: 4 fps
INFO: 0 fps
INFO: 6 fps
INFO: 54 fps
INFO: 3 fps
INFO: 56 fps
INFO: 5 fps
INFO: 0 fps
INFO: 0 fps
INFO: 7 fps
INFO: 54 fps

Untile reduced the video bit rate to 2M, seem better. During similar operations, the output information was as follows:
INFO: 0 fps
INFO: 0 fps
INFO: 0 fps
INFO: 30 fps
INFO: 3 fps
INFO: 23 fps
INFO: 13 fps
INFO: 0 fps
INFO: 23 fps
INFO: 10 fps
INFO: 0 fps
INFO: 28 fps
INFO: 7 fps
INFO: 0 fps
INFO: 32 fps
INFO: 4 fps
INFO: 0 fps
INFO: 0 fps
After the initial 0 fps, the first reported fps is significantly higher, reducing the perceived lag. However, the lower bit rate results in a blurrier image, which is not ideal(QAQ).

SO HRER IS MY QUESTION
Is it possible to add an option to capture at a fixed specified FPS (if there are no performance issues), instead of the current dynamic capture? I saw in the documentation that it mentions: "The frame rate is intrinsically variable: a new frame is produced only when the screen content changes. For example, if you play a fullscreen video at 24fps on your device, you should not get more than 24 frames per second in scrcpy." Or is this fundamentally impossible in principle?

@rom1v
Copy link
Collaborator

rom1v commented Mar 10, 2025

Is it over USB or wifi?

Untile reduced the video bit rate to 2M, seem better.

See #5892.

Is it possible to add an option to capture at a fixed specified FPS

It might be possible in theory by writing an OpenGL filter which captures the screen at regular intervals. But that would not improve your issue at all. It is always best to send frames only when the device screen content changes.

@TEACAET
Copy link
Author

TEACAET commented Mar 10, 2025

Is it over USB or wifi?

over USB

See #5892.

It's a bit different. Even when I use a 50M, continuously pressing the left and right keys on the keyboard can maintain a stable 118fps. The stuttering occurs on the first input after being stationary(after INFO:0 fps).

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