In this article we will see how we can save video file clip as GIF in MoviePy. MoviePy is a Python module for video editing, which can be used for basic operations on videos and GIF’s. Video is formed by the frames, combination of frames creates a video each frame is an individual image. The Graphics Interchange Format is a bitmap image format that was developed by a team at the online services provider CompuServe.
In order to do this we will use
write_gifmethod with the VideoFileClip object
Syntax : clip.write_gif(name)
Argument : It takes string i.e file name as argument
Return : It returns None
Below is the implementation
MoviePy - Building file gfg_gif.gif with imageio. Moviepy - Building video __temp__.mp4. Moviepy - Writing video __temp__.mp4 Moviepy - Done ! Moviepy - video ready __temp__.mp4
MoviePy - Building file intro_gif.gif with imageio. Moviepy - Building video __temp__.mp4. Moviepy - Writing video __temp__.mp4 Moviepy - Done ! Moviepy - video ready __temp__.mp4
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.