git @ Cat's Eye Technologies kinoje / 515e56a
Simplify orchestrator. Chris Pressey 4 years ago
1 changed file(s) with 4 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
1111
1212 from kinoje.expander import Expander
1313 from kinoje.renderer import Renderer
14 from kinoje.compiler import Compiler
14 from kinoje.compiler import Compiler, SUPPORTED_OUTPUT_FORMATS
1515
1616 from kinoje.utils import LoggingExecutor, load_config_file
17
18
19 SUPPORTED_OUTPUT_FORMATS = ('.m4v', '.mp4', '.gif')
2017
2118
2219 def main():
4138 output_filename = configbase + '.mp4'
4239 else:
4340 output_filename = options.output
44 (whatever, outext) = os.path.splitext(output_filename)
45 if outext not in SUPPORTED_OUTPUT_FORMATS:
46 raise ValueError("%s not a supported output format (%r)" % (outext, SUPPORTED_OUTPUT_FORMATS))
41
42 CompilerClass = Compiler.get_class_for(output_filename)
4743
4844 config = load_config_file(options.configfile)
4945
6258 renderer.render_all()
6359
6460 print('compiling frames to movie...')
65 compiler = Compiler.get_class_for(output_filename)(config, frames_dir, output_filename, exe=exe, tqdm=tqdm)
61 compiler = CompilerClass(config, frames_dir, output_filename, exe=exe, tqdm=tqdm)
6662 compiler.compile_all()
6763
6864 exe.close()