diff --git a/manimlib/config.py b/manimlib/config.py index bb5e57ef4b..1de7bbd7cd 100644 --- a/manimlib/config.py +++ b/manimlib/config.py @@ -420,11 +420,12 @@ def get_file_writer_config(args: Namespace, custom_config: dict) -> dict: result["video_codec"] = args.vcodec elif args.transparent: result["video_codec"] = 'prores_ks' + result["pixel_format"] = '' elif args.gif: result["video_codec"] = '' if args.pix_fmt: - result["pix_fmt"] = args.pix_fmt + result["pixel_format"] = args.pix_fmt return result diff --git a/manimlib/scene/scene_file_writer.py b/manimlib/scene/scene_file_writer.py index 53bbb5891a..47698d0dbd 100644 --- a/manimlib/scene/scene_file_writer.py +++ b/manimlib/scene/scene_file_writer.py @@ -258,6 +258,10 @@ def open_movie_pipe(self, file_path: str) -> None: fps = self.scene.camera.fps width, height = self.scene.camera.get_pixel_shape() + vf_arg = 'vflip' + if self.pixel_format.startswith("yuv"): + vf_arg += f',eq=saturation={self.saturation}:gamma={self.gamma}' + command = [ FFMPEG_BIN, '-y', # overwrite output file if it exists @@ -266,7 +270,7 @@ def open_movie_pipe(self, file_path: str) -> None: '-pix_fmt', 'rgba', '-r', str(fps), # frames per second '-i', '-', # The input comes from a pipe - '-vf', f'vflip,eq=saturation={self.saturation}:gamma={self.gamma}', + '-vf', vf_arg, '-an', # Tells FFMPEG not to expect any audio '-loglevel', 'error', ]