Merge branch 'master' of github.com:3b1b/manim into clacks

This commit is contained in:
Grant Sanderson 2019-01-18 09:07:57 -08:00
commit 8ca535ffea
3 changed files with 16 additions and 21 deletions

View file

@ -1,37 +1,24 @@
FROM ubuntu:18.04 FROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -qqy RUN apt-get update -qqy
RUN apt-get install -qqy --no-install-recommends apt-utils RUN apt-get install -qqy --no-install-recommends apt-utils
WORKDIR /root WORKDIR /root
RUN apt-get install -qqy build-essential libsqlite3-dev sqlite3 bzip2 \ RUN apt-get install --no-install-recommends -qqy build-essential libsqlite3-dev sqlite3 bzip2 \
libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev \ libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev \
libgdbm-compat-dev liblzma-dev libreadline-dev \ libgdbm-compat-dev liblzma-dev libreadline-dev \
libncursesw5-dev libffi-dev uuid-dev libncursesw5-dev libffi-dev uuid-dev wget ffmpeg apt-transport-https texlive-latex-base \
RUN apt-get install -qqy wget texlive-full texlive-fonts-extra sox git libcairo2-dev libjpeg-dev libgif-dev && rm -rf /var/lib/apt/lists/*
RUN wget -q https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz RUN wget -q https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
RUN tar -xf Python-3.7.0.tgz RUN tar -xf Python-3.7.0.tgz
WORKDIR Python-3.7.0 WORKDIR Python-3.7.0
RUN ./configure > /dev/null && make -s && make -s install RUN ./configure > /dev/null && make -s && make -s install
RUN python3 -m pip install --upgrade pip RUN python3 -m pip install --upgrade pip
RUN apt-get install -qqy libcairo2-dev libjpeg-dev libgif-dev
COPY requirements.txt requirements.txt COPY requirements.txt requirements.txt
RUN python3 -m pip install -r requirements.txt RUN python3 -m pip install -r requirements.txt
RUN rm requirements.txt RUN rm requirements.txt
WORKDIR /root WORKDIR /root
RUN rm -rf Python-3.7.0* RUN rm -rf Python-3.7.0*
RUN apt-get install -qqy ffmpeg
ENV TZ=America/Los_Angeles ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get install -qqy apt-transport-https
RUN apt-get install -qqy texlive-latex-base
RUN apt-get install -qqy texlive-full
RUN apt-get install -qqy texlive-fonts-extra
RUN apt-get install -qqy sox
RUN apt-get install -qqy git
ENV DEBIAN_FRONTEND teletype ENV DEBIAN_FRONTEND teletype
ENTRYPOINT ["/bin/bash"] ENTRYPOINT ["/bin/bash"]

View file

@ -780,6 +780,9 @@ class Scene(Container):
) )
with open(file_list, 'w') as fp: with open(file_list, 'w') as fp:
for pf_path in partial_movie_files: for pf_path in partial_movie_files:
if os.name == 'nt':
pf_path = pf_path.replace('\\', '/')
fp.write("file {}\n".format(pf_path)) fp.write("file {}\n".format(pf_path))
movie_file_path = self.get_movie_file_path() movie_file_path = self.get_movie_file_path()
@ -795,8 +798,13 @@ class Scene(Container):
] ]
if not self.includes_sound: if not self.includes_sound:
commands.insert(-1, '-an') commands.insert(-1, '-an')
subprocess.call(commands)
combine_process = subprocess.Popen(commands)
combine_process.wait()
for pf_path in partial_movie_files:
os.remove(pf_path)
os.remove(file_list) os.remove(file_list)
print("File ready at {}".format(movie_file_path))
if self.includes_sound: if self.includes_sound:
sound_file_path = movie_file_path.replace( sound_file_path = movie_file_path.replace(

View file

@ -15,7 +15,7 @@ def add_extension_if_not_present(file_name, extension):
def guarantee_existance(path): def guarantee_existance(path):
if not os.path.exists(path): if not os.path.exists(path):
os.makedirs(path) os.makedirs(path)
return path return os.path.abspath(path)
def get_scene_output_directory(scene_class): def get_scene_output_directory(scene_class):
@ -78,4 +78,4 @@ def get_sorted_integer_files(directory,
elif remove_non_integer_files: elif remove_non_integer_files:
os.remove(full_path) os.remove(full_path)
indexed_files.sort(key=lambda p: p[0]) indexed_files.sort(key=lambda p: p[0])
return list(map(lambda p: p[1], indexed_files)) return list(map(lambda p: os.path.join(directory, p[1]), indexed_files))