• 实现效果
    在这里插入图片描述

  • 开源原因: 市面上的其他转换工具多半要收费,不划算,所以就开源了

  • 采用框架: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 *


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)
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐