Using Python for simple media processing


Installation dependency

(sudo) pip install moviepy

Moviepy uses ffmpeg software to read and export video and audio files. Also use (optional) ImageMagick to generate text and GIF files. Different media processing relies on Python’s fast math library numpy. Advanced effects and enhancements use some Python image processing libraries (PIL, scikit image, SciPy, etc.).


Introducing moviepy

from moviepy.editor import *

Synthesis of audio files into video files

Videopath = "video address to synthesize audio"

Extracting audio from video

Video = videofileclip ("video address")

Get audio often

audio = AudioFileClip(sys.argv[2])

This work adoptsCC agreementReprint must indicate the author and the link of this article