-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Allow client to take a screenshot #112
Comments
A command-line argument? So it would take a screenshot and exit? Or a shortcut, to save the current frame to a file somewhere? |
As I need to control it programmatically, it would be most convenient for me if it could take a screenshot and exit, yes. Right now I am looking into whether I can write a small client to speak the protocol and connect to the device to grab a single frame, any information you may have would be of great help. |
That would probably not be faster than adb exec-out screencap -p > screenshot.png Starting the java application through |
Ah, I thought the server would already be running. Yes, you may be right. |
I didn't know about |
Ah ok :) To be faster, Too specific though. |
Yeah, too specific and Thanks for the help and for a fantastic project! |
@skorokithakis but I need 2 second |
Any hint how could I achieve this? I am interested in to develop such a feature. Thanks Romain |
@dedosmedia see #684 |
Dear @rom1v, thank you for your workaround suggestion. Now I managed to write a simple bash script to automatically execute scrcpy, request screenshot in ubuntu using gnome-screenshot (no window), save it, & close the scrcpy window. The problem is the captured image resolution is not correct as my device (an Android TV) has a 2k resolution. This is because my PC monitor aspect ratio is 16:10 while the TV itself aspect ratio is 16:9. (Already using ctrl + G shortcut). However, the tool I'm developing has a requirement to preserve the original device resolution. Any idea how to solve this? adb screencap doesn't always reliable because it can't capture some screens (especially 3rd party apps i.e., YouTube main screen), which will return an empty png file. |
Would it be possible to add a command-line argument to allow the client to take a screenshot? I am writing a short script to capture the screen, but it's latency-sensitive, and the default way of using
screencap
takes two full seconds just to encode to JPG. Anything cutting down on that would be very welcome.The text was updated successfully, but these errors were encountered: