How to transform an mp4 to gif with Python and ffmpeg (ffmpy module)

ffmpy module

Another useful module is ffmpy, that I used in this example to transform and mp4 file (video) into a gif.

The code to transform mp4 to gif

import ffmpy
ff = ffmpy.FFmpeg(
	inputs = {"cash.mp4" : None},
	outputs = {"cash.gif" : None})

ff.run

The video with the explanation of the details

In the following video I will guide you step by step through the straight process to create a gif animate file from a video. This can be useful to put some interesting animations in your blogs both for fun, than for the purpose to explain something in a more clear and interesting way. So if you are interested in creating nice animated gif created from file video in mp4 format, watch the following video.


Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.