Debian Codegraph @

flowblade-trunk/Flowblade/launch/flowbladestabilizeheadless

raw
1 #!/usr/bin/python3
2
3 import sys
4 import os
5
6 def _get_arg_value(args, key_str):
7 for arg in sys.argv:
8 parts = arg.split(":")
9 if len(parts) > 1:
10 if parts[0] == key_str:
11 return parts[1]
12
13 return None
14
15 modules_path = os.path.dirname(os.path.abspath(sys.argv[0])).rstrip("/launch")
16
17 sys.path.insert(0, modules_path)
18 import processutils
19 processutils.update_sys_path(modules_path)
20
21 try:
22 import stabilizeheadless
23 root_dir = modules_path.split("/")[1]
24
25 session_id = _get_arg_value(sys.argv, "session_id")
26 parent_folder = _get_arg_value(sys.argv, "parent_folder")
27 write_file = _get_arg_value(sys.argv, "write_file")
28 clip_path = _get_arg_value(sys.argv, "clip_path")
29 accuracy = _get_arg_value(sys.argv, "accuracy")
30 shakiness = _get_arg_value(sys.argv, "shakiness")
31 smoothing = _get_arg_value(sys.argv, "smoothing")
32 zoom = _get_arg_value(sys.argv, "zoom")
33 profile_desc_under_score = _get_arg_value(sys.argv, "profile_desc")
34 profile_desc = profile_desc_under_score.replace("_", " ") # We need to put underscores in profile names to get them here in one piece.
35 # Now we take underscores out to get correct MLT profile names.
36 except Exception as err:
37 print ("Failed to import statbilizeheadless")
38 print ("ERROR:", err)
39 print ("Installation was assumed to be at:", modules_path)
40 sys.exit(1)
41
42 stabilizeheadless.main(modules_path, session_id, parent_folder, profile_desc, write_file, clip_path, accuracy, shakiness, smoothing, zoom)
43
44
45
46