android 4.4kitkat手机视频录制【screenrecorder】并转换为GIF格式

参考链接

目前只有4.4以上版本的真机(不支持虚拟机)支持频幕视频录制功能。

你需要更新adt版本(如果你当前adt版本不能升级platform tools到V19或以上),然后升级platform tools。

本以为会在ddms看到相应的UI按钮帮助我录屏,最后还是乖乖的开了shell。

控制台进入adt的安装目录,找到sdk/platform-tools/,使用shell命令:

$ adb shell screenrecord /sdcard/recording.mp4

后者为输出的目录和文件名,可以自定义,另外有参数可供选择:

  • --help : Displays a usage summary.帮助菜单。
  • --size : Sets the video size, for example: 1280x720. The default value is the device's main display resolution (if supported), 1280x720 if not. For best results, use a size supported by your device's Advanced Video Coding (AVC) encoder.设置视频大小。
  • --bit-rate : Sets the video bit rate for the video, in megabits per second. The default value is 4Mbps. You can increase the bit rate to improve video quality or lower it for smaller movie files. The following example sets the recording bit rate to 6Mbps: screenrecord --bit-rate 6000000 /sdcard/demo.mp4.设置视频比特率。
  • --time-limit : Sets the maximum recording time, in seconds. The default and maximum value is 180 (3 minutes).设置录制时间,单位是秒,最长180秒即3分钟。
  • --rotate : Rotates the output 90 degrees. This feature is experimental.90度旋转输出结果。
  • --verbose : Displays log information on command line screen. If you do not set this option, the utility does not display any information while running.录制时输出一些信息包括尺寸大小,比特率等。
如果录制视频是为了演示用,笔者建议在机器的开发者选项者打开“显示触摸操作”,这样你的触摸操作会在屏幕上有白点显示,方便演示手势等操作。

录制视频为mp4格式,如果你需要转换为GIF格式,不要去百度那些个视频转换软件,笔者在百度搜了一圈都是不能用的,可能我搜得有问题,这里推荐一款国外的非常轻便好用的软件Free Video to GIF Converter
录制效果可以参考上一篇博文。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值