Android 如果我发布';adb外壳屏蔽盖/存储/SD卡/文件。结果是什么类型的文件?
在adb shell中,screencap-h告诉我:Android 如果我发布';adb外壳屏蔽盖/存储/SD卡/文件。结果是什么类型的文件?,android,adb,Android,Adb,在adb shell中,screencap-h告诉我: usage: screencap [-hp] [-d display-id] [FILENAME] -h: this message -p: save the file as a png. -d: specify the display id to capture, default 0. If FILENAME ends with .png it will be saved as a png. I
usage: screencap [-hp] [-d display-id] [FILENAME]
-h: this message
-p: save the file as a png.
-d: specify the display id to capture, default 0.
If FILENAME ends with .png it will be saved as a png.
If FILENAME is not given, the results will be printed to stdout.
它不指示捕获的屏幕是什么类型的文件 首先,您发布的消息确实表明了有关格式的一些信息:您可以使用
-p
标志获取PNG文件
您可以找到screencap的来源。显然,screencap
以原始格式保存数据(除非您告诉它保存为PNG)
您可以在源代码中找到有关该格式的更多信息:
宽度*高度*字节/像素(像素格式)
字节。图像逐行保存,因此给定屏幕位置的像素数据从偏移量(y*宽度+x)*字节/像素(像素格式)
开始大多数像素格式的解码应该非常简单。屏幕缓冲区将始终为
像素\u格式\u RGBA\u 8888
。查看链接问题的答案,了解如何将其转换为文件的说明,或者只使用-p
选项 你说的类型是什么意思?你想要什么类型的adb shell screenrecord/sdcard/video。mp4
将以mp4
格式保存视频。@java\u dudescreencap
和screenrecord
之间有区别。@still\u learning当然有区别。我只是添加了它作为一个示例来显示文件扩展名mp4
。still\u learning的答案是正确的,但是我注意到12字节的头信息是little-endian格式的。也许这是一个我不知道的已知事实。不管怎样,希望这能帮助那些没有帮助的人。