moviepy Profile
moviepy can cut, merge, insert title and other processes on the audio, video, pictures and git, and supports a variety of formats.
moviepy also based on ffmpeg, ffmpeg installed if not, moviepy will automatically download and install ffmpeg use moviepy the first time, if the machine is installed ffmpeg, proposed to amend the config_defaults.py
file to configureFFMPEG_BINARY = 'auto-detect'
As for the other tools, it is the corresponding appropriate tools to decide whether or not to install, such as adding text requires ImageMagick , preview audio and video needs PyGame
moviepy use
core object moviepy that clips
can be AudioClips
orVideoClips
create clips
|
|
VideoClip
VideoClip
is the base class for all the other video clips in MoviePy. If all you want is to edit video files, you will never need it. This class is practical when you want to make animations from frames that are generated by another library. All you need is to define a function make_frame(t)
which returns a HxWx3 numpy array (of 8-bits integers) representing the frame at time t. Here is an example with the graphics library Gizeh
:
|
|
ImageSequenceClip
This is a clip made from a series of images, you call it with:
|
|
where images_list
can be either a list of image names (that will be played) in that order, a folder name (at which case al 大专栏 moviepy视频处理库使用详解l the image files in the folder will be played in alphanumerical order), or a list of frames (Numpy arrays), obtained for instance from other clips.
TextClip
Generating a TextClip requires to have ImageMagick installed and (for windows users) linked to MoviePy
Exporting video clips
|
|
Sometimes it is impossible for MoviePy to guess the duration
attribute of the clip (keep in mind that some clips, like ImageClips displaying a picture, have a priori an infinite duration). Then, the duration
must be set manually with clip.set_duration
:
|
|
To write your video as an animated GIF, use
|
|
You can write a frame to an image file with
|
|
concatenating clips
|
|
CompositeVideoClips
也能合并clips
|
|
Clips transformations and effects
|
|
Example Scripts
https://zulko.github.io/moviepy/examples/examples.html