-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathgenerate_demo.py
53 lines (43 loc) · 1.49 KB
/
generate_demo.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
import os
import json
from slideshow.SlideManager import SlideManager
import pkgutil
if __name__ == "__main__":
config = {}
with open(os.path.dirname(os.path.realpath(__file__)) + '/config.json') as config_file:
config = json.load(config_file)
config.update({
"output_width": 400,
"output_height": 250,
"output_codec": "",
"output_parameters": "",
"slide_duration": 2,
"slide_duration_min": 1,
"fade_duration": 1.0,
"transition_bars_count": 10,
"transition_cell_size": 50,
"fps": 30,
"overwrite": True
})
transitions = [package_name for importer, package_name, _ in pkgutil.iter_modules(["transitions"])]
for transition in transitions:
input_files = [{
"file": "docs\\media\\andrey-andreyev-dh8ONmfQyQQ-unsplash.jpg",
"transition": transition,
"title": transition,
"zoom_direction_x": "center",
"zoom_direction_y": "center",
"zoom_direction_z": "none",
"scale_mode": "pad"
},
{
"file": "docs\\media\\jeremy-bishop-h7bQ8VEZtws-unsplash.jpg",
"title": transition,
"zoom_direction_x": "center",
"zoom_direction_y": "center",
"zoom_direction_z": "none",
"scale_mode": "pad"
}]
sm = SlideManager(config, input_files, [])
sm.createVideo("docs\\demo\\%s.gif" % (transition))