python 视频转gif
作者:
dairoot | 来源:发表于
2021-06-26 18:06 被阅读0次
在线体验
from moviepy.editor import VideoFileClip
import os
zoom_ratio = 0.5 # 尺寸压缩
video_file = "1.mov"
fps = 10 # 帧率
speed = 8 # 倍速
clip = VideoFileClip(video_file)
clip = clip.resize((clip.size[0]* zoom_ratio, clip.size[1] * zoom_ratio))
clip = clip.speedx(speed)
clip.write_gif("g.gif", program='ffmpeg', fps=fps)
print("文件大小:{}M".format(round(os.path.getsize("g.gif") /1024/ 1024, 2)))
本文标题:python 视频转gif
本文链接:https://www.haomeiwen.com/subject/zxlzyltx.html
网友评论