首页 技术 正文
技术 2022年11月16日
0 收藏 971 点赞 3,916 浏览 1760 个字

一、查看帮助命令,参数 –help

D:\>adb shell 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 4Mbps.
--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.
  1. 开始录制命令:

adb shell screenrecord /sdcard/demo.mp4

说明:录制手机屏幕,视频格式为mp4,存放到手机sd卡里,默认录制时间为180s。

screenrecord是一个shell命令,支持Android4.4(API level 19)以上,支持视频格式: mp4

2.  指定视频分辨率大小,参数 –size

adb shell screenrecord --size 1280*720 /sdcard/demo.mp4

说明:录制视频,分辨率为1280*720,如果不指定默认使用手机的分辨率,为获得最佳效果,请使用设备上的高级视频编码(AVC)支持的大小

3.  指定视频的比特率, 参数  –bit-rate

adb shell screenrecord --bit-rate 6000000 /sdcard/demo.mp4

说明:指定视频的比特率为6Mbps,如果不指定,默认为4Mbps. 你可以增加比特率以提高视频质量或为了让文件更小而降低比特率

4. 旋转90度,参数: –rotate

adb shell screenrecord --rotate /sdcard/demo.mp4

说明:此功能为实验性的,在nexus6设备上实验,录制的视频播放时也是旋转90度播放,体验不太友好。

5. 导出视频:

adb pull /sdcard/demo.mp4 D:/

说明:导出视频的位置在D盘根目录下,名称为demo.mp4

二、DDMS中使用录制功能

1.命令行中使用DDMS,打开Android DDMS(monitor.bat)工具

2.打开android手机(Android4.4及以上机型)的调试模式,使用USB连接手机,DDMS界面Name中出现手机型号及online的状态

3.Device–>Screen Record,弹出设置页面,设置视频的比特率,和视频的分辨率以及存储路径,点击OK

4.操作手机测试场景,完毕后,点击Cannel按钮,等待几秒后,会弹出提示保存成功。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,964
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,486
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,331
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,114
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,747
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,781