Skip to content

Commit

Permalink
update dockerfile, add flag for high quality rendering (3b1b#573)
Browse files Browse the repository at this point in the history
Allow rendering in 1080p by passing `--high_quality` and update the Dockerfile and Compose file to install Manim directly into the container.
  • Loading branch information
eulertour authored Jun 3, 2019
1 parent 22c8aa0 commit ed24541
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ RUN apt-get update \
&& apt-get install -qqy --no-install-recommends \
apt-utils \
ffmpeg \
texlive-latex-base \
texlive-full \
texlive-fonts-extra \
sox \
libcairo2-dev \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt requirements.txt
RUN python -m pip install -r requirements.txt && rm requirements.txt
COPY . /manim
RUN cd /manim \
&& python setup.py sdist \
&& python -m pip install dist/manimlib*
ENTRYPOINT ["/bin/bash"]
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ services:
image: eulertour/manim:latest
# uncomment this line to build rather than pull the image
# build: .
volumes:
- ${MANIM_PATH:?MANIM_PATH environment variable isn't set}:/opt/manim
environment:
- PYTHONPATH=/opt/manim
working_dir: /opt/manim
entrypoint:
- python
- -m
- manim
volumes:
- ${INPUT_DIR:?INPUT_DIR environment variable isn't set}:/tmp/input
- ${OUTPUT_DIR:?OUTPUT_DIR environment variable isn't set}:/tmp/output
environment:
- FILE_DIR=/tmp/output
- MEDIA_DIR=/tmp/output
working_dir: /tmp/input
network_mode: "none"
7 changes: 7 additions & 0 deletions manimlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ def parse_cli():
action="store_true",
help="Render at a medium quality",
),
parser.add_argument(
"--high_quality",
action="store_true",
help="Render at a high quality",
),
parser.add_argument(
"-g", "--save_pngs",
action="store_true",
Expand Down Expand Up @@ -216,6 +221,8 @@ def get_camera_configuration(args):
camera_config.update(manimlib.constants.LOW_QUALITY_CAMERA_CONFIG)
elif args.medium_quality:
camera_config.update(manimlib.constants.MEDIUM_QUALITY_CAMERA_CONFIG)
elif args.high_quality:
camera_config.update(manimlib.constants.HIGH_QUALITY_CAMERA_CONFIG)
else:
camera_config.update(manimlib.constants.PRODUCTION_QUALITY_CAMERA_CONFIG)

Expand Down
2 changes: 1 addition & 1 deletion manimlib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
HIGH_QUALITY_CAMERA_CONFIG = {
"pixel_height": 1080,
"pixel_width": 1920,
"frame_rate": 30,
"frame_rate": 60,
}

MEDIUM_QUALITY_CAMERA_CONFIG = {
Expand Down

0 comments on commit ed24541

Please sign in to comment.