Usage
help
screenrecord --help
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 be specified as
bits or megabits, e.g. '4000000' is equivalent to '4M'. Default 20Mbps.
--bugreport
Add additional information, such as a timestamp overlay, that is 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 hit or the time limit is reached.
options
short |
long |
|
-h -v -s -b -t -u |
--help --verbose --size 1280x720 --bit-rate 20M --time-limit 180 --bugreport |
|
unofficial |
-i -f -r -o |
--show-device-info --show-frame-time --rotate --output-format mp4 h264 frames raw-frames |
android 9 |
-N -m -p |
--codec-name --monotonic-time --persistent-surface |
-M |
--mime-type video/avc |
examples
显示设备信息、时间
screenrecord --bugreport --verbose --time-limit 5 /data/screen.mp4
显示设备信息
screenrecord --show-device-info --verbose --time-limit 5 /data/screen.mp4
显示时间
screenrecord --show-frame-time --verbose --time-limit 5 /data/screen.mp4
保存成帧格式
screenrecord --bugreport --verbose --output-format frames /data/screen.frames
Ctrl+C停止
保存成裸帧格式
screenrecord --bugreport --verbose --output-format raw-frames /data/screen.raw-frames
Ctrl+C停止
保存成原始码流
screenrecord --bugreport --verbose --time-limit 5 --output-format h264 /data/screen.h264
指定编码方式
screenrecord --bugreport --verbose --time-limit 5 --mime-type video/mp4v-es --size 800x480 /data/screen.mp4
screenrecord --bugreport --verbose --time-limit 5 --mime-type video/3gpp --size 800x480 /data/screen.mp4
指定编码器?
screenrecord --bugreport --verbose --time-limit 5 --mime-type video/mp4v-es --size 800x480 --codec-name OMX.google.mpeg4.encoder /data/screen.mp4
patch
--- a/cmds/screenrecord/screenrecord.cpp
+++ b/cmds/screenrecord/screenrecord.cpp
@@ -938,6 +938,7 @@ int main(int argc, char* const argv[]) {
{ "codec-name", required_argument, NULL, 'N' },
{ "monotonic-time", no_argument, NULL, 'm' },
{ "persistent-surface", no_argument, NULL, 'p' },
+ { "mime-type", required_argument, NULL, 'M' },
{ NULL, 0, NULL, 0 }
};
@@ -1026,6 +1027,9 @@ int main(int argc, char* const argv[]) {
case 'p':
gPersistentSurface = true;
break;
+ case 'M':
+ kMimeTypeAvc = optarg;
+ break;
default:
if (ic != '?') {
fprintf(stderr, "getopt_long returned unexpected value 0x%x\n", ic);