-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtextandbackground.py
More file actions
35 lines (19 loc) · 836 Bytes
/
textandbackground.py
File metadata and controls
35 lines (19 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import numpy as np
from moviepy.editor import*
def backgroundgeneration(clips,video_Duration):
#Add a background to display on the video
backGround = (ImageClip("Background.jpg").set_duration(video_Duration))
clips.append(backGround)
return clips
#End of Background generation
def textgeneration(clips,arguments,screenSize):
#Generate Text to display on the video using inbuilt moviepy functions
if len(arguments)>2:
videoText = arguments[2]
else:
videoText = "No Text Entered"
textToBePrinted = TextClip(videoText,method='caption',color="purple",font="Arial",kerning=5,fontsize=50)
compositeClip = CompositeVideoClip([textToBePrinted.set_pos("bottom")],size=screenSize)
clips.append(compositeClip)
return clips
#End of Text Generation