From 7a5b037ad863ed162e1929560b9b725cd1d5c858 Mon Sep 17 00:00:00 2001 From: yyhhyyyyyy <95077259+yyhhyyyyyy@users.noreply.github.com> Date: Tue, 24 Dec 2024 22:39:48 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Add=20video=20transition=20?= =?UTF-8?q?effects=20(fadein,=20fadeout)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/utils/video_effects.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 app/services/utils/video_effects.py diff --git a/app/services/utils/video_effects.py b/app/services/utils/video_effects.py new file mode 100644 index 0000000..3022cfc --- /dev/null +++ b/app/services/utils/video_effects.py @@ -0,0 +1,11 @@ +from moviepy import Clip, vfx + + +# FadeIn +def fadein_transition(clip: Clip, t: float) -> Clip: + return clip.with_effects([vfx.FadeIn(t)]) + + +# FadeOut +def fadeout_transition(clip: Clip, t: float) -> Clip: + return clip.with_effects([vfx.FadeOut(t)])