如何从Android设备屏幕制作GIF

时间:2014-04-26 09:38:20

标签: android screenshot gif

我可以捕获Android设备屏幕:

adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > adb-screenshot-$(date +%Y%m%d-%H%M%S).png

如何将所有这些图像压缩成单个GIF?

3 个答案:

答案 0 :(得分:3)

好的,我找到了。

首先在单个文件夹中完成屏幕截图,然后将其全部转换为GIF,如下所示:

convert *.png screens.gif

将{strong> ImageMagick 安装为described here

在Mac OS X上,我安装了它:brew install ImageMagick

答案 1 :(得分:1)

您可以使用ImageMagick的convert命令将.png文件合并为一个.gif动画:

convert -delay 10 -loop 0 *.png anim.gif

答案 2 :(得分:0)

您可以在此处使用我的完整工作脚本:android-screen-gif.sh。 您只需使用./android-screen-gif.sh运行它,让它记录并在您想要停止时点击Ctrl + C。 这些图像将被拉出并组装一个GIF,对于演示/问题跟踪/电子邮件非常有用! 需要convert在路径上,请参阅此处有关ImageMagick的其他帖子。

Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-1.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-2.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-3.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-4.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-5.png
Downloading images.
pull: building file list...
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-5.png -> ./Screenshot-20150707-105440-5.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-4.png -> ./Screenshot-20150707-105440-4.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-3.png -> ./Screenshot-20150707-105440-3.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-2.png -> ./Screenshot-20150707-105440-2.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-1.png -> ./Screenshot-20150707-105440-1.png
5 files pulled. 0 files skipped.
6077 KB/s (5015743 bytes in 0.805s)
Assembled gif Screenshot-20150707-105440.gif
Cleaned up individual screenshots.