<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > Android系統如何錄制屏幕(錄制成mp4格式)

Android系統如何錄制屏幕(錄制成mp4格式)

作者: 時(shí)間:2016-09-12 來(lái)源:網(wǎng)絡(luò ) 收藏

不管是教學(xué),還是為了演示,如果能將Android手機(或平板)的屏幕錄制成視頻文件,那是一件非??岬氖?iOS8已經(jīng)提供了這一功能,能通過(guò)OSX直接在Mac上錄制iPad、iPhone的屏幕,windows沒(méi)試過(guò),不知可不可以)。不過(guò)以前的方法都是通過(guò)截屏錄制的,效果極差。幸好Android4.4以上版本提供了這一功能。但無(wú)法在手機上直接啟動(dòng),需要通過(guò)adb使用命令行啟動(dòng)。

本文引用地址:http://dyxdggzs.com/article/201609/304309.htm

大家可以進(jìn)入shell?;蚋纱嘀苯佑胊dbshell執行命令。該命令是screenrecord,可以輸入screenrecord --help,看看幫助,如下所示。

Usage: screenrecord [options]

Android screenrecord v1.2. Records the device's display to a .mp4 file.

Options:

--size WIDTHxHEIGHT

Set the videosize, e.g. 1280x720. Defaultis the device's main

displayresolution (if supported), 1280x720 if not. For best results,

use a sizesupported by the AVC encoder.

--bit-rate RATE

Set thevideo bit rate, in bits per second. Value may be specified as

bits ormegabits, e.g. '4000000' is equivalent to '4M'. Default 4Mbps.

--bugreport

Addadditional information, such as a timestamp overlay, that is helpful

in videoscaptured to illustrate bugs.

--time-limit TIME

Set themaximum recording time, in seconds. Default / maximum is 180.

--verbose

Displayinteresting information on stdout.

--help

Show thismessage.

Recording continues until Ctrl-C is hit or the timelimit is reached.

從這些幫助信息可以了解到,screenrecord需要后面跟一個(gè)mp4文件名。最簡(jiǎn)單的形式如下:

screenrecord /sdcard/game.mp4

但要注意,mp4要寫(xiě)入的目錄必須是可寫(xiě)的。

輸入完命令后,直接按回車(chē),命令會(huì )被阻塞,默認什么都不會(huì )輸出,這是正在錄制呢。操作手機的所有畫(huà)面都會(huì )被錄制下來(lái)。如果要輸出相應的信息,需要加--verbose命令行參數,加該命令行參數,整個(gè)錄制過(guò)程可能會(huì )輸出如下類(lèi)似的信息。

Main display is 1080x1920 @60.00fps (orientation=0)

Configuring recorder for 1080x1920 video/avc at4.00Mbps

Content area is 1080x1920 at offset x=0 y=0

^CEncoder stopping; recorded 68 frames in 12 seconds

Stopping encoder and muxer

Executing: /system/bin/am broadcast -aandroid.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:///sdcard/test.mp4

Broadcasting: Intent {act=android.intent.action.MEDIA_SCANNER_SCAN_FILE dat=file:///sdcard/test.mp4 }

Broadcast completed: result=0

當然,可以跟很多選項,常用的就是--size(尺寸)、--bit-rate(比特率)和--time-limit(錄制最大時(shí)間)

尺寸默認是當前手機屏幕分辨率、比特率是默認4Mbps、錄制時(shí)間默認是3分鐘(180秒)

screenrecord --time-limit 100 /sdcard/game.mp4

上面的命令最大可錄制100秒的視頻。如果想中途停止錄制,可按Ctrl C,終止錄制,game.mp4仍然會(huì )生成,但只會(huì )錄制從開(kāi)始錄制到按Ctrl-C這段時(shí)間的視頻。下圖是我錄制的20秒射擊游戲的效果圖。完整視頻可在下面的地址下載。



關(guān)鍵詞:

評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>