from moviepy.editor import VideoFileClip def grayscale(image): return image.convert('L') clip = VideoFileClip('input.mp4') new_clip = clip.fl_image(grayscale) new_clip.write_videofile('output.mp4')
from moviepy.editor import VideoFileClip from PIL import Image def rotate(image): return image.rotate(90) clip = VideoFileClip('input.mp4') new_clip = clip.fl_image(rotate) new_clip.write_videofile('output.mp4')The package library used in the above examples is moviepy.