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()
import time from vidpy import Clip, Composition hands = glob.glob('hands/*.mp4') hand = random.choice(hands) print hand clips = [] x = -400 start = 0 backgrounds = ['#2cffff', '#fc282a', '#fcdb2a', '#2452d8'] for i in range(0, 6): # same as for i in [0, 1, 2, 3, 4] clip = Clip(hand) clip.chroma() clip.set_offset(start) clip.position(x=x) clip.fadein(0.2) clip.fadeout(0.2) clips.append(clip) start += 0.5 x += 150 composition = Composition(clips, bgcolor=random.choice(backgrounds)) outname = 'coolhands_{}.mp4'.format(int(time.time())) composition.save(outname)
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()
from vidpy import Clip, Composition video = 'videos/hand1.mp4' clips = [] for i in range(0, 5): clip = Clip(video) # attempt to automatically remove background color # you can also specify a color with color='#00ff00' clip.chroma(amount=0.2) # start the clips 1/2 second after last clip clip.set_offset(i * 0.5) # change the clips x coordinate clip.position(x=(i * 100) - 300) # loop the clip 3 times clip.repeat(3) clips.append(clip) comp = Composition(clips, bgcolor='#ff4dff', duration=4) comp.save('chroma_overlay.mp4')
# empty list of clips clips = [] # variable for introducing randomness delta = 5 # variable for number of copies numberCopies = 100 for i in range(0, numberCopies): clip = Clip(video) # attempt to automatically remove background color # you can also specify a color with color='#00ff00' clip.chroma(amount=0.2, color="#000000") # start the clips 1/2 second after last clip clip.set_offset(i * 0.5) # change the clips x coordinate clip.position(x=(i * 10 * random.random()) - 30) # loop the clip 3 times clip.repeat(3) clips.append(clip) # composition made out of clips # bgcolor picks background color # duration picks duration of video
from vidpy import Clip, Composition video1 = "files/rainTest.mp4" video2 = "files/N2.mov" clips = [] clip1 = Clip(video1) # attempt to automatically remove background color # you can also specify a color with color='#00ff00' clip1.chroma(amount=5.8) clip1.chroma(color="#00FFFF") clip2 = Clip(video2) clips = [clip2, clip1] comp = Composition(clips, bgcolor='#ffffff') comp.save('output/test.mp4') comp.preview()