analitics

Pages

Monday, December 19, 2022

Python 3.10.2 : MoviePy - part 001.

MoviePy is a Python module for video editing, which can be used for basic operations (like cuts, concatenations, title insertions), video compositing (a.k.a. non-linear editing), video processing, or to create advanced effects. It can read and write the most common video formats, including GIF.
You can read more about this python package on this webpage.
I install this python package with the pip3 tool:
pip3 install MoviePy --user
I have an AVI file type created with the Blender 3D software, named anime_effect_001.avi, you can find it on my youtube channel.
I used this source code to convert it into an mp4 file type:
import moviepy.editor as moviepy
clip = moviepy.VideoFileClip("anime_effect_001.avi")
clip.write_videofile("MP4_anime_effect_001.mp4")
I run with this command:
python moviepy_001.py
Moviepy - Building video MP4_anime_effect_001.mp4.
Moviepy - Writing video MP4_anime_effect_001.mp4
...
Moviepy - Done !
Moviepy - video ready MP4_anime_effect_001.mp4
I play the MP4 file with the VLC video player and works great.