zoukankan      html  css  js  c++  java
  • Android视频录制命令screenrecord

    转自http://blog.csdn.net/wirelessqa/article/details/22725581

    你要知道:

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

    一些限制

    • 某些设备可能无法直接录制,原因是分辨率太高,如果遇到此类问题,请试着指定较低的分辨率
    • 不支持录制过程中屏幕旋转,如果录制过程中旋转,有可能画面被切断
    • 录制视频的时候声音不会被录下来

    开始录制命令:

    adb shell screenrecord /sdcard/demo.mp4

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

    限制录制时间:

    参数: --time-limit

    adb shell screenrecord  --time-limit 10 /sdcard/demo.mp4

    说明:限制视频录制时间为10s,如果不限制,默认180s

    指定视频分辨率大小:

    参数: --size

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

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

    指定视频的比特率

    参数: --bit-rate

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

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

    在命令行显示log

    参数: --verbose

    
    

    旋转90度

    参数: --rotate

    说明:此功能为实验性的,好不好用不知道

    查看帮助命令

    参数: --help

    bixiaopeng@bixiaopeng ~$ adb shell screenrecord --help
    Usage: screenrecord [options] <filename>
    
    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 megabits per second.  Default 4Mbps.
    --time-limit TIME
        Set the maximum recording time, in seconds.  Default / maximum is 180.
    --rotate
        Rotate the output 90 degrees.
    --verbose
        Display interesting information on stdout.
    --help
        Show this message.
    
    Recording continues until Ctrl-C is hit or the time limit is reached.
    
    

    导出视频:

    adb pull /sdcard/demo.mp4
  • 相关阅读:
    BUG记录之 Database Connection Can’t Be Open!
    C#基础拾遗03注册表保存用户设置
    JQuery Ajax小磨合1
    SQL Server几个常用Date函数(二)
    浅谈设计模式01策略模式
    C#基础拾遗02XML串行化
    SQL Server 2008 R2学习心得
    WebService重载问题
    SQL Server几个常用date函数(一)
    C#获取打印机列表
  • 原文地址:https://www.cnblogs.com/kunkka/p/4555004.html
Copyright © 2011-2022 走看看