From 09bed1f8f48ca8d6c3694ba4d6e533193ba202f3 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Thu, 22 Aug 2024 14:24:26 -0500 Subject: [PATCH] Allow more file_writer configuration in default_config.yml --- manimlib/config.py | 2 +- manimlib/default_config.yml | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/manimlib/config.py b/manimlib/config.py index a6a8f62b..5c796c67 100644 --- a/manimlib/config.py +++ b/manimlib/config.py @@ -402,7 +402,6 @@ def get_output_directory(args: Namespace, custom_config: dict) -> str: def get_file_writer_config(args: Namespace, custom_config: dict) -> dict: result = { "write_to_movie": not args.skip_animations and args.write_file, - "break_into_partial_movies": custom_config["break_into_partial_movies"], "save_last_frame": args.skip_animations and args.write_file, "save_pngs": args.save_pngs, # If -t is passed in (for transparent), this will be RGBA @@ -414,6 +413,7 @@ def get_file_writer_config(args: Namespace, custom_config: dict) -> dict: "open_file_upon_completion": args.open, "show_file_location_upon_completion": args.finder, "quiet": args.quiet, + **custom_config["file_writer_config"], } if args.vcodec: diff --git a/manimlib/default_config.yml b/manimlib/default_config.yml index bfee5293..637175fb 100644 --- a/manimlib/default_config.yml +++ b/manimlib/default_config.yml @@ -28,13 +28,18 @@ style: window_position: UR window_monitor: 0 full_screen: False -# If break_into_partial_movies is set to True, then many small -# files will be written corresponding to each Scene.play and -# Scene.wait call, and these files will then be combined -# to form the full scene. Sometimes video-editing is made -# easier when working with the broken up scene, which -# effectively has cuts at all the places you might want. -break_into_partial_movies: False +file_writer_config: + # If break_into_partial_movies is set to True, then many small + # files will be written corresponding to each Scene.play and + # Scene.wait call, and these files will then be combined + # to form the full scene. Sometimes video-editing is made + # easier when working with the broken up scene, which + # effectively has cuts at all the places you might want. + break_into_partial_movies: False + video_codec: "libx264" + pixel_format: "yuv420p" + saturation: 1.0 + gamma: 1.0 camera_resolutions: low: "854x480" med: "1280x720"