Whether it's teaching or demonstrating, it's really cool if you can record your Android phone (or tablet) 's screen as a video file (IOS8 has already provided the ability to record ipad and iphone screens directly on Mac via OS X, which Windows hasn't tried, I don't know if I can). But the previous method was recorded by the screenshot, the effect is very poor. Fortunately Android4.4 the above version provides this feature. However, it cannot be started directly on the phone and needs to be started by ADB using the command line.
Everyone can enter the shell. Or simply execute the command directly with the adb shell . The command is Screenrecord, you can enter Screenrecord--helpto see the help, as shown below.
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 specified as
Bits or megabits, e.g. ' 4000000 ' is equivalent to ' 4M '. Default 4Mbps.
--bugreport
Add additional information, such as a timestamp overlay, that's 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 hits or the time limit is reached.
You need to know:
Screenrecord is a shell command
Support Android4.4 (API level 19) above
Supported video formats: MP4
Some limitations:
Some devices may not be able to record directly because the resolution is too high and if you encounter such a problem, try specifying a lower resolution
Screen rotation during recording is not supported, if the recording process rotates, it is possible that the screen is cut off
The sound won't be recorded when you record the video.
Start recording command:
adb shell Screenrecord /sdcard/demo.mp4
Note: Recorded phone screen, video format mp4, stored in the phone SD card, the default recording time is 180s
Limit recording time:
Parameter: --time-limit
adb shell Screenrecord--time-limit 10/sdcard/demo.mp4
Description: Limit video recording time to 10s, if not limited, default 180s
Specify the video resolution size:
Parameter: --size
adb shell Screenrecord--size 1280*720/sdcard/demo.mp4
Description: Recorded video, resolution 1280*720, if you do not specify the default use of the phone's resolution, for best results, use the Advanced video encoding (AVC) supported size on the device
Specify the bitrate for the video:
Parameter: --bit-rate
adb shell Screenrecord--bit-rate 6000000/sdcard/demo.mp4
Description: Specifies that the video has a bit rate of 6Mbps, and if not specified, the default is 4Mbps. You can increase the bitrate to improve the video quality or reduce the bit rate in order to make the file smaller
To display log at the command line:
Parameter:--verbose
[Email protected] wirelessqa$ adb shell screenrecord--time-limit--verbose/sdcard/demo.mp4 Main display is 1080x1920 @60.00fps (orientation=0) configuring recorder for 1080x1920 video at 4.00Mbps Content area was 1080x1920 at offset x=0 y=0 Time limit reached Encoder stopping; Recorded frames in seconds stopping encoder and muxer executing:/system/bin/am broadcast-a android.intent.action.m Edia_scanner_scan_file-d file:///sdcard/demo.mp4 broadcasting:intent {act=android.intent.action.media_scanner_ Scan_file Dat=file:///sdcard/demo.mp4} broadcast completed:result=0
Rotate 90 degrees:
Parameter: --rotate
Description: This function is experimental, not good to know
To view the help command:
Parameter: --help
[Email protected] ~$ adb shell screenrecord--help usage:screenrecord [options] <filename> Records the device ' s dis Play 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 of degrees. --verbose Display interesting information on stdout. --help Show this message. Recording continues until ctrl-c is hits or the time limit is reached.
Export Video:
adb Pull/sdcard/demo.mp4
Description: Export the video to the current directory
Reference Link: http://blog.csdn.net/wirelessqa/article/details/22725581
Android video recording command Screenrecord