My goal is to edit a video automatically, so that there are small parts reapeating in forward and backward motion with variable part lengths. The sequence of frames for part length 1 would be: 1 2 3 2 3 4 3 4 5 Part length 2: 1 2 3 2 1 2 3 4 3 2 3 4 5 A friend provided me with an array, which can generate this and other sequences.
#!/usr/bin/python
# coding: utf8
amplitude = 5 #Min 1
end = 30
drunkenArr = []
i = 0
while i <= end - amplitude + 1:
for j in range(amplitude):
drunkenArr.append(i + j)
for j in range(amplitude)[::-1][1:-2]:
drunkenArr.append(i + j)
i = i + 1
print drunkenArr
There could be multiple ways: - Opening a video file on consecutive frames and setting frame start to this sequence. This one will be very slow I think. - Opening one video file and cut and copy the frames after a pattern - converting the video file to single images and putting them into a folder ( could be done by hand, but with a script it would be much more convenient) and importing them in the sequence of an array.