From f9ce36c6f6e1ee834e400c50dc76dccc2ca8c042 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Wed, 8 Aug 2018 11:50:34 -0700 Subject: [PATCH] Camera background is opacity 0 when -t is passed in, otherwise 1 --- camera/camera.py | 2 +- extract_scene.py | 13 ++++++++++--- scene/scene.py | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/camera/camera.py b/camera/camera.py index ba0e6c72..56800683 100644 --- a/camera/camera.py +++ b/camera/camera.py @@ -39,7 +39,7 @@ class Camera(object): "frame_width": FRAME_WIDTH, "frame_center": ORIGIN, "background_color": BLACK, - "background_opacity": 0, + "background_opacity": 1, # Points in vectorized mobjects with norm greater # than this value will be rescaled. "max_allowable_norm": FRAME_WIDTH, diff --git a/extract_scene.py b/extract_scene.py index 1471cb1d..e0a26790 100644 --- a/extract_scene.py +++ b/extract_scene.py @@ -106,16 +106,23 @@ def get_configuration(): "start_at_animation_number": args.start_at_animation_number, "end_at_animation_number": None, } + + # Camera configuration + config["camera_config"] = {} if args.low_quality: - config["camera_config"] = LOW_QUALITY_CAMERA_CONFIG + config["camera_config"].update(LOW_QUALITY_CAMERA_CONFIG) config["frame_duration"] = LOW_QUALITY_FRAME_DURATION elif args.medium_quality: - config["camera_config"] = MEDIUM_QUALITY_CAMERA_CONFIG + config["camera_config"].update(MEDIUM_QUALITY_CAMERA_CONFIG) config["frame_duration"] = MEDIUM_QUALITY_FRAME_DURATION else: - config["camera_config"] = PRODUCTION_QUALITY_CAMERA_CONFIG + config["camera_config"].update(PRODUCTION_QUALITY_CAMERA_CONFIG) config["frame_duration"] = PRODUCTION_QUALITY_FRAME_DURATION + if args.transparent: + config["camera_config"]["background_opacity"] = 0 + + # Arguments related to skipping stan = config["start_at_animation_number"] if stan is not None: if "," in stan: diff --git a/scene/scene.py b/scene/scene.py index a49edea4..61e9b21a 100644 --- a/scene/scene.py +++ b/scene/scene.py @@ -591,7 +591,7 @@ class Scene(Container): # This is if the background of the exported video # should be transparent. command += [ - '-vcodec', 'png', + '-vcodec', 'qtrle', ] else: command += [