Ejemplo n.º 1
0
myclip_arr=[]

dur_arr=beats
print(dur_arr)
l2=lyrics.split(',')
low=0
hi=0
new_arr=dur_arr
lyrics_tight="Ever on and on I continue circling9With nothing but my hate in a carousel of agony9Till slowly I forget and my heart starts vanishing9And suddenly I see that I can't break free- I'm9Slipping through the cracks of a dark eternity9With nothing but my pain and the paralyzing agony9To tell me who I am who I was uncertainty9Enveloping my mind till I can't break free9And maybe it's a dream maybe nothing else is real9But it wouldn't mean a thing if I told you how I feel9So I'm tired of all the pain of the misery inside9And I wish that I could live feeling nothing but the night9You can tell me what to say you can tell me where to go9But I doubt that I would care and my heart would never know9If I make another move there'd be no more turning back9Because everything would change and all will fade to black9Will tomorrow ever come? Will I make it through the night?9Will there ever be a place for the broken in the light?9Am I hurting? Am I sad? Should I stay or should I go?9I've forgotten how to tell did I ever even know?9Can I take another step? I've done everything I can9All the people that I see they will never understand9If I find a way to change if I step into the light9Then I'll never be the same and it all will fade to white9Ever on and on I continue circling9With nothing but my hate in a carousel of agony9Till slowly I forget and my heart starts vanishing9And suddenly I see that I can't break free- I'm9Slipping through the cracks of a dark eternity9With nothing but my pain and the paralyzing agony9To tell me who I am who I was uncertainty9Enveloping my mind till I can't break free9And maybe it's a dream maybe nothing else is real9But it wouldn't mean a thing if I told you how I feel9So I'm tired of all the pain of the misery inside9And I wish that I could live feeling nothing but the night9You can tell me what to say you can tell me where to go9But I doubt that I would care and my heart would never know9If I make another move there'd be no more turning back9Because everything would change and all will fade to black9If I make another move If I take another step9Then it all would fall apart There'd be nothing of me left9If I'm crying in the wind If I'm crying in the night9Will there ever be away? Will my heart return to white?9Can you tell me who you are? Can you tell me where I am?9I've forgotten how to see I've forgotten if I can9If I opened up my eyes there'd be no more going back9'Cause I'd throw it all away and it all will fade to black"

lyrics_tight=lyrics_tight.split('9')

print(len(new_arr))
print(len(lyrics_tight))

for index, ele in enumerate(lyrics_tight):
    txtClip=TextClip(ele,color='white', font="YuGothR", fontsize=40, stroke_width=2, stroke_color='black')
    myclip = CompositeVideoClip([txtClip.set_pos(('center','bottom'))], size=screensize, bg_color=[0x00,0x00,0xFF])
    myclip=myclip.set_duration(new_arr[index])
    myclip_arr.append(myclip)
    if lyrics_tight[index]==lyrics_tight[index-1]:
        print(ele,new_arr[index])


final_clip = concatenate_videoclips(myclip_arr)
final_clip.write_videofile("fullch eng.mp4",fps=24)
myclip.close()
final_clip=[]
prev=VideoFileClip("fullch.mp4")
'''
'''
Ejemplo n.º 2
0
def make_clip(clip, text, height, width, font, font_color, fontsize):
    if font is None:
        return clip
    #TODO: make text caption style configurable
    #Swimming changes text color to light blue, moves text up and resized
    #it
    #It also adds black stroke that's why resizing is needed
    #And adds icon of swimming on the bottom
    if text.startswith("KOP:"):
        text = text[4:]
        font_color_c = "#00aaff"
        pos = "top"
        swimm = True
        stroke_color = "black"
        factor = 2
        mult = 1.4 * factor
    else:
        font_color_c = font_color
        pos = "bottom"
        swimm = False
        stroke_color = None
        mult = 1
        factor = 1
    if width is None:
        text_space_size = None
    else:
        text_space_size = (width * factor, 40 * factor)
    text_caption = TextClip(text,
                            size=text_space_size,
                            method="caption",
                            align="center",
                            color=font_color_c,
                            fontsize=fontsize * mult,
                            font=font,
                            stroke_color=stroke_color)
    if swimm:
        text_caption = text_caption.fx(resize, height=text_caption.h / 2)
    text_caption = text_caption.set_pos(("center", "center"))
    #print (clip.size, tc.size)
    #TODO: makes transparent bar size same size (based on highest caption)
    #adds 60% transparent bar under the caption
    #Bar starts 5 pixels above caption and ends at the bottom
    if not swimm:
        text_caption_bar = text_caption.on_color(size=(clip.w,
                                                       text_caption.h + 5),
                                                 color=(0, 0, 0),
                                                 pos=('center'),
                                                 col_opacity=0.6)
        text_caption_with_bar = text_caption_bar.set_pos(('center', 'bottom'))
    else:
        text_caption_with_bar = text_caption.set_pos(('center', 20))
    clips = [clip, text_caption_with_bar]
    if swimm:
        swimm_size = fontsize
        #TODO: make location of this configurable
        swim_clip = \
        SVGImageClip("/home/mabu/programiranje/overlay/projects/glein/images/swimming-15.svg",
                width=swimm_size, height=swimm_size).set_pos(('center',
            clip.h-20-swimm_size))
        clips.append(swim_clip)
    return (CompositeVideoClip(clips) \
            .set_duration(clip.duration))