1. 录制视频
adb shell screenrecord --size 640x1280 --time-limit 5 /sdcard/test.mp4
2. 导出视频到电脑
adb pull /sdcard/test.mp4
3. 生成GIF
./ffmpeg -ss 2 -t 5 -i ani.mp4 -s 200x400 -b:v 1500k anim.gif
-ss 2 -t 5
指生成视频的第 2 秒到第 5 秒,如不需要可省略。
adb shell screenrecord --size 640x1280 --time-limit 5 /sdcard/test.mp4
adb pull /sdcard/test.mp4
./ffmpeg -ss 2 -t 5 -i ani.mp4 -s 200x400 -b:v 1500k anim.gif
-ss 2 -t 5
指生成视频的第 2 秒到第 5 秒,如不需要可省略。