你好,我正在尝试连接和屏幕记录,通过HDMI连接到Android设备上的第二个显示器。我能够成功的屏幕捕捉和录制主要的Android手机屏幕,但我有一个设备显示到第二个屏幕。
我想做的是:
目前所做的工作:
当试图对第二个显示(HWC显示1)进行屏幕记录时,adb似乎没有切换到特定列表显示的选项,shell屏幕记录-帮助选项也没有。
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在这里:显示/显示#静态
来源: screenrecord.cpp:https://android.googlesource.com/platform/frameworks/av/+/ae6965ae7664aaea489a8d58358035610075c9af/cmds/screenrecord/screenrecord.cpp
屏幕记录可以很好地捕捉手机显示,但外部显示是一种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看到它,但没有看到连接到它和记录的选项。
发布于 2020-10-03 09:33:18
screenrecord
版本1.3 (Android11)提供了选择不同显示器的可能性。特别是,--display-id
是您必须用来提供ID或投影的参数。
Android screenrecord v1.3. 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.
--display-id ID
specify the physical display ID to record. Default is the primary display.
see "dumpsys SurfaceFlinger --display-id" for valid display IDs.
--verbose
Display interesting information on stdout.
--help
Show this message.
Recording continues until Ctrl-C is hit or the time limit is reached.
在这里,您可以查看屏幕记录源代码。
https://stackoverflow.com/questions/64180082
复制相似问题