Android拓展系列(9)--Android視頻錄製screenrecord命令

來源:互聯網
上載者:User

在Android4.4 Kitkat上整合了一個比較好用的視頻錄製功能。
參考:http://forums.androidcentral.com/android-4-4-kitkat/329674-how-use-screen-recording-android-4-4-kitkat.html

1、名稱
screenrecord

2、使用說明

$ adb shell screenrecord --helpUsage: 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.

3、舉例
(1). 基本使用

// 錄製預設解析度,預設4Mbps,預設180s的視頻,儲存到sdcard上名為FILENAME.mp4$adb shell screenrecord /sdcard/FILENAME.mp4

(2). 指定解析度(參數:--size)

// 解析度為112x112,建議不要指定解析度,使用預設解析度效果最佳$adb shell screenrecord --size 112x112 /sdcard/FILENAME.mp4

注意,解析度不是完全可以隨意定製的,比如在我手機上錄製100x100的會提示錯誤:

// 100x100不支援,建議設為112x112$adb shell screenrecord --size 100x100 /sdcard/FILENAME.mp4The max width/height supported by codec is 1920x1088100x100 is not supported by codec, suggest to set it as 112x112

(3). 指定位元速率(參數:--bit-rate)

// 設定位元速率為8Mbps,位元速率越大,檔案越大,畫面越清晰$adb shell screenrecord --bit-rate 8000000 /sdcard/FILENAME.mp4

(4). 旋轉(參數:--rotate)

// 旋轉90度$adb shell screenrecord --rotate /sdcard/FILENAME.mp4

4、小結
(1). 產生的MP4檔案很小,幾百K到幾百M,很方便。(本人工作中測試錄製的視頻動輒幾十M或者幾百M)。
(2). 不支援聲音,如有需要,另外獨立錄製。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.