-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Is it possible not to encode on the device #1584
Comments
No, scrcpy does not do that. A raw video is HUGE. For example, 1920×1080 at 60fps in RGB would require 1920×1080×60×24 bits per second, which is about 2.8Gbps. Why that question? |
Thank you for the answer. I understand that scrcpy does not do that. There is a loss of quality in the image rendered by scrcpy and also there is a performance impact when scrcpy is running. Usb 3.1 supports upto 10gbps, and if we can use the PC hardware to do all the work, while scrcpy-server just transmits the raw data. just wondering if its even possible P.s i have tested the latest scrcpy and i was able to acheive 0ms latency on 1080p. |
Just use |
Just because the supported data rate is up to 10Gbps with USB 3.1, it doesn't mean a phone can actually reach the level. I have no professional knowledge on the topic, but my older 2016 phone runs an My 2018 flagship, still on USB 2.0, is faster at 35MBps in which case the USB 2.0 may be a bottleneck. Although sometimes it drops to 25MBps. Of course mine aren't the newest flagships any more, but I highly doubt we had achieved the required 25~50x fold improvement on the practical data rate since 2016. The USB controller hardware may be a factor, the entire software stack underlying ADB may be a factor. I'd be really impressed if the newest phones are actually that fast, given the brands have few reasons to pursue USB data rate nowadays. BTW your latency test above is unbelievably good. I have at least 40ms latency over both wired USB and Wi-Fi. Have to say I'm puzzled by your test because scrcpy itself is transmitting at 60fps max. Even if your latency L is below 1000/60=17ms, the camera should still occasionally see a 17ms latency with a probability of L/17. With respect, a latency well below 17ms seems too good. scrcpy only advertises >35ms latency. |
Well I tested a 2018 flagship with usb3.1gen 1 which is about 5gbps. I can say that the bandwidth exists as advertised. My latency is good and stable. The credit goes to scrcpy and rom1v. The advertised latency 35ms was probably tested in worst case situations. Scrcpy doesn't transmit at 60fps. It depends on your screen refresh rate and how often it produces a new frame. It could be 144fps, 90 fps or below 60fps. |
I did the tests in #646 with my main test device, a Nexus 5, which is quite old. It might be better on new devices. But I just tested on a OnePlus 7 Pro, I still get around 35ms at 1080p (which is about the half of what I get on my Nexus 5). |
How are you measuring the latency? I redid the tests with different configurations There is no latency This is basically I'm asking to see latency at 200mbit.its half frame latency Test 3: I changed the resolution to OnePlus 7 pro and with 200Mbit |
This probably does not change anything. The bitrate is just a value passed to the codec, I think it changes nothing above ~20Mbps (it depends on the encoder/device). To get the real bitrate, record the video and device the length by its size.
Yes, it's below 1 frame 🎉 Your encoder is probably very fast :)
What do you mean "changed the resolution to"? If it's not a real OnePlus 7 Pro, the encoder may be different. Anyway, in your last photo, there are about 2 frames latency (895-896 to 897-898). What is the framerate of your video sample? |
Correct me if I'm wrong, from my understanding it's the decoder that consumes more time than encoder.
I used the video from #646 , it says 1 frame is 35ms latency. I used the adb shell command to change the phone's resolution so everything will be rendered at that resolution regardless of actual resolution of the phone. |
I didn't do any benchmark, but I would say that encoder takes more time than decoder (there is more work to do). (That's obvious for CPU encoder vs CPU decoder, but for hardware encoder I'm not totally sure.)
OK, so at the resolution of OnePlus 7 Pro (1440×3120), you get around 60~70ms latency.
OK, but two devices at the same definition will not necessarily give the same latency (it depends on the hardware). |
#646 says 1frame is 35ms latency. So is it safe to say scrcpy latency below 35ms |
On your last screenshot, there are almost 2 frames:
It's a bit less than 2 frames, but not by a lot. |
As you said with default settings I'm getting less than 1 frame latency. So it would be below 35ms isn't it. Scrcpy is the best mirroring software out there, so people should be seeing what it's capble of doing it |
the latency is very good |
right now we are using media encoder to encode the frames and then we are using adb to transfer the data.
Is it possible to send the raw data and use the computer to do encoding or decoding
The text was updated successfully, but these errors were encountered: