Python:将GIF转换为视频(mp4) [英] Python: Convert GIF To video(mp4)

查看:133
本文介绍了Python:将GIF转换为视频(mp4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到使用Python或库将GIF转换为mp4的方法.我没有找到任何解决方案.我找到了一个用于从视频生成gif的库,但并非相反.

I am trying to find some way for converting GIF to mp4 using Python or library. I didn't found any solution for it. I found a library for generating gifs from videos but not the other way round.

任何人都可以给我一些有关如何做的信息.

Can anyone please give me some information on how to do it.

推荐答案

尝试MoviePy:

import moviepy.editor as mp

clip = mp.VideoFileClip("mygif.gif")
clip.write_videofile("myvideo.mp4")

如果您尚未安装MoviePY,请先安装它:

If you don't have MoviePY installed then first install it:

pip install MoviePy

这篇关于Python:将GIF转换为视频(mp4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆