mirror of
https://github.com/3b1b/manim.git
synced 2025-11-15 22:57:46 +00:00
Add option for gamma correction to SceneFileWriter
This commit is contained in:
parent
ded06c1f88
commit
3e3e4de5e9
1 changed files with 4 additions and 2 deletions
|
|
@ -49,7 +49,8 @@ class SceneFileWriter(object):
|
||||||
progress_description_len: int = 40,
|
progress_description_len: int = 40,
|
||||||
video_codec: str = "libx264",
|
video_codec: str = "libx264",
|
||||||
pixel_format: str = "yuv420p",
|
pixel_format: str = "yuv420p",
|
||||||
saturation: float = 1.7
|
saturation: float = 1.7,
|
||||||
|
gamma: float = 1.2,
|
||||||
):
|
):
|
||||||
self.scene: Scene = scene
|
self.scene: Scene = scene
|
||||||
self.write_to_movie = write_to_movie
|
self.write_to_movie = write_to_movie
|
||||||
|
|
@ -69,6 +70,7 @@ class SceneFileWriter(object):
|
||||||
self.video_codec = video_codec
|
self.video_codec = video_codec
|
||||||
self.pixel_format = pixel_format
|
self.pixel_format = pixel_format
|
||||||
self.saturation = saturation
|
self.saturation = saturation
|
||||||
|
self.gamma = gamma
|
||||||
|
|
||||||
# State during file writing
|
# State during file writing
|
||||||
self.writing_process: sp.Popen | None = None
|
self.writing_process: sp.Popen | None = None
|
||||||
|
|
@ -264,7 +266,7 @@ class SceneFileWriter(object):
|
||||||
'-pix_fmt', 'rgba',
|
'-pix_fmt', 'rgba',
|
||||||
'-r', str(fps), # frames per second
|
'-r', str(fps), # frames per second
|
||||||
'-i', '-', # The input comes from a pipe
|
'-i', '-', # The input comes from a pipe
|
||||||
'-vf', f'eq=saturation={self.saturation},vflip',
|
'-vf', f'vflip,eq=saturation={self.saturation}:gamma={self.gamma}',
|
||||||
'-an', # Tells FFMPEG not to expect any audio
|
'-an', # Tells FFMPEG not to expect any audio
|
||||||
'-loglevel', 'error',
|
'-loglevel', 'error',
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue