-
Notifications
You must be signed in to change notification settings - Fork 2
/
subclip.py
42 lines (34 loc) · 7.45 KB
/
subclip.py
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
36
37
38
39
40
41
42
import sox
import moviepy.editor as mp
import moviepy.video.fx.all as vfx
lyrics="Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a lit tle ri cher Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a lit tle ri cher Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a lit tle ri cher Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a lit tle ri cher Sor ry Link"
lyrics="Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a lit tle a lit tle ri cher Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a lit tle a lit tle ri cher Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're mmm a lit tle a lit tle ri cher Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a lit tle mmm a lit tle ri cher Sor ry Link"
lyrics="lamp oil lamp oil rope lamp oil lamp oil rope lamp oil lamp oil rope bombs bombs bombs lamp oil lamp oil rope lamp oil lamp oil rope lamp oil lamp oil rope bombs bombs bombs lamp oil lamp oil rope lamp oil lamp oil rope lamp oil lamp oil rope bombs bombs bombs lamp oil lamp oil rope lamp oil lamp oil rope lamp oil lamp oil rope bombs bombs bombs bombs"
lyrics="You want You want it Lamp Oil Rope Bombs It's yours my friend As long as2 you2 have e nough You want it Lamp Oil Rope Bombs It's yours my friend As long as2 you2 have e nough You want it Lamp Oil Rope Bombs It's yours my friend As long as2 you2 have e nough You want it Lamp Oil Rope Bombs It's yours my friend As long as2 you2 have e nough lamp oil As long as2 you2 have e nough lamp oil bombs ru"
lyrics="Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a mmm lit tle ri cher Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a mmm lit tle ri cher Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a mmm lit tle ri cher Sor ry Link I can't I can't give cre dit Come back when you're a mmm Come back when you're a mmm lit tle ri cher Sor ry Link"
l_list=lyrics.split()
tempo_arr=[0.46488280533333337, 0.7943834453333334, 0.7903162773333334, 0.7736423893333334, 1.4761018346666668, 0.7736423893333334, 1.4761018346666668, 1.153845056, 0.9901127786666668, 0.3596191946666667, 1.0890205013333334, 0.7763538346666666, 0.8760920000000001, 0.6905781120000001, 1.1793786666666666, 3.2308872213333335, 0.5445102506666667, 0.7763538346666666, 0.8760920000000001, 0.6905781120000001, 1.1793786666666666, 3.2308872213333335, 0.5987591680000001, 0.6562531484444445, 0.5465413333333333, 0.9132993333333334, 0.46488280533333337, 0.7943834453333334, 0.7903162773333334, 0.7736423893333334, 1.4761018346666668, 0.7736423893333334, 1.4761018346666668, 1.153845056, 0.9901127786666668, 0.3596191946666667, 1.0890205013333334, 0.7763538346666666, 0.8760920000000001, 0.6905781120000001, 1.1793786666666666, 3.2308872213333335, 0.5445102506666667, 0.7763538346666666, 0.8760920000000001, 0.6905781120000001, 1.1793786666666666, 3.2308872213333335, 0.5987591680000001, 0.6562531484444445, 0.5465413333333333, 0.9132993333333334, 0.46488280533333337, 0.7943834453333334, 0.7903162773333334, 0.7736423893333334, 1.4761018346666668, 0.7736423893333334, 1.4761018346666668, 1.153845056, 0.9901127786666668, 0.3596191946666667, 1.0890205013333334, 0.7763538346666666, 0.8760920000000001, 0.6905781120000001, 1.1793786666666666, 3.2308872213333335, 0.5445102506666667, 0.7763538346666666, 0.8760920000000001, 0.6905781120000001, 1.1793786666666666, 3.2308872213333335, 0.5987591680000001, 0.6562531484444445, 0.5465413333333333, 0.9132993333333334, 0.46488280533333337, 0.7943834453333334, 0.7903162773333334, 0.7736423893333334, 1.4761018346666668, 0.7736423893333334, 1.4761018346666668, 1.153845056, 0.9901127786666668, 0.3596191946666667, 1.0890205013333334, 0.7763538346666666, 0.8760920000000001, 0.6905781120000001, 1.1793786666666666, 3.2308872213333335, 0.5445102506666667, 0.7763538346666666, 0.8760920000000001, 0.6905781120000001, 1.1793786666666666, 3.2308872213333335, 0.5987591680000001, 0.6562531484444445, 0.5465413333333333, 0.9132993333333334, 0.46488280533333337, 0.7943834453333334, 2.3709488320000003]
note_length=[0.3997867803837953, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.29984008528784645, 0.29984008528784645, 0.3997867803837953, 0.3997867803837953, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.29984008528784645, 0.29984008528784645, 0.3997867803837953, 0.3997867803837953, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.29984008528784645, 0.29984008528784645, 0.3997867803837953, 0.3997867803837953, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.3997867803837953, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.19989339019189764, 0.29984008528784645, 0.29984008528784645, 0.3997867803837953, 0.3997867803837953, 0.19989339019189764, 0.13326226012793177, 0.13326226012793177, 0.13326226012793177, 0.13326226012793177, 0.13326226012793177, 0.13326226012793177, 0.3997867803837953, 0.3997867803837953]
sourcepath = r'C:/ytpmv/morshu/' # filepath
clips=[]
print(len(tempo_arr))
print(len(note_length))
print(len(l_list))
for i in range(len(tempo_arr)):
source_clip=mp.VideoFileClip(sourcepath+'long/rtxvid/'+l_list[i]+'.mp4')
sped_clip = source_clip.fx(vfx.speedx, tempo_arr[i])
sped_clip=source_clip
clips.append(sped_clip.subclip(0, note_length[i]))
'''
if i%70==69:
if i//70 < 5:
concat_clip = mp.concatenate_videoclips(clips, method="compose")
concat_clip.write_videofile(sourcepath+'concatted '+str(i//70)+'.mp4')
clips=[]
'''
concat_clip = mp.concatenate_videoclips(clips, method="compose")
concat_clip.write_videofile(sourcepath+'verse4.mp4')
'''
print(len(clip_number))
print(len(tempo_arr))
'''