2023年6月27日发(作者:)
ADB录制视频Android视频录制命令screenrecord在Android 4.4(Kitkat - API level 19)上集成了⼀个⽐较好⽤的视频(.mp4格式)录制功能 –screenrecordscreenrecord。使⽤⽅法1. 基本⽤法$ adb shell screenrecord /sdcard/4/sdcard/4为视频录制⽂件路径/sdcard/4录制默认分辨率,默认4Mbps,默认180s的视频,保存到sdcard上名为42. 旋转(参数:–rotate)$ adb shell screenrecord --rotate /sdcard/4旋转90度3. 指定分辨率(参数:–size)$adb shell screenrecord --size 112x112 /sdcard/4分辨率为112x112,建议不要指定分辨率,使⽤默认分辨率效果最佳;注意,分辨率不是完全可以随意定制的,⽐如在我⼿机上录制100x100的会提⽰错误:The max width/height supported by codec is1920x1088100x100is not supported by codec, suggest to set it as112x1124. 指定⽐特率(参数:–bit-rate)$adb shell screenrecord --bit -rate 8000000 /sdcard/4设置⽐特率为8Mbps,⽐特率越⼤,⽂件越⼤,画⾯越清晰;5. 限制录制时间 (参数: –time-limit)$adb shell screenrecord --time -limit 10 /sdcard/4限制视频录制时间为10s,如果不限制,默认180s6. 导出视频$adb pull /sdcard/47. 注意请关注视频⽂件⽣成⼤⼩,根据⾃⾝情况⽽定;暂不⽀持声⾳;咱时不⽀持模拟器录制(模拟器录制看这⾥),出现如下提⽰:Unable to get output buffers (err=-38)Encoder failed (err=-38),可认为是此原因;8. 命令查看adb shell screenrecord --helpUsage: screenrecord [options]Records the device's display to a .mp4 s:--size WIDTHxHEIGHTSet the video size, e.g."1280x720". Default is the device's maindisplay resolution (if supported), 1280x720if not. For bestresults,use a size supported by the AVC encoder.--bit -rate RATE Set the video bit rate, in megabits per second. Default4Mbps.--time -limit TIME Set the maximum recording time, in seconds. Default / maximum is180.--rotate Rotate the output90 degrees.--verbose Display interesting information on stdout.--help Showthis ing continues until Ctrl-C is hit or the time limit is reached.
发布者:admin,转转请注明出处:http://www.yc00.com/web/1687821957a48142.html
评论列表(0条)