From 5b33b2cd66bb101c8c38f1c4029e53bfae3815ca Mon Sep 17 00:00:00 2001 From: Artemy Date: Sun, 16 Apr 2023 08:51:19 +0300 Subject: [PATCH] feat: convert images to video --- processing/bulk.py | 11 +++++++++++ requirements.txt | 1 + 2 files changed, 12 insertions(+) create mode 100644 processing/bulk.py diff --git a/processing/bulk.py b/processing/bulk.py new file mode 100644 index 0000000..5bff6b4 --- /dev/null +++ b/processing/bulk.py @@ -0,0 +1,11 @@ +from PIL import Image, ImageFilter +import ffmpeg +import os + + +def images_to_video(directory, fps): + glob_path = os.path.join(directory, "*.png") + video_path = os.path.join(directory, "video.mp4") + + ffmpeg.input(glob_path, pattern_type="glob", + framerate=fps).output(video_path).run() diff --git a/requirements.txt b/requirements.txt index 210ff6c..a533a59 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +ffmpeg_python==0.2.0 gradio==3.27.0 Pillow==9.5.0 tqdm==4.65.0