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

the screencast is very slow ? any solutions ? #6

Open
ghost opened this issue Jun 26, 2016 · 14 comments
Open

the screencast is very slow ? any solutions ? #6

ghost opened this issue Jun 26, 2016 · 14 comments

Comments

@ghost
Copy link

ghost commented Jun 26, 2016

the screencast is very slow ? any solutions ?

@BetterToAutomateTheWorld

Same issue on my phone

The lag is between 4 and 6 seconds

@yangh
Copy link
Owner

yangh commented Aug 5, 2016

Hi ghost, Darcidride

Could you please tell me what device and resolution of the device you're using?

While the screen is bigger and bigger, and the image captured from device is become bigger and take more time to transfer to PC.

I have no way to fix it, maybe some optimization is possible, such scale down the image before transfer back to host.

@BetterToAutomateTheWorld
Copy link

BetterToAutomateTheWorld commented Aug 5, 2016

Hi,

In my case :

OnePlus One
Resolution : 1920 x 1080

Maybe add an option to choose between quality and performence in an axis can be a good idea.

@ak2766
Copy link

ak2766 commented Aug 18, 2016

For me, the delay is more than 10 seconds - simply unusable.

Galaxy S6 edge+
1440 x 2560

@migsc
Copy link

migsc commented Sep 13, 2016

Would the framerate improve after following the decompression instructions?

@yangh
Copy link
Owner

yangh commented Jan 16, 2017

Hi mchat003

Yes, Sure, 25%+~50%+ speed up after using minizip and patched screencap.

@noraj
Copy link
Contributor

noraj commented May 1, 2017

I have 1 frame every 3 seconds (0.3 FPS).

$ adb --version                                                                                                                                                                                                   
Android Debug Bridge version 1.0.36
Revision 7.1.1_r13

Phone: Elephone P7000 (Android 5.0)

Resolution:

New view size QSize(320, 562) QSize(-1, -1) 
1493670893469 New scene size: 320 530 
1493670893530 Screencap on device options -q -s false false 
1493670894767 CAP FB in 1237 ms 
1493670894803 New Remote screen FB: 1080 1920 1 
New view size QSize(320, 600) QSize(320, 562) 
1493670894826 New scene size: 319 568 

This is not better with minigzip.

@yangh
Copy link
Owner

yangh commented May 2, 2017

Hi noraj1337

1080x1920x4=8M bytes, It's a huge data block for transfer via USB 2.0.

The better way to minimize the data block is convert the output format from RGBA to RGB565 in 'screencap' command.

Good luck.

@yangh
Copy link
Owner

yangh commented May 2, 2017

Some alternative software doing this by install a APK/Service on android device, for reduce the imaging size also for device control.

@BobGraton
Copy link

Hi Yangh,
Firstly, thank you very much for this nice piece of work!
On a EEEpc the framerate is 1 frame each 3 sec for 2560x1440 and 1.5 sec for 1280x720.
On a powerful PC it turns to be 1 frame each second for 1280x720. It's enough to display the content of the Android screen, but not to control the device remotely.
You mentioned APK/Service tools or RGB565: can you give us a hint how to improve the speed eventually?

@Phantom1212
Copy link

Phantom1212 commented Mar 8, 2018

My problem on Xubuntu 17.10 with Samsung Galaxy J3 2016 remote. can u help me please?
screenshot_2018-03-08_13-40-06

@vicrobot
Copy link

vicrobot commented Jul 9, 2018

the same case with me
What is the reason for such laggings?

@mikemrg17
Copy link

I have the same problem with my Huawei P20, any solution?

@yangh
Copy link
Owner

yangh commented Jul 29, 2019

Hi there

The image distortion issue has been fixed in the latest commit 1333e50, which most happened on Android version >= 7.0.

For slow issue, I have some solution in mind, but that depends on some user actions, a strictly depends on userdebug/eng build.

Solutions:

  1. Socket based transfer instead of 'adb shell'

Setup a port forwarding via ADB, then transfer data via the socket over the ADB connection, this may help a bit, current we transfer image data via 'adb shell' command for each frame. socket-based transfer may save some time to start a shell on the remote Android device.

  1. Color space converts before the transfer

For example, RGB565 instead of RGB888, it surely saves 1/3 time for the transfer. but we need to push a customized binary to the device before to do so. And you can guess how many architectures (X86, ARM,...), 32/64 bit, Android version we need to support? it's horrible. I tried to submit a patch (in the contribute directory in source code), but it's not upstreamed.

  1. Compress before transfer, with gzip/minizip

I implemented this option, but it doesn't help on the slow issue, compress/decompress also take time/cpu resource, so it's not a good solution.

  1. UVC, USB video class for image transfer

Requires kernel driver change, and user-space daemon with more depends on the hardware.

Does anyone have more options?

Thanks

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

9 participants