def make_hands(): clips = [] backgrounds = glob.glob('images/*.jpg') background_clip = Clip(random.choice(backgrounds)) clips.append(background_clip) hands = glob.glob('hands/*.mp4') hand = random.choice(hands) x = random.randint(-400, -200) distance = 100 duration = 0 for i in range(0, 6): clip = Clip(hand) clip.chroma() clip.fadein(0.1) clip.fadeout(0.1) clip.set_offset(i * 0.5) clip.position(x=x) clips.append(clip) x += distance duration = clip.duration + i * 0.5 composition = Composition(clips, width=1280, height=720, duration=duration) composition.preview()
def make_video(): clips = [] blankclip = Clip('black.mp4') clips.append(blankclip) for video in mergeSequence: #print mergeSequence #print each video of the sequence and tagsself.and colors #filename = "./videos/" + video['id'] filename = video["path"] #print video print(filename) # if filename.endswith('mp3'): # continue clip = Clip(filename, start=video['start'], end=video['end']) # clip.position(x=0, y=0, w='100%', h='100%', distort=True) # clip.fx('crop', { # 'center': 1 # }) # clip.fx('affine', { # 'transition.geometry': '0/0:640x640', # 'transition.fill': 1, # 'transition.distort': 1, # 'transition.scale': 1, # 'scale': 1 # }) if "abstract" in video["tags"]: clip.fadein(1) clip.fadeout(1.5) if video in beginning: clip.fadein(3) if video in ending: clip.fadeout(1.5) if video in randomSounds: clip.fadein(1) clip.fadeout(1.5) clip.glow() clips.append(clip) print(mergeSequence[0]["id"]) # clips = clips[0:3] composition = Composition(clips, singletrack=True) videoName = "render/videoMergeClassic" + datetime.datetime.now().strftime( "%Y%m%d%H%M%S") + ".mp4" #composition.save(videoName) composition.preview()
def preview(self): '''Previews the clip''' from vidpy import Composition comp = Composition([self]) comp.preview()
from vidpy import Clip, Composition video1 = 'sunset/sunset1_small.mp4' clips = [] clip1 = Clip(video1) # attempt to automatically remove background color # you can also specify a color with color='#00ff00' clip1.chroma(amount=0.001) clip1.chroma(color="#9187ff") clips = [clip1] comp = Composition(clips, bgcolor='#FF87DC') comp.save('sunsetlayer1.mp4') comp.preview()
Freeman and slave, patrician and plebeian, lord and serf, guild-master and journeyman, in a word, oppressor and oppressed, stood in constant opposition to one another, carried on an uninterrupted, now hidden, now open fight, a fight that each time ended, either in a revolutionary reconstitution of society at large, or in the common ruin of the contending classes. In the earlier epochs of history, we find almost everywhere a complicated arrangement of society into various orders, a manifold gradation of social rank.''' sentences = text.split('\n') sentence = random.choice(sentences) sentence = sentence.strip() sentence = sentence.upper() backgrounds = glob.glob('images/*.jpg') background_image = random.choice(backgrounds) background_clip = Clip(background_image) background_clip.squareblur('0=0.8;40=0;60=0.2;100=0') clip = Text(sentence, olcolor='#00000', outline=10) # clip.position(x=0) clip.glow() composition = Composition([background_clip, clip], width=1280, height=720, duration=5) # composition.save('commie_{}.mp4'.format(time.time())) composition.preview()