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 the bit-rate and the frame decreases #5892

Open
zzjf opened this issue Mar 3, 2025 · 11 comments
Open

Add the bit-rate and the frame decreases #5892

zzjf opened this issue Mar 3, 2025 · 11 comments

Comments

@zzjf
Copy link

zzjf commented Mar 3, 2025

While we use the Xiaomi15 as the encoder, and the RK3588 decodes; we cast a video, the bit rate is 10 Mbit/s and the frame rate is 60.
When we use the command "scrcpy --video-bit-rate=50M" update the rate 50M, and the fram rate descreased to 30; why it can nont conntinue to 60 ?

@rom1v
Copy link
Collaborator

rom1v commented Mar 3, 2025

What's the output of scrcpy --print-fps in both cases?

Maybe the 50M stream is too heavy to be transmitted and decoded "on time".

@zzjf
Copy link
Author

zzjf commented Mar 3, 2025

when the rate is 10M bit/s, the print-fps is 60; and the rate is 50M bit/s, the print-fps is 30; is the RK3588's decode capability is too weak?

@rom1v
Copy link
Collaborator

rom1v commented Mar 3, 2025

when the rate is 10M bit/s, the print-fps is 60; and the rate is 50M bit/s, the print-fps is 30;

I mean, post the exact output (are there "frame skipped" logged?).

This would allow to know if the frame rate capture is lower or just the rendering.

@zzjf
Copy link
Author

zzjf commented Mar 3, 2025

Thank you, we will do some more tests, and take a screenshot, by the way, can you give your email address, We have some technical questions want to ask in private.

@rom1v
Copy link
Collaborator

rom1v commented Mar 3, 2025

can you give your email address, We have some technical questions want to ask in private.

I don't provide private support. Questions and answers can help future users.

@zzjf
Copy link
Author

zzjf commented Mar 5, 2025

as the frame decreases problem , when the rate is 10Mbps
the print is such as

TNFO: 60 fps
INFO: 57 fps
INFO: 64 fps
INro: 60 fps
TAFO: 60 fps
INFO: 60 fps
IAFO: 61 fps
TAFO: 60 fps
INFO: 58 fps (+2 franes skipped)

when we config -b 50M, the print is such as "

1NF0: 39 fps
INFO: 38 fps
1NF0: 38 fps
INFO: 39 fps
INFO: 3 fps
INFO: 37 fps
1NF0: 38 fps
INFO: 37 fps
1NFO: 37 fps
11FO: 42 fps
1NF0: 4 fps
110FO: 49 fps
1NFO: 50 fps
1NF0: 49 fps
1N0: 40 fps
1NF0: 37 fps
1NF0: 36 fps

why it connot continue the 60 fps while set the rate 50M

@rom1v
Copy link
Collaborator

rom1v commented Mar 5, 2025

OK, so the frame rate is lower on the capture side on the device.

My guess is that increasing the bit rate uses more resources (it may enable more encoding tools which increase complexity), and the hardware encoder of your device is not performant enough to encode a frame 60 times per second.

Check if more encoders are available, but they probably won't be better than the default one: https://github.com/Genymobile/scrcpy/blob/master/doc/video.md#encoder

Btw, didn't you copy-paste the console output? There are typos on every line, how can that be possible? Did you use some tool to analyze an image and convert it to text?

@zzjf
Copy link
Author

zzjf commented Mar 6, 2025

Thank you for you answer;

Yes, I used a translation software to convert pictures into text, because the company's network restricts uploading pictures.

@zzjf
Copy link
Author

zzjf commented Mar 6, 2025

but when we use the same phone( the same encoder capability), we use the different decoder (RK3588 and 4090 computer), we found the bit rate set to 50Mbps, the 4090 computer can continue 60 frame, and the RK3588 sometimes decrease frame; so what's the relation of encoder and decoder while increases the bit rate ?

@zzjf
Copy link
Author

zzjf commented Mar 6, 2025

We doubt whether the encoder and decoder have negotiated. If the decoder is not capable enough, the encoder will use a low frame rate for encoding.

@rom1v
Copy link
Collaborator

rom1v commented Mar 6, 2025

Yes, I used a translation software to convert pictures into text, because the company's network restricts uploading pictures.

Why not just selecting text and copy-paste, then?

but when we use the same phone( the same encoder capability), we use the different decoder (RK3588 and 4090 computer), we found the bit rate set to 50Mbps, the 4090 computer can continue 60 frame, and the RK3588 sometimes decrease frame; so what's the relation of encoder and decoder while increases the bit rate ?

The frame rate is determined by the encoder. The variations in frame rate you observe is noise in your measurements.

Note that:

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.

https://github.com/Genymobile/scrcpy/blob/master/doc/video.md#frame-rate

So the frame rate you get depends on what you run on the device. If your device screen is actually refreshed 40 times per seconds, the scrcpy stream will not be more than 40 fps.

If you run the very same app, and observe differences with different bit rates, as I said your encoder is not performant enough in this situation to maintain 60fps.

We doubt whether the encoder and decoder have negotiated. If the decoder is not capable enough, the encoder will use a low frame rate for encoding.

No way.

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