【发布时间】:2020-10-03 02:10:16
【问题描述】:
您好,我正在尝试通过 HDMI 连接和屏幕录制连接到 Android 设备的辅助显示器。我能够成功截屏并记录 Android 手机主屏幕,但我有一个设备显示到第二个屏幕。
我想做什么:
- 屏幕记录显示在第二个显示屏而非主显示屏上的内容
- 应用程序的显示是通过 Android 设备的 HDMI 输出 到投影
目前做了什么:
-
确定是否有显示器:
adb 外壳 c1q:/ $ dumpsys SurfaceFlinger --display-id 显示 16409431620704260(HWC 显示 1):端口=4 pnpId=PRO displayName="projector" 显示19261213734341249(HWC显示0):port=129 pnpId=QCM displayName="ss_dsi_panel_"
-
尝试连接:
当尝试屏幕录制第二个显示(HWC 显示 1)时,adb 似乎没有切换到特定列出的显示的选项,shell screenrecord --help 选项也没有
127|c1q:/ $ screenrecord --help
Usage: screenrecord [options] <filename>
Android screenrecord v1.2. Records the device's display to a .mp4 file.
Options:
--size WIDTHxHEIGHT
Set the video size, e.g. "1280x720". Default is the device's main
display resolution (if supported), 1280x720 if not. For best results,
use a size supported by the AVC encoder.
--bit-rate RATE
Set the video bit rate, in bits per second. Value may be specified as
bits or megabits, e.g. '4000000' is equivalent to '4M'. Default 20Mbps.
--bugreport
Add additional information, such as a timestamp overlay, that is helpful
in videos captured to illustrate bugs.
--time-limit TIME
Set the maximum recording time, in seconds. Default / maximum is 180.
--verbose
Display interesting information on stdout.
--help
Show this message.
Recording continues until Ctrl-C is hit or the time limit is reached.
我浏览了下面列出的一些文档:
Android AOSP 在这里: https://source.android.com/devices/tech/display/multi_display/displays#static
源 screenrecord.cpp: https://android.googlesource.com/platform/frameworks/av/+/ae6965ae7664aaea489a8d58358035610075c9af/cmds/screenrecord/screenrecord.cpp
screenrecord 可以很好地捕捉手机显示,但外接显示器是 type-C HDMI 输出迷你投影仪,目标是捕捉和记录通过 HDMI 发送到的其他应用程序,无论应用程序。第三方应用程序投射的内容与 Android 手机屏幕(例如 Android Watch)上显示的内容不同,并希望从桌面无线记录。
adb tcpip 5555
adb connect [Device IP Address]:5555
adb shell screenrecord /sdcard/Downloads/test.mp4
这很好用,下一部分是记录第二个显示
Display 16409431620704260 (HWC display 1): port=4 pnpId=PRO displayName="projector"
我确实了解可以为您自己的 Android 应用程序创建一个实现来访问显示,但我想记录任何应用程序,切换到特定显示并在那里记录,SurfaceFlinger 看到它但看不到连接到它的选项并记录
【问题讨论】:
标签: android adb android-source screen-recording external-display