Recently, I need to convert the video to GIF format, so I wrote a demo in lower case to share with you:
pip install moviepy
from moviepy.editor import *
clip = (VideoFileClip("your_video.mov").resize(0.5))
clip.write_gif("test.gif")
references
[1].Python: Convert video to Gif picture. https://zhuanlan.zhihu.com/p/163575055