Beispiel #1
0
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()
Beispiel #2
0
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)
Beispiel #3
0
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')
Beispiel #4
0
# empty list of clips
clips = []

# while y is inside of canvas
while y < canvasHeight:

    # create a clip
    clip = Clip(video)

    # set clip position
    # add random offsets to each variable
    randomX = x + random.uniform(-delta, delta)
    randomY = y + random.uniform(-delta, delta)
    randomWidth = vidWidth + random.uniform(-delta, delta)
    randomHeight = vidHeight + random.uniform(-delta, delta)
    clip.position(x=randomX, y=randomY, w=randomWidth, h=randomHeight)

    # fade in for 0.1 second
    clip.fadein(0.1)

     # repeat the clip three times
    clip.repeat(3)

    # start the clip based on existing clips
    # add a random offset
    clip.set_offset(len(clips)*random.random())

    # add clip to list of clips
    clips.append(clip)

    # increment the x and y position
# 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
comp = Composition(clips, bgcolor='#ff4dff', duration=10.0)
comp.save('chromaRandom.mp4')
Beispiel #6
0
canvas_width = 1280
canvas_height = 720
vid_width = canvas_width/3
vid_height = (vid_width/canvas_width) * canvas_height

x = 0
y = 0

clips = []

while y < canvas_height:
    # create a clip
    clip = Clip(video)

    # set clip position
    clip.position(x=x, y=y, w=vid_width, h=vid_height)

    # fade in for 1/2 second
    clip.fadein(0.5)

    # repeat the clip three times
    clip.repeat(3)

    # start the clip based on existing clips
    clip.set_offset(len(clips)*.1)

    clips.append(clip)

    # increment the x and y position
    x += vid_width
    if x > canvas_width:
# start position
x = 0
y = 0

# empty list of clips
clips = []

# while y is inside of canvas
while y < canvasHeight:

    # create a clip
    clip = Clip(video)

    # set clip position
    clip.position(x=x, y=y, w=vidWidth, h=vidHeight)

    # fade in for 1/2 second
    clip.fadein(0.5)

    # repeat the clip three times
    clip.repeat(3)

    # start the clip based on existing clips
    # add an offset of 10%
    clip.set_offset(len(clips) * 0.10)

    # add clip to list of clips
    clips.append(clip)

    # increment the x and y position