- 实现效果
- 开源原因: 市面上的其他转换工具多半要收费,不划算,所以就开源了
- 采用框架:
PyQt5
+moviepy
- win安装包地址:
https://ytouch-1258011219.cos.ap-nanjing.myqcloud.com/dt_mp4_gif.exe
- 开源代码地址:
https://github.com/huifeng-kooboo/dt_mp4_gif
- 使用方式: 选择文件, 点击开始转换,转换完成自动打开gif文件
- 核心代码部分
from moviepy.editor import *标签:mp4,clip,gif,开源,GIF,MP4,file,duration From: https://blog.51cto.com/u_15906863/5986634
class MovieTool:
def __init__(self):
pass
@staticmethod
def save_mp4_to_gif(origin_file, convert_file):
clip = VideoFileClip(origin_file)
duration = clip.duration
if duration > 10:
clip.subclip(0, 10)
else:
clip = clip.subclip(0, int(duration))
clip.write_gif(convert_file)