Closed rhobro closed 2 years ago
The same lag occurs with and without the scrcpy window open.
This is weird. Can you check whether your CPU is overloaded?
By the way, are you using the scrcpt-client[ui]
?
This is weird. Can you check whether your CPU is overloaded?
Despite running both scrcpy and py-scrcpy-client at the same time, the CPU load is minimal. Now that I have changed network, the lag seems to have reduced but py-scrcpy-client is definitely lagging behind by a second or two.
No, I'm not using scrcpy-client[ui]. Is this the problem?
ok
As you mentioned network, are you using wifi to connect to the device?
Can you test official scrcpy 1.18?
Maybe there is some problem with wifi port forwarding, can you also test the USB connection?
I was using Wi-fi to connect to the device. Seeing the lag, I switched to usb but the lag was still there.
I'll test 1.18 and report the results.
I am already on 1.19 and don't need to update to 1.18
Can py-scrcpy-client start using v1.19 of scrcpy-server?
I planed to update to 1.20 when it's published.
Since scrcpy always publishes new versions, I don't have enough time to follow every small version.
When will that be?
If scrcpy doesn't publish v1.20 this month, I will upgrade to 1.19.
Ok. Thanks. When you do upgrade, please let me know.
Scrcpy v1.20 has been released.
Great! I will upgrade the scrcpy-client in about three days.
A new version is publishing, can you try it later?
I was using Wi-fi to connect to the device. Seeing the lag, I switched to USB but the lag was still there.
How much is the lag on USB? I didn't find a lag on my devices :(
I'll try it later.
The lag on usb with the old version was about 1 to 2 seconds
any update?
There is still a 1 to 2 second lag via USB
I will try to figure out why this happens when I have time, and the issue won't be closed until the problem is solved.
Ok. Thank you. Here is some context for when you're looking. I'm running macOS Monterey on an Intel Mac.
I can't reproduce the lag.
can you send me a similar timer screenshot?
For some reason when I use opencv to show the display side by side with scrcpy, the lag is roughly 100ms but when I don't, it is roughly 500ms
Seems like a Qt rendering problem?
My screenshot shows that the lag on my laptop is about 30ms
Can you try the newest py-scrcpy? I updated some parts in the UI rendering.
I found the problem, it is here https://github.com/leng-yue/py-scrcpy-client/blob/de17bb4b5f3651cb9580a5dc1cda65e0426f3430/scrcpy/core.py#L181-L194
Using this code, I can get the same latency as the official scrcpy. However, the stream is not stable and may raise errors. If you have any ideas to solve this problem, please share them with me.
Does OpenCV use Qt to render?
Aha, What was the issue?
I'll try it with that code
I connected my phone and opened up scrcpy and an opencv window with the inputs form py-scrcpy-client.
When I had them side by side, I noticed that scrcpy was instant while py-scrcpy-client had a roughly 3 to 5 second lag. Why is this the case?