Comments (3)
I think that what you're seeing is the adb daemon disconnecting you after the command has executed and the device has sent its response.
For what you describe, it seems that the best option would be to open an interactive shell connection to the device and then continuously send the screencap commands. We don't have support for interactive shells in SharpAdbClient yet, I'm not sure what it would take to get that added.
Alternatively, we did some work to make GetFramebuffer reasonably fast, but I'm guessing it does not work for your emulator, does it?
from madb.
I will make some researchs about interactive shell, I just used ADB for simple things.
I'm working with MEmu android emulator and I need to capture the emulator screen like 1~2 times per second for a few minutes, just to interact with a game while the battle is running, besides Bluestacks, Memu and other emulators run inside a virtual machine, so I can't capture its screen like I do on BS using Windows API, because when it is a VM it returns a black screen, so I need to use ADB to generate the screenshot so I can read the png file, I've been trying to find a better solution for this, but I don't think there is a better way to do that.
Btw, about the GetFrameBuffer speed, here are some 'statistics' about the capture screen speed for me.
Using GetFrameBufferAsync:
var image = await AdbClient.Instance.GetFrameBufferAsync(device, CancellationToken.None);
483,5614 ms
448,0569 ms
490,5623 ms
472,56 ms
443,5563 ms
477,5606 ms
444,5565 ms
554,0704 ms
430,0546 ms
513,0652 ms
477,0605 ms
Using the AdbSocket in OP:
330,542 ms
254,5324 ms
352,0447 ms
248,5316 ms
240,5305 ms
344,5437 ms
265,0337 ms
249,0316 ms
382,5486 ms
308,5392 ms
from madb.
Hello, you should mention the Resolution of your device, otherwise the benchmark results cannot be compared
from madb.
Related Issues (20)
- How to resubscribe DeviceMonitor.DeviceConnected after disposing?
- Crossplatform compatibility HOT 2
- Getting files in directory and modified timestamp
- Is there a function/method monitor for OnDeviceReconnect
- "File doesn't exist" but it exists HOT 1
- System.ArgumentOutOfRangeException: ""
- Send command realtime
- Make DeviceData a partial class for extension
- How to wait for connection?
- Serial number is the connection IP when using adb over WiFi HOT 1
- The buffer length X does not match the expected buffer length for a picture of width W, height H and pixel depth D HOT 2
- Memory leak caused by GetFrameBufferAsync HOT 2
- StartServer hangs
- Filename of Download/Upload with characters other than English/Numbers
- Starting ADB Server results in a dangling process as the server is treated as a child process
- ADBClient changes (singelton is gone) HOT 1
- ADB Command without shell HOT 1
- DeviceMonitor does not work
- Adb commands for windows 7 rooted device not responding.
- GetFrameBufferAsync artefacts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from madb.