forked from dylanswiggett/director-to-video
-
Notifications
You must be signed in to change notification settings - Fork 0
/
director.py
executable file
·32 lines (28 loc) · 920 Bytes
/
director.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python
# This will direct your movies
# They will be so good, you won't know what to do
# watch out hollywood
import star_trek_parse as parser
import google_images as gi
import ffmpeg_create_video as ffcv
import cv2
import sys
TESTFILE_PATH = "all-good-things.txt"
def main():
if len(sys.argv) == 2:
script = parser.parse(sys.argv[1])
else:
script = parser.parse(TESTFILE_PATH)
for scene in script.scenes:
scene.setting.image = cv2.cvtColor(gi.find_image(scene.setting.name), cv2.COLOR_BGR2RGB)
print "Casting..."
for character in script.characters.values():
print(character.name)
character_data = gi.find_character(character.name)
loc, image = character_data
print loc
character.loc = loc
character.image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
ffcv.create_video(script)
if __name__=="__main__":
main()