Skip to content

Commit

Permalink
Give SceneFileWriter an option for saturation, and set default to 1.7
Browse files Browse the repository at this point in the history
The colors in a scene can look a little different in a preview window vs. in the rendered file written by ffmpeg. This is mean to bring them closer together.
  • Loading branch information
3b1b committed Feb 9, 2023
1 parent f2c07af commit ded06c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manimlib/scene/scene_file_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(
progress_description_len: int = 40,
video_codec: str = "libx264",
pixel_format: str = "yuv420p",
saturation: float = 1.7
):
self.scene: Scene = scene
self.write_to_movie = write_to_movie
Expand All @@ -67,6 +68,7 @@ def __init__(
self.progress_description_len = progress_description_len
self.video_codec = video_codec
self.pixel_format = pixel_format
self.saturation = saturation

# State during file writing
self.writing_process: sp.Popen | None = None
Expand Down Expand Up @@ -262,7 +264,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', 'vflip',
'-vf', f'eq=saturation={self.saturation},vflip',
'-an', # Tells FFMPEG not to expect any audio
'-loglevel', 'error',
]
Expand Down

0 comments on commit ded06c1

Please sign in to comment.