Gif2mp4 by Python

Reference link

Purpose:

$ .gif \rightarrow .mp4$

solve:

  1. pip install MoviePy

    import moviepy.editor as mp
    clip = mp.VideoFileClip("mygif.gif")
    clip.write_videofile("myvideo.mp4")
  2. If you have ffmpeg on your device, this might be Okay as well.

    pip install ffmpy
    import ffmpy
    ff = ffmpy.FFmpeg(
    inputs={'input.gif': None},
    outputs={'output.mp4': None}
    )
    >>> ff.run()

  -1. If python isn't necessary, THIS ONE would be a very good and comprehensive choice.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325216491&siteId=291194637