-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add render option to use x265 with lossless settings
By default we use x264 when rendering to the `mp4` format with `crf` set to 23. x265 (hevc) has a [lossless](https://x265.readthedocs.io/en/stable/lossless.html) mode, where the encoder is configured such that the output is an exact copy of the input. Since `manim` scenes consist of text and shapes, the lossless mode works well for us, and ensures that the output videos will be the highest quality when desired. This means that users can safely do an editing pass without risking losing further quality. Anecdotally, I've noticed slightly better performance than x264 with about 2.5x the file size. Before: Before (1,436,872 bytes): ```shell $ time venv/bin/manim -pqm quad.py Fermat ... venv/bin/manim -pqm quad.py Fermat 59.41s user 144.46s system 253% cpu 1:20.44 total ``` After (3,494,923 bytes): ```shell $ time venv/bin/manim -pqm quad.py Fermat --lossless ... venv/bin/manim -pqm quad.py Fermat --lossless 144.52s user 12.46s system 274% cpu 57.276 total ``` So, I added this as an option (for `mp4` containers).
- Loading branch information
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters