Android, Native OpenGL/OpenMAX, Screen capture

前端 未结 2 351
闹比i
闹比i 2021-01-03 17:03

Use-case

Mirror Android Screen to PC using USB

Potential (Native) Implementation Approaches

  1. Using Android Open-Source, modify screenrecord
2条回答
  •  青春惊慌失措
    2021-01-03 17:43

    The screenrecord that ships with Android 5.0 "Lollipop" can send raw H.264 over ADB. The command line looks like:

    adb shell screenrecord --output-format=h264 - | 
    

    A few details are on the bigflake page. I've used it to mirror the screen onto a Linux workstation, but unfortunately I didn't save the VLC/mplayer command lines. Some player suggestions are here.

    You can try to do uncompressed frames (--output-format=raw-frames), but at decent frame rates that easily overwhelms the ADB connection, even if the screen is tiny.

    Source code is here.

提交回复
热议问题