adbkit icon indicating copy to clipboard operation
adbkit copied to clipboard

[Enhancement]: Use screenrecord streaming instead of anything else for current frame ?

Open darkyen opened this issue 10 years ago • 5 comments

As found on stackoverflow, the command

  $> adb shell screenrecord --output-format=h264 -

Pushes the output buffer to stdout. Perhaps add that as an addon ? It is much faster and the most logical and only real streaming way over usb.

http://stackoverflow.com/questions/26786926/android-screen-capture

darkyen avatar Mar 31 '15 07:03 darkyen

Hi,

While true, we're currently trying to keep the API methods fairly backwards-compatible so that they'll work on any 2.3+ device. Then again, I would accept a complete pull request for it. Note that you can still do the same thing with .shell(), although you'll need to make sure you're giving the right options to each version of android.

sorccu avatar Mar 31 '15 07:03 sorccu

Whoa ! Thanks for the quick reply.

I have thought of a way to do this, falling back to framebuffer but the streaming on those will rely on unreliable framebuffer but again 16bpp may be able to pull graceful fps.

darkyen avatar Mar 31 '15 07:03 darkyen

From personal experience most devices max out at around 5MB/s, making it very difficult to get even 1fps on 1080x1920 displays using raw pixel data. Here at the company we do have a way around this to get quite reasonable FPS even on older devices, but that part hasn't been open sourced yet. We are currently planning on releasing it next month along with other goodies.

However, from what I understand, the "graphics" group which is needed for framebuffer, screenrecord and screencap access got removed from ADB a while ago - it's still there in 5.1 but it's a bit unsure if screenrecord/screencap will continue to work in future releases :(

sorccu avatar Mar 31 '15 08:03 sorccu

Oh wow am excited to see what you come out with, I found the the stdout while trying to write a tool to control my headless nexus 5 (I broke the screen and the device is locked, on network 2g ... the only way out is to control it somehow :D) the mp4's framerate seems much superior to what i used to get on screencap and display

darkyen avatar Mar 31 '15 08:03 darkyen

@sorccu I decided to use client.shell() like is done here https://github.com/mindmelting/adb-screenrecord/blob/master/bin/adb-screenrecord#L31 , any idea how to stop that programmatically? . To implement something similar to the topic of this ticket, I just previously recognize the Android version and then out of the box avoid record in devices < 4.4. Dirt but works for testing purposes.

juanpicado avatar Jul 21 '15 12:07 juanpicado